Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PR: policy package support for Rucio server #223

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Chart dependencies
**/charts/*.tgz

# macOS
.DS_Store
2 changes: 1 addition & 1 deletion charts/rucio-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: rucio-server
version: 36.0.1
version: 36.0.2
apiVersion: v1
description: A Helm chart to deploy servers for Rucio
keywords:
Expand Down
31 changes: 31 additions & 0 deletions charts/rucio-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ spec:
{{- end }}
- name: httpdlog
emptyDir: {}
{{- if .Values.policyPackages.enabled }}
- name: policy-package-volume
persistentVolumeClaim:
claimName: policy-package-volume
{{- end }}
{{- range $key, $val := .Values.secretMounts }}
- name: {{ coalesce $val.volumeName $val.secretName $val.secretFullName }}
secret:
Expand Down Expand Up @@ -86,6 +91,24 @@ spec:
secret:
secretName: {{ .Release.Name }}-server-cafile
{{- end }}
{{- end }}
{{- if .Values.policyPackages.enabled }}
initContainers:
- name: install-policy-packages
# A slim Python image could be used instead, but using the same image as the base image for the main container ensures that the same Python version is used
image: almalinux:9
command:
- "sh"
- "-c"
- |
{{- range .Values.policyPackages.packages }}
if [ ! -d {{ $.Values.policyPackages.mountPath }}{{ .moduleName }}-{{ .version }}.dist-info ]; then
dnf install -y git-all python-pip && pip install {{ .requirement }} -t {{ $.Values.policyPackages.mountPath }};
fi;
{{- end }}
volumeMounts:
- name: policy-package-volume
mountPath: {{ .Values.policyPackages.mountPath }}
{{- end }}
containers:
{{- if .Values.exposeErrorLogs }}
Expand Down Expand Up @@ -130,6 +153,10 @@ spec:
mountPath: /opt/certs
{{- end }}
{{- end }}
{{- if .Values.policyPackages.enabled }}
- name: policy-package-volume
mountPath: {{ .Values.policyPackages.mountPath }}
{{- end }}
- name: httpdlog
mountPath: /var/log/httpd
{{- range $key, $val := .Values.secretMounts }}
Expand Down Expand Up @@ -227,6 +254,10 @@ spec:
- name: {{ $key1 | upper }}
value: "{{ $val1 }}"
{{- end}}
{{- if .Values.policyPackages.enabled}}
- name: PYTHONPATH
value: {{.Values.policyPackages.mountPath}}:${PYTHONPATH}
{{- end}}
{{- if .Values.useSSL }}
- name: RUCIO_ENABLE_SSL
value: "True"
Expand Down
21 changes: 21 additions & 0 deletions charts/rucio-server/templates/policy-package-storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.policyPackages.enabled }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.policyPackages.storageClass.name }}
provisioner: {{ .Values.policyPackages.storageClass.provisioner }}
reclaimPolicy: {{ .Values.policyPackages.storageClass.reclaimPolicy }}
allowVolumeExpansion: true
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: policy-package-volume
spec:
storageClassName: {{ .Values.policyPackages.storageClass.name }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.policyPackages.resources.requests.storage }}
{{- end }}
27 changes: 26 additions & 1 deletion charts/rucio-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ useSSL: false

image:
repository: rucio/rucio-server
tag: release-34.2.0
tag: release-36.2.0
pullPolicy: Always

imagePullSecrets: []
Expand Down Expand Up @@ -148,6 +148,31 @@ ftsRenewal:
cpu: 100m
memory: 128Mi

policyPackages:
enabled: false
# Make sure the trailing slash is present
mountPath: /opt/policy_packages/
# Use underscores instead of hyphens for module names
# (e.g. atlas_rucio_policy_package instead of atlas-rucio-policy-package)
packages: []
# # example: install from an index (default is PyPI)
# - moduleName: vo_1_policy_package
# requirement: vo_1_policy_package==1.4.0
# version: 1.4.0
# # example: install from a git repository
# - moduleName: vo_2_policy_package
# requirement: git+https://github.com/rucio/[email protected]
# version: 0.1.0
resources:
requests:
# Storage required by the policy packages - resize if needed
storage: 100Mi
storageClass:
# name:
# provisioner:
# reclaimPolicy:


automaticRestart:
enabled: 0
image:
Expand Down
Loading