Skip to content

The platform for continuously improving AI agents.

Roll every service together after the migration (#234)

Pritam Soni3b532f6344b8
diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml
index ecce2737..6c6064f0 100644
--- a/.github/workflows/deploy-api.yml
+++ b/.github/workflows/deploy-api.yml
@@ -125,6 +125,7 @@ jobs:
IMAGE_URI: ${{ needs.build-and-push.outputs.image_uri }}
run: python scripts/deploy_ecs.py migrate
+ # A failed migration blocks every service. The services then roll together.
deploy-sandbox:
runs-on: ubuntu-latest
needs: [build-and-push, migrate]
@@ -144,7 +145,7 @@ jobs:
deploy-landing:
runs-on: ubuntu-latest
- needs: [build-and-push, migrate, deploy-sandbox]
+ needs: [build-and-push, migrate]
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
@@ -163,7 +164,7 @@ jobs:
deploy-control:
runs-on: ubuntu-latest
- needs: [build-and-push, deploy-landing]
+ needs: [build-and-push, migrate]
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
@@ -171,7 +172,7 @@ jobs:
with:
role-to-assume: ${{ env.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- - name: Register fair dispatch before new trace consumers
+ - name: Deploy the control worker
env:
IMAGE_URI: ${{ needs.build-and-push.outputs.image_uri }}
SERVICE: celery-control-worker
@@ -179,7 +180,7 @@ jobs:
deploy-traces:
runs-on: ubuntu-latest
- needs: [build-and-push, deploy-control]
+ needs: [build-and-push, migrate]
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
@@ -187,7 +188,7 @@ jobs:
with:
role-to-assume: ${{ env.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- - name: Verify dedicated trace capacity before isolating IO
+ - name: Deploy the traces worker
env:
IMAGE_URI: ${{ needs.build-and-push.outputs.image_uri }}
SERVICE: celery-traces-worker
@@ -195,7 +196,7 @@ jobs:
deploy-workers:
runs-on: ubuntu-latest
- needs: [build-and-push, deploy-traces]
+ needs: [build-and-push, migrate]
timeout-minutes: 80
strategy:
fail-fast: false
@@ -216,7 +217,7 @@ jobs:
deploy-beat:
runs-on: ubuntu-latest
- needs: [build-and-push, deploy-workers]
+ needs: [build-and-push, migrate]
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
@@ -225,9 +226,7 @@ jobs:
role-to-assume: ${{ env.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
role-session-name: github-${{ github.run_id }}-beat
- # Beat must not send newly introduced tasks to old workers that cannot
- # register them. Old beat can keep serving existing schedules during rollout.
- - name: Deploy scheduler after workers
+ - name: Deploy the scheduler
env:
IMAGE_URI: ${{ needs.build-and-push.outputs.image_uri }}
SERVICE: celery-beat
@@ -235,7 +234,7 @@ jobs:
deploy-api:
runs-on: ubuntu-latest
- needs: [build-and-push, deploy-beat]
+ needs: [build-and-push, migrate]
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
@@ -244,7 +243,7 @@ jobs:
role-to-assume: ${{ env.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
role-session-name: github-${{ github.run_id }}-api
- - name: Deploy API after consumers and scheduler
+ - name: Deploy the API
env:
IMAGE_URI: ${{ needs.build-and-push.outputs.image_uri }}
SERVICE: api
diff --git a/scripts/workshop-rollout.md b/scripts/workshop-rollout.md
index e090da30..88082366 100644
--- a/scripts/workshop-rollout.md
+++ b/scripts/workshop-rollout.md
@@ -51,7 +51,7 @@ not rewrite old manifests. Current recipes do not install dependencies at runtim
and finally API. Restore recorded capacity explicitly; the script refuses to
guess counts for stopped services. Each deployment waits for readiness before
continuing. Keep maintenance mode until the checks below pass. Later automated
- releases preserve desired counts and follow the same consumer-first ordering.
+ releases preserve desired counts and roll every service together after migrate.
1. Verify source upload/export, OCR, pipeline preview/publication/cancellation,
preparation, bounded training, held-out evaluation and inference through the
intended project-scoped MCP endpoint. Check sandbox runtime identity and interactive consumer health,
diff --git a/tests/test_celery_topology.py b/tests/test_celery_topology.py
index 9a3566ee..ddb68a6a 100644
--- a/tests/test_celery_topology.py
+++ b/tests/test_celery_topology.py
@@ -214,21 +214,28 @@ def test_overwatch_slack_is_not_a_product_worker():
)
-def test_new_producers_wait_for_healthy_landing_capacity():
+def test_services_roll_together_after_migrate():
workflow = yaml.safe_load((REPO_ROOT / ".github/workflows/deploy-api.yml").read_text())
jobs = workflow["jobs"]
- def prerequisites(name):
- needs = jobs[name].get("needs", [])
- needs = [needs] if isinstance(needs, str) else needs
- return set(needs).union(*(prerequisites(n) for n in needs))
-
- assert "deploy-landing" in jobs, "Provisioned landing consumers need a deployment gate"
- assert "migrate" in prerequisites("deploy-landing"), "New workers require the migrated schema"
- assert "deploy-landing" in prerequisites("deploy-api"), "Publishers must follow ready consumers"
- assert "deploy-landing" in prerequisites("deploy-workers")
+ def needs(name):
+ value = jobs[name].get("needs", [])
+ return [value] if isinstance(value, str) else list(value)
+
+ assert needs("migrate") == ["build-and-push", "preflight"]
+ deploy_jobs = [
+ "deploy-sandbox",
+ "deploy-landing",
+ "deploy-control",
+ "deploy-traces",
+ "deploy-workers",
+ "deploy-beat",
+ "deploy-api",
+ ]
+ for name in deploy_jobs:
+ assert needs(name) == ["build-and-push", "migrate"]
+ assert any("deploy_ecs.py" in step.get("run", "") for step in jobs[name]["steps"])
landing_steps = jobs["deploy-landing"]["steps"]
- assert any("deploy_ecs.py" in step.get("run", "") for step in landing_steps)
assert any(
step.get("env", {}).get("SERVICE") == "celery-landing-worker" for step in landing_steps
)