Library

Volume 2 · MLOps & AgentOps

Notebook
Sign in

Section 64

MLOps Pipeline (Experiment Tracking to Production, Full Lifecycle Diagram)

966 words · about 4 min

64.1 MLOps Maturity Levels

Level 0: Manual           → Data scientist trains locally, hands off a model file
Level 1: ML Pipeline      → Automated training pipeline, manual deployment
Level 2: CI/CD for ML     → Automated training + testing + deployment
Level 3: Full MLOps       → Continuous training, monitoring, auto-retraining
Level 4: AgentOps         → Extends MLOps to agentic AI systems (Section 65)

Most enterprises sit somewhere between Level 1 and Level 2 for classical ML, and are only beginning to define Level 3-4 practices for LLM/agent systems — this maturity gap is itself a common architect-level discussion point in interviews.

64.2 Full MLOps Lifecycle Architecture

┌─────────────────────────────────────────────────────────────┐
│                        MLOps Pipeline                        │
│                                                                │
│  ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐ │
│  │ Data      │──▶│ Training │──▶│ Evaluation│──▶│ Registry │ │
│  │ Pipeline  │   │ Pipeline │   │ Pipeline  │   │ (MLflow/ │ │
│  │ (Feature  │   │ (Training│   │ (Golden   │   │ Model    │ │
│  │  Store)   │   │  Jobs)   │   │  Dataset) │   │ Registry)│ │
│  └──────────┘   └──────────┘   └──────────┘   └────┬─────┘ │
│                                                       │       │
│  ┌──────────┐   ┌──────────┐   ┌──────────┐         │       │
│  │ Monitor  │◀──│Production│◀──│ Deployment│◀────────┘       │
│  │ (Drift,  │   │ Serving  │   │ (Canary,  │                 │
│  │  Quality,│   │ (Endpoint│   │  Blue/    │                 │
│  │  Cost)   │   │  or API) │   │  Green)   │                 │
│  └──────────┘   └──────────┘   └──────────┘                 │
└─────────────────────────────────────────────────────────────┘

64.3 Stage-by-Stage Breakdown

  1. Data pipeline: Automated, scheduled ingestion from source systems; feature engineering computed consistently for both training and serving (via a feature store, to avoid training/serving skew); data quality validation gates before features flow downstream.
  2. Training pipeline: Managed training jobs with hyperparameter tuning; every run tracked in an experiment tracker (params, metrics, artifacts, lineage back to the exact data snapshot used).
  3. Evaluation pipeline: New candidate model scored against a held-out test set and a golden/curated evaluation set; must clear both an absolute quality bar and a comparison against the current production model (no silent regressions).
  4. Registry: Approved models promoted to a model registry with versioning, approval workflow, and full lineage (data version + code version + hyperparameters that produced this exact artifact).
  5. Deployment: Canary or blue/green rollout (Sections 66/68) rather than a hard cutover.
  6. Monitoring: Continuous tracking of drift, quality, cost, and latency in production (Section 67), feeding back into retraining triggers.

64.4 Key MLOps Tooling Categories

Category Representative Tools Purpose
Experiment Tracking MLflow, Weights & Biases, managed cloud experiment trackers Track runs, params, metrics, artifacts for reproducibility
Model Registry MLflow Model Registry, cloud-native model registries Version control and approval workflow for models
Feature Store Feast, cloud-native feature stores Consistent features between training and serving
Pipeline Orchestration Airflow, cloud-native ML pipelines, Kubeflow Orchestrate multi-step training/eval/deploy workflows
Model Serving Cloud-managed endpoints, Seldon, KServe, BentoML Serve models with autoscaling, canary support
Monitoring Cloud-native model monitors, Evidently, WhyLabs Drift detection, data quality, performance tracking

64.5 Example: End-to-End Pipeline for a Tabular Prediction Model

# Simplified pipeline orchestration pseudocode
from mlops_pipeline import Pipeline, Step

pipeline = Pipeline("risk-prediction-pipeline")

pipeline.add_step(Step(
    name="feature_engineering",
    job="feature_computation_job",
    output="feature_store://risk_features_v4"
))

pipeline.add_step(Step(
    name="train",
    job="xgboost_training_job",
    inputs=["feature_store://risk_features_v4"],
    hyperparameter_tuning="bayesian",
    tracked_in="experiment_tracker"
))

pipeline.add_step(Step(
    name="evaluate",
    job="evaluation_job",
    compares_against="production_model_current",
    gate={"min_auc_improvement": 0.005, "no_subgroup_regression": True}
))

pipeline.add_step(Step(
    name="register",
    job="model_registry_promote",
    requires_approval=True
))

pipeline.add_step(Step(
    name="deploy",
    job="canary_deploy",
    canary_traffic_pct=5,
    canary_duration_hours=24
))

Interview Q&A — Section 64

Q1: Walk through the full MLOps lifecycle for a predictive model in a regulated enterprise environment, end to end. A: Data collection is automated and scheduled (e.g., a weekly job pulling from the system of record), computing features through a feature store so training and serving use identical feature logic and avoid training/serving skew. Training runs as a managed job with hyperparameter tuning, every run tracked in an experiment tracker with full lineage to the exact data snapshot and code version used. The candidate model is evaluated against both a held-out test set and a curated golden dataset, gated to require it beat the current production model on the primary metric with no regression on any critical subgroup — not just an aggregate improvement. Approved models are promoted through a model registry with an explicit approval workflow (human sign-off for regulated domains), then deployed via canary (small traffic percentage, monitored for a defined window) before full rollout. Post-deployment, drift and performance monitoring runs continuously, with defined retraining triggers (performance degradation, detected drift, or a scheduled cadence) that route back into the same pipeline.

Q2: What’s the difference between MLOps maturity Level 1 and Level 3, and how would you move a team from one to the other? A: Level 1 means there’s an automated training pipeline, but deployment is still a manual, ad hoc step — someone decides when and how to push a new model live, with no systematic gating. Level 3 means the entire loop is closed: training, evaluation gating, deployment, and monitoring are automated end to end, with monitoring signals (drift, degradation) automatically triggering retraining rather than requiring someone to notice a problem first. Moving a team from Level 1 to Level 3 is primarily an investment in the evaluation and monitoring layers, which are usually the ones missing — teams tend to build training automation first because it’s the most visible pain point, then under-invest in the automated gating and monitoring that actually makes continuous deployment safe. I’d prioritize: build the golden/held-out evaluation gate first (prevents bad models reaching production), then automated drift/performance monitoring (Section 67), then finally wire monitoring alerts to automated retraining triggers once the team trusts the gate enough to let it run with less manual oversight.