Lab: Ship BrightCart's API with a rollback
20 min read·13 Oct 2026
Module 13 · Lab · About 75 minutes · Needs: lessons 1 to 4 of this module (containers, CI/CD, cloud, operations)
What you are building
This lab assembles Module 13's piece of BrightCart in the brightcart/ project: a deployed service with a way to roll back. The API, in brightcart/api/, reads its settings from the environment and its key from a mounted file. A multi-stage Dockerfile, a compose file and a workflow package and ship it; ci.py runs lint, tests and Module 12's eval gate for real, on saved results. You then run it under uvicorn, stop it with SIGTERM mid-reply, and roll back a release that fails its smoke test. Cloud Run commands and a checked runbook close the kit. A fake model answers from the shared policies, so no setup cell or key is needed.