Skip to content

Commit 4c722c1

Browse files
authored
feat(deployment): use sync-waves for triggering ingest cronjobs (#6375)
issue described in https://loculus.slack.com/archives/C05G172HL6L/p1778229491333099 PostSync was getting previews stuck inn sync status for multiple minutes and leading to issues removing previews, switching to sync with a later syncWave partially solves this (sync is still waiting for hooks and taking slightly longer than before) but does not lead to too many errors in ingest and can be deleted immedietly. 🚀 Preview: Add `preview` label to enable
1 parent 7f98b9c commit 4c722c1

2 files changed

Lines changed: 4 additions & 11 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, 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)
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).
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: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,15 @@ spec:
115115
"args" (list "snakemake" "results/submitted" "results/revised" "--all-temp")
116116
) | nindent 8 }}
117117
{{/*
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.
118+
sync-wave: 10 for the trigger Job, so it runs at the end of an argocd sync.
125119
*/}}
126120
---
127121
apiVersion: batch/v1
128122
kind: Job
129123
metadata:
130124
name: loculus-ingest-trigger-{{ $key }}
131125
annotations:
132-
argocd.argoproj.io/hook: PostSync
133-
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation,HookSucceeded
126+
argocd.argoproj.io/sync-wave: "10"
134127
spec:
135128
activeDeadlineSeconds: 120
136129
backoffLimit: 0

0 commit comments

Comments
 (0)