Skip to content

AWS ECS Bootstrap Plan and Todo

Purpose

This note captures the current end-of-day state for the ECS migration work and the next steps needed to finish the bootstrap path.

The immediate goal is to get the staging Terraform stack, bootstrap images, and ECS services aligned so the first deployment can run without manual intervention.

Current State

  • The API, frontend, and admin images now build successfully.
  • The build helper can login to ECR with glimpse-staging, tag images, and push them.
  • The shared tracker-services worker image is now part of the same build flow.
  • The staging Terraform stack now has worker service definitions scaffolded behind enable_workers.
  • Staging Terraform already expects image_tags values for ECS task definitions.
  • Prod anisette is confirmed to use EFS and Cloud Map service discovery.
  • tracker-fetcher-2 is the only worker that needs the shared /data EFS mount and anisette access.

What We Know From Prod Anisette

  • ECS service: anisette-v3
  • ECS cluster: anisette-v3-cluster
  • Image: anisette-v3:latest
  • Container port: 6969
  • Mount path: /home/Alcoholic/.config/anisette-v3
  • EFS file system: fs-0090bbc5746f3b09d
  • EFS root directory: /anisette-v3
  • Cloud Map namespace: anisette-v3.local

This is useful because it shows anisette should stay separate from the worker file layout.

Working Plan

Phase 1: Finish the Bootstrap Stack

  1. Keep infra/envs/staging/terraform.tfvars on sha-bootstrap for the first pass.
  2. Ensure Terraform creates the ECR repositories and ECS scaffolding.
  3. Push the bootstrap images to ECR using the staging profile.
  4. Apply the ECS service layer after the images exist.

Phase 2: Add the Worker Runtime

  1. Add a shared worker image for the TaskiQ services.
  2. Keep tracker-fetcher-2 on the shared /data EFS mount for ACCOUNT_STORE_PATH=/data/account.json.
  3. Keep unified-geofence, notification-service, and materialized-view-service stateless on the same shared image with separate ECS services.
  4. Mirror the prod anisette storage pattern separately rather than reusing the worker mount.

Phase 3: Move Toward CI

  1. Switch from sha-bootstrap to immutable sha-<gitsha> tags.
  2. Let CI build and push images directly.
  3. Update ECS task definitions or service revisions from the CI output, not by rebuilding infra.

Todo

  • Apply staging Terraform for the foundation resources.
  • Confirm the ECR repositories exist in the staging account.
  • Push api, frontend, and admin bootstrap images to ECR.
  • Push the shared tracker-services bootstrap image to ECR.
  • Verify the staging ECS services can pull the bootstrap images.
  • Enable the worker services in staging once the shared EFS mount is ready.
  • Mirror the anisette EFS and Cloud Map pattern in staging.
  • Replace sha-bootstrap with commit SHA tags in the deployment flow.

Suggested Next Working Session

Start with the staging Terraform apply order, then verify the bootstrap image push, then wire in the worker storage model.

That sequence keeps the build, deploy, and storage decisions aligned instead of solving them independently.