Skip to content

Commit

Permalink
Use walltime limit for cleanup and other minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
nuwang committed Feb 20, 2024
1 parent 287cf13 commit 8225be5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions galaxy/templates/cronjob-maintenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "galaxy.fullname" $ }}-maintenance-{{ $key }}
name: {{ include "galaxy.fullname" $ }}-cron-{{ $key }}
labels:
{{- include "galaxy.labels" $ | nindent 4 }}
spec:
Expand All @@ -21,7 +21,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
containers:
- name: galaxy-maintenance-{{ $key }}
- name: galaxy-cron-{{ $key }}
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command:
Expand Down
10 changes: 5 additions & 5 deletions galaxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ cronJobs:
maintenance:
schedule: "5 2 * * *"
extraSettings:
days: 7
days: '7'
securityContext:
runAsUser: 0
command:
Expand All @@ -292,12 +292,12 @@ cronJobs:
- "/galaxy/server/scripts/maintenance.sh"
- "--no-dry-run"
- "--days"
- "{{ .Values.cronJobs.maintenance.extraSettings.days }}"
- "{{ tpl .Values.cronJobs.maintenance.extraSettings.days $ }}"
#- Remove files from the tmp directory that are older than the allowable wall time for a job
tmp:
tmpdir:
schedule: "15 2 * * *"
extraSettings:
seconds: 604800
days: '{{ div (index .Values "configs" "job_conf.yml" "runners" "k8s" "k8s_walltime_limit" | default 604800) 7 }}'
securityContext:
runAsUser: 0
command:
Expand All @@ -306,7 +306,7 @@ cronJobs:
- "{{ .Values.persistence.mountPath }}/tmp"
- "!"
- "-newermt"
- "{{ .Values.cronJobs.tmp.extraSettings.seconds }}"
- "{{ tpl .Values.cronJobs.tmpdir.extraSettings.days $ }}"
- "seconds"
- "-type"
- "f"
Expand Down

0 comments on commit 8225be5

Please sign in to comment.