Skip to content

Commit

Permalink
Update reset jobs making them recreatable (#102)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Halder <[email protected]>
  • Loading branch information
rustyShacklefurd authored Jan 2, 2024
1 parent 30adb61 commit f11e88c
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions charts/templates/server-repository/reset-job.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
{{- if .Values.reset.previewnet_reset.enabled }}
apiVersion: batch/v1
kind: Job
kind: CronJob
metadata:
name: {{ printf "%s-%s" .Chart.Name "prvw-reset-job" | trimSuffix "-"| trunc 52 }}
spec:
# activeDeadlineSeconds: 600 ## this is used to termanate the job after 10 minutes. How long does it take to reset and shoud this be set?
# backoffLimit: 0 # Number of failed retries before considering a Job as failed. Defaults to 6 if not set. Should this be set to 0? How many failures are acceptable?
template:
concurrencyPolicy: Forbid
# This is purposely set to a date known to never exist. This should only be run via manual trigger, never by time based trigger
schedule: "0 0 31 2 *"
jobTemplate:
spec:
containers:
- name: reset
image: "{{ .Values.reset.image.repository }}:{{ .Values.reset.image.tag }}"
imagePullPolicy: {{ .Values.reset.image.pullPolicy }}
command:
- /bin/sh
- -c
- https://raw.githubusercontent.com/hashgraph/hedera-sourcify/main/scripts/hedera-reset.sh ; chmod +x hedera-reset.sh ; ./hedera-reset.sh previewnet
backoffLimit: 0
template:
spec:
serviceAccountName: {{ template "sourcify.serverRepository.serviceAccountName" . }}
restartPolicy: Never
containers:
- name: reset
image: "{{ .Values.reset.image.repository }}:{{ .Values.reset.image.tag }}"
imagePullPolicy: {{ .Values.reset.image.pullPolicy }}
command:
- /bin/sh
- -c
- wget https://raw.githubusercontent.com/hashgraph/hedera-sourcify/main/scripts/hedera-reset.sh ; chmod +x hedera-reset.sh ; ./hedera-reset.sh previewnet
{{- end }}

---
{{- if .Values.reset.testnet_reset.enabled }}
apiVersion: batch/v1
kind: Job
kind: CronJob
metadata:
name: {{ printf "%s-%s" .Chart.Name "tsnt-reset-job" | trimSuffix "-"| trunc 52 }}
spec:
# activeDeadlineSeconds: 600 ## this is used to termanate the job after 10 minutes. How long does it take to reset and shoud this be set?
# backoffLimit: 0 # Number of failed retries before considering a Job as failed. Defaults to 6 if not set. Should this be set to 0? How many failures are acceptable?
template:
concurrencyPolicy: Forbid
# This is purposely set to a date known to never exist. This should only be run via manual trigger, never by time based trigger
schedule: "0 0 31 2 *"
jobTemplate:
spec:
containers:
- name: reset
image: "{{ .Values.reset.image.repository }}:{{ .Values.reset.image.tag }}"
imagePullPolicy: {{ .Values.reset.image.pullPolicy }}
command:
- /bin/sh
- -c
- https://raw.githubusercontent.com/hashgraph/hedera-sourcify/main/scripts/hedera-reset.sh ; chmod +x hedera-reset.sh ; ./hedera-reset.sh testnet
backoffLimit: 0
template:
spec:
serviceAccountName: {{ template "sourcify.serverRepository.serviceAccountName" . }}
restartPolicy: Never
containers:
- name: reset
image: "{{ .Values.reset.image.repository }}:{{ .Values.reset.image.tag }}"
imagePullPolicy: {{ .Values.reset.image.pullPolicy }}
command:
- /bin/sh
- -c
- wget https://raw.githubusercontent.com/hashgraph/hedera-sourcify/main/scripts/hedera-reset.sh ; chmod +x hedera-reset.sh ; ./hedera-reset.sh testnet
{{- end }}

0 comments on commit f11e88c

Please sign in to comment.