Skip to main content

Update agent script logic

The agent container runs a script with the following flow:
1

Honor dashboard on/off toggle / pin / approvals

2

Read current image_tag from ConfigMap dag-release

3

List available tags from the Hilt release ECR + release channel

4

Filter tags by UPDATE_POLICY (or converge to a pin)

5

No eligible update?

Exit 0 (nothing to do). Optional workload drift reconcile only.
6

Line change (new MAJOR.MINOR)?

Yes → pull dag-delivery-bundle:<NEW_TAG> (infra + schema snapshot), reconcile infra/migrations when enabled (approval-gated). Held approvals skip the image roll. Patches (same line) skip this step — images only.
7

Verify the candidate tag exists in ALL 6 repositories

Ensures Hilt published a complete release, not a partial push.
8

Mirror images

9

Update ECS task definitions

10

Force ECS redeployments

11

Restart EKS deployments

12

Wait for stability

13

Health check

14

Update ConfigMap with the new tag

15

Send webhook notification

POST $WEBHOOK_URL with JSON payload:
16

On failure after mirroring

  • Send failure webhook.
  • Do not update the ConfigMap (next run will retry).
  • Exit 1 (CronJob records failure in Kubernetes events).

Rollback

If an update causes issues, operators can manually revert:
Do not roll the detection deployments back with kubectl rollout undo.From the release that introduces the detection scale-out, dag-classification runs with its state volume mounted read-only and its per-host state kept in Kafka. An image-tag rollback alone leaves the older image unable to write that volume: it stays up, warns every 300 s, and cold-starts from whatever the volume held at seed time on its next restart.Roll those back the way they were rolled forward — re-apply the previous release’s Terraform, which restores both the image and the volume and environment it expects:
dag-calibration runs the same image and exchanges calibration records with dag-classification, so it moves with it — never roll one without the other. Deployments with no state volume (enrichment-app, the dashboard services) can still be reverted with the tag patch above.
The auto-update agent will not re-apply the problematic tag on the next run because it only moves forward. If the operator sets the ConfigMap tag back, the agent will see the “new” tag again and attempt the update. To prevent this, set auto_update_enabled = false or auto_update_dry_run = true in terraform.tfvars and re-apply.
Last modified on October 8, 2026