Skip to content

Add TEST environment and complete the promotion chain#247

Merged
arielr-lt merged 1 commit into
mainfrom
feat/test-env
May 19, 2026
Merged

Add TEST environment and complete the promotion chain#247
arielr-lt merged 1 commit into
mainfrom
feat/test-env

Conversation

@arielr-lt

Copy link
Copy Markdown
Collaborator

Summary

Brings the pipeline to the full DEV → TEST → SANDBOX → PRODUCTION model from the xTRA Design Document. Each tier is isolated; TEST is now the build target, and SANDBOX and PROD receive promoted images via crane copy.

Infrastructure

  • infra/terraform/envs/test/ (new): VPC 10.42.0.0/16, EKS ctdl-xtra-test, RDS db.t4g.small Single-AZ, EFS, 1× t3.medium system + 1× t3.medium app, ECR repos ctdl-xtra-test/{api,worker,base}
  • infra/terraform/envs/sandbox/: drops the base ECR (builds happen in test now). 2 resources destroyed (repo + lifecycle policy). No impact on running sandbox pods — the images they're running embed the base layers.
  • github-ci-oidc/: adds TestReadWrite policy for ctdl-xtra-test/*, tightens SandboxPromote (formerly SandboxReadWrite) since sandbox is promote-only now, adds the ctdl-xtra-test cluster to eks:DescribeCluster

Manifests

  • k8s-manifests/test/: clone of sandbox set, host xtra-test.credentialengineregistry.org, IRSA + secret keys retargeted

CI/CD

  • release.yml — pushes to ctdl-xtra-test/{api,worker} (was sandbox)
  • deploy-test.yml (new) — triggered by workflow_run on Release success; auto-deploys the just-built image to ctdl-xtra-test. This is the "automatic when possible" deployment the design doc specifies for TEST.
  • promote-sandbox.yml — now crane copys test → sandbox before deploying
  • promote-production.yml — unchanged (still crane-copies sandbox → prod)
  • build-base.yml — pushes to ctdl-xtra-test/base
  • Dockerfile + worker.DockerfileFROM ctdl-xtra-test/base:latest

Docs

INFRASTRUCTURE-SUMMARY.md and CI-CD.md updated for the 3-env model.

Apply plan (post-merge)

  1. terraform apply github-ci-oidc/ (0 add + 2 changed)
  2. terraform apply envs/test/ (79 adds, ~15 min)
  3. terraform apply envs/sandbox/ (0 add + 2 destroy: drops the unused base repo)
  4. Trigger Build Base Image to populate ctdl-xtra-test/base:latest
  5. Run k8s-manifests/test/addons/install-foundation.sh
  6. Trigger Release → pushes images to test ECR → Deploy to TEST auto-fires → app reachable at xtra-test.credentialengineregistry.org
  7. Add Route53 CNAME xtra-test.* → new ALB
  8. Smoke test

Production untouched. Sandbox keeps running its current images (the next promote-sandbox will pull from test).

Test plan

  • terraform fmt && terraform validate clean for all three stacks
  • terraform plan clean: test 79 add, sandbox 2 destroy, oidc 2 change
  • After apply: end-to-end deploy via workflows succeeds
  • App reachable at https://xtra-test.credentialengineregistry.org
  • Promote test → sandbox works
  • Promote sandbox → prod still works (no source URI changed for that step)

Brings the pipeline to the full DEV → TEST → SANDBOX → PRODUCTION model.
Each tier gets its own isolated stack. TEST is the new build target;
SANDBOX and PRODUCTION receive promoted images via crane copy.

Infrastructure:
- envs/test: clone of sandbox at VPC 10.42.0.0/16, EKS ctdl-xtra-test,
  RDS db.t4g.small Single-AZ, EFS, t3.medium 1× app + 1× system nodes,
  3 ECR repos ctdl-xtra-test/{api,worker,base}
- envs/sandbox: base ECR removed (builds no longer happen here); only
  api+worker remain. Drops 2 resources (ECR repo + lifecycle policy)
- github-ci-oidc: TestReadWrite policy added (push to ctdl-xtra-test/*),
  SandboxPromote tightened (no longer write-from-source), ctdl-xtra-test
  cluster added to eks:DescribeCluster

Manifests:
- k8s-manifests/test: clone of sandbox with env labels, IRSA, image refs,
  hostname (xtra-test.credentialengineregistry.org), secret keys

CI/CD:
- release.yml pushes to ctdl-xtra-test/{api,worker}
- deploy-test.yml (new): workflow_run on Release success auto-deploys
  to ctdl-xtra-test — the "automatic when possible" tier per design doc
- promote-sandbox.yml now crane-copies test→sandbox before deploying
- promote-production.yml unchanged (still crane-copies sandbox→prod)
- build-base.yml pushes to ctdl-xtra-test/base
- Dockerfile + worker.Dockerfile FROM ctdl-xtra-test/base:latest

Docs (INFRASTRUCTURE-SUMMARY, CI-CD) updated for 3-env model.
@arielr-lt arielr-lt merged commit eb84352 into main May 19, 2026
0 of 3 checks passed
@arielr-lt arielr-lt deleted the feat/test-env branch May 19, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant