Deployment Ordering

Cross-Stack Deployment Ordering

Stacks must be deployed in dependency order. Deploying out of order causes service discovery failures and missing prerequisites.

Dependency Graph

attic (storage + cache platform)
  └── gitlab-runners (needs cache URLs)
  └── arc-runners (needs cache URLs)
       └── runner-dashboard (needs runner APIs)

Deploy Order

1. Attic Stack (Storage Layer)

just tofu-deploy attic

Provides: PostgreSQL, MinIO, Attic API, Bazel cache, GC worker. Other stacks depend on: ATTIC_SERVER, BAZEL_REMOTE_CACHE endpoints.

Verify before proceeding:

just cache-health

2. Runner Stacks (Compute Layer)

Deploy in any order (independent of each other):

just tofu-deploy gitlab-runners
just tofu-deploy arc-runners  # via GH Actions workflow

Provides: CI/CD runner pods registered with GitLab and GitHub. Dashboard depends on: runner pods being queryable via K8s API.

Verify before proceeding:

just runners-status

3. Runner Dashboard (Monitoring Layer)

just tofu-deploy runner-dashboard

Provides: Web UI for runner fleet monitoring.

Rollback Order

Reverse the deploy order:

  1. just tofu-destroy runner-dashboard
  2. just tofu-destroy gitlab-runners / destroy ARC via GH Actions
  3. just tofu-destroy attic

CI/CD Enforcement

GitLab CI enforces ordering via pipeline stages:

  • deploy:attic runs in deploy stage
  • deploy:runners runs in deploy stage with needs: [deploy:attic]
  • deploy:dashboard runs in deploy stage with needs: [deploy:runners]

GloriousFlywheel