Skip to content

Commit e17a443

Browse files
Revert "feat(deployment): use sync-waves for triggering ingest cronjobs" (#6572)
Reverts #6375 https://loculus.slack.com/archives/C05G172HL6L/p1780303552350439 This causes various issues: silo takes too long to start on PPX so the sync constantly fails with ttl the ingest cronjobs die after 10min (if sync completes and triggers their creation) and are constantly recreated in a loop 🚀 Preview: Add `preview` label to enable Co-authored-by: Theo Sanderson <theo@sndrsn.co.uk>
1 parent 4ffb7ff commit e17a443

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

ingest/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ Indirect requirements:
9898

9999
The pipeline runs in different kubernetes resources:
100100

101-
- An "approve" deployment (uses the `autoapprove.py` script) that continuously polls the Loculus backend for sequences in status `WAITING_FOR_APPROVAL` and approves them. This has one replica with kubernetes resource type apps/v1/Deployment.
102-
- An "ingest" cronjob batch/v1/CronJob that runs the ingest pipeline regularly. Cronjobs are scheduled to start ingest for a different organism every 30min to reduce load. To improve development experience ArgoCD spawns ingest pods using sync waves (10th wave).
101+
- An "approve" deployment (uses the `autoapprove.py` script) that continuously polls the Loculus backend for sequences in status `WAITING_FOR_APPROVAL` and approves them, one replica with kubernetes resource type apps/v1/Deployment.
102+
- An "ingest" cronjob batch/v1/CronJob that runs the ingest pipeline regularly. Cronjobs are scheduled to start ingest for a different organism every 30min to reduce load. To improve development experience ArgoCD spawns ingest pods using a PostSync-hook trigger (this waits for all other pods to be healthy after an ArgoCD sync - reducing ingest failures due to the backend being unreachable)
103103

104104
In production the ingest pipeline runs in a docker container that takes a config file as input.
105105

kubernetes/loculus/templates/ingest.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,22 @@ spec:
115115
"args" (list "snakemake" "results/submitted" "results/revised" "--all-temp")
116116
) | nindent 8 }}
117117
{{/*
118-
sync-wave: 10 for the trigger Job, so it runs at the end of an argocd sync.
118+
PostSync-hook trigger: kicks off a one-off ingest Job from the CronJob's
119+
template after argocd reports the sync as healthy. PostSync waits for
120+
all resources (e.g. backend, ena-submission) to be Healthy before firing,
121+
so the spawned ingest pod doesn't start hammering services that aren't
122+
ready yet. The trigger itself exits in seconds; the spawned ingest Job
123+
runs untracked by argocd. Concurrency with a scheduled CronJob run is
124+
handled by the shared lock init container in the spawned pod.
119125
*/}}
120126
---
121127
apiVersion: batch/v1
122128
kind: Job
123129
metadata:
124130
name: loculus-ingest-trigger-{{ $key }}
125131
annotations:
126-
argocd.argoproj.io/sync-wave: "10"
132+
argocd.argoproj.io/hook: PostSync
133+
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation,HookSucceeded
127134
spec:
128135
activeDeadlineSeconds: 120
129136
backoffLimit: 0

0 commit comments

Comments
 (0)