CourseAI Engineering: The Complete Course · Module 13: Deployment and Operations · part 99 of 105
Part 99 · Module 13: Deployment and Operations

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

BRIGHTCART RELEASE KIT, LEFT TO RIGHT code api + secret ci.py 3 gates image Dockerfile workflow no traffic current smoke test smoke fails: pointer goes back to the last good release
The finished kit: each change passes ci.py (green), becomes one image and a no-traffic deploy (blue), and a failed smoke test sends the pointer back (red).

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.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.