Skip to content

Commit

Permalink
Data Lifecycle Operations (#921)
Browse files Browse the repository at this point in the history
* Add internal endpoint to perform data lifecycle operations
* Update helm chart to deploy data lifecycle job
* Delete minioCleanup service
  • Loading branch information
BenGalewsky authored Nov 21, 2024
1 parent cf62fb7 commit 4abfc95
Show file tree
Hide file tree
Showing 31 changed files with 601 additions and 1,356 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/deploy-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,5 @@
"dir_name": "code_generator_funcadl_xAOD",
"image_name": "servicex_code_gen_atlas_xaod",
"test_required": true
},
{
"dir_name": "minio_cleanup",
"image_name": "servicex_minio_cleanup",
"test_required": false
}
]
214 changes: 105 additions & 109 deletions docs/deployment/reference.md

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions helm/servicex/templates/data-lifecycle/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.dataLifecycle.enabled -}}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Release.Name }}-data-lifecycle-job
spec:
schedule: {{ .Values.dataLifecycle.schedule | default "* */8 * * *" | quote }}
concurrencyPolicy: "Forbid"
jobTemplate:
spec:
template:
metadata:
labels:
app: {{ .Release.Name }}-data-lifecycle-job
spec:
containers:
- name: {{ .Release.Name }}-data-lifecycle-job
image: {{ .Values.dataLifecycle.image }}:{{ .Values.dataLifecycle.tag }}
imagePullPolicy: {{ .Values.dataLifecycle.pullPolicy }}
env:
- name: RETENTION_PERIOD
value: {{ .Values.dataLifecycle.retention }}

command:
- /bin/sh
- -c
- |
CUTOFF_TIMESTAMP=$(date -d "$RETENTION_PERIOD" +%Y-%m-%dT%H:%M:%S) &&
echo "Request data lifecycle with cutoff timestamp: $CUTOFF_TIMESTAMP" &&
curl --request POST "http://{{ .Release.Name }}-servicex-app:8000/servicex/internal/data-lifecycle?cutoff_timestamp=$CUTOFF_TIMESTAMP"
restartPolicy: OnFailure
{{- end }}
72 changes: 0 additions & 72 deletions helm/servicex/templates/minio-cleanup/cronjob.yaml

This file was deleted.

20 changes: 12 additions & 8 deletions helm/servicex/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,18 @@ x509Secrets:
pullPolicy: Always
tag: develop
vomsOrg: atlas
minioCleanup:

dataLifecycle:
enabled: false
image: sslhep/servicex_minio_cleanup
threads: "6"
logLevel: "INFO"
# This image should be a fully functional linux image with gnu date installed
# ideally it should be an image we have already pulled
image: python
tag: "3.10"
pullPolicy: Always
tag: develop
schedule: "* */8 * * *"
maxAge: 30
maxSize: "1G"
normSize: "700M"

# We will archive any transforms older than this. Use the gnu date command
# --date argument.
# See https://www.geeksforgeeks.org/date-command-linux-examples/#4-how-to-display-past-dates
# for examples
retention: "7 days ago"
29 changes: 0 additions & 29 deletions minio_cleanup/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions minio_cleanup/README.md

This file was deleted.

Loading

0 comments on commit 4abfc95

Please sign in to comment.