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

Update reset jobs making them recreatable #102

Merged
merged 1 commit into from
Jan 2, 2024
Merged
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
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 }}
Loading