ML Pipelines, Orchestration and CI/CD

Automate data ingestion, training, evaluation and deployment as scheduled, tested workflows instead of manual steps.

Advanced · about 8 hours · difficulty 3/5

Learn first: Data and Model Versioning with DVC, Serving Models with FastAPI and BentoML

Models go stale as data changes, so retraining must be routine, not heroic. An ML pipeline chains the steps (ingest, validate, featurize, train, evaluate, register, deploy) into one automated, observable workflow.

Orchestrators

  • Airflow: the veteran scheduler for data workflows, defined as Python DAGs.
  • Prefect and Dagster: modern Python-first orchestration with good local development.
  • Kubeflow Pipelines, Metaflow and ZenML: ML-focused, often on Kubernetes.
  • Cloud-native options: SageMaker Pipelines, Vertex AI Pipelines, Azure ML.

Pick one and learn its ideas: tasks, dependencies, retries, caching, parameters, schedules and backfills.

CI/CD for ML

  • CI runs on every pull request: linting, unit tests, data validation, and a quick training run on a sample to catch breakage.
  • Continuous training retrains on a schedule or when monitoring detects drift.
  • Evaluation gates: a candidate is promoted only if it beats the current model on a fixed test set and passes fairness and latency checks.
  • CD deploys the promoted model through staging to production, with automatic rollback.

Maturity levels

Level 0 is manual notebooks. Level 1 automates the training pipeline. Level 2 automates building, testing and deploying the pipeline itself. Most teams should aim for level 1 first.

Good enough to move on when a schedule or a code change can trigger training, evaluation and a gated model promotion without anyone running cells by hand.

Key concepts

  • Pipeline stages and DAGs
  • Airflow, Prefect or Dagster
  • Kubeflow and Metaflow
  • CI with GitHub Actions
  • Continuous training triggers
  • Evaluation and promotion gates
  • MLOps maturity levels

Mini project

Build a Prefect or Airflow flow that pulls fresh data, validates it, retrains, compares against the registered champion, and promotes the new model only if it wins, plus a GitHub Actions workflow that runs tests and a smoke training run on every PR.

Check yourself

What checks would you put in an evaluation gate before automatically promoting a retrained model to production?

Free resources