CourseAI / ML Engineer: The Complete Course · Module 10: MLOps · part 64 of 93
Part 64 · Module 10: MLOps

Lab: Continuous training, gated and replayed

155 min read·
Module 10 · Lab · About 60 minutes · Needs: lessons 1 to 3 of this module, and the Module 9 lab (or nothing: Step 1 rebuilds Modules 1 to 9)

What you are building

Continuous training, gated A pipeline proposes, the gates decide Active flow Background or async 1 Processing step number Optional or fallback Each morning triggers schedule, drift snapshot labels in guarded_retrain Prefect budget 4 a month contract grams fixed fit_v2 newest week calibrates five gates against champion Registry MLflow new version tags: commit, md5 champion alias moves Customers shadow, canary, rollback 1 2 3 4
Each morning the triggers and a snapshot (gold) feed Lesson 3's guarded retrain (teal), every result is registered with its commit and data (blue), the champion alias moves only when all five gates pass, and Lesson 2's shadow, canary and rollback stand between it and customers (dashed); circles give the order.

Until now a person decided when Kestrel trained and which model served. This lab hands the routine part to a pipeline and keeps the judgement with people: pipelines/continuous_training.py takes a raw snapshot of labelled parcels, checks it against the data contract, retrains model v2's recipe within Adaeze's budget, registers the result, and moves the champion alias only if all five promotion gates pass. Shadow, canary and rollback stay as Lesson 2 wrote them; ADR-007 records the policy.

The lessons registered stand-ins; the lab puts the real models in the registry: model v1 (Module 3 lab) as version 1 and model v2 (Module 6 lab) as version 2, judged on the gate weeks, 7 to 20 September. Then it replays the mornings of 15 to 27 September to show which trigger fires when, rebuilds v2 from its record, and adds a corrected test workflow for GitHub. No cell calls a hosted model.

Open a new Colab notebook, call it module-10-lab.ipynb, and run each cell in order.

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.

Or open everything with a plan