MasterFabric Logo
v1.7
AI-Portfolio

MasterFabric · Airflow MLOps

Replays a year of telco churn modeling on Airflow, MLflow, Evidently and Feast with measured retraining results.

sha 3546e6f·snapshot 2026-11-23·View on GitHub →
MasterFabric Airflow MLOps: Airflow, MLflow, drift monitoring and champion/challenger retraining, with measured results

Overview

MasterFabric Airflow MLOps replays a full year of a simulated telco churn pipeline on a single laptop, using Airflow to land monthly subscriber snapshots, gate them on data quality, measure realised performance once labels arrive, check feature drift, and decide whether to retrain. Promotion is implemented as an MLflow registry alias that a FastAPI service follows without a restart, so champion and challenger models can be swapped live. Evidently supplies a second opinion on drift and realised quality each month, Feast serves the same features to training and to the online API, and a new champion is rolled out through a sticky canary with pre-declared guardrails. The project checks its own claims against two references, a model that is never retrained and the data generator's own true churn probabilities, with every number measured on runs on an Apple M4 Pro with Docker through Colima.

Key measured results

  • 01Backfill: 12 monthly runs (2025-12 to 2026-11), all successful, 60,000 to 66,274 subscribers, 1.2-8.4 s of task time per month
  • 02Realised AUC, 2026-10: auto policy (v4) 0.830 vs never retrained (v1) 0.789, oracle upper bound 0.841
  • 03Top-decile lift, 2026-10: auto 4.98 vs never retrained 4.63
  • 04Drift signal: PSI of plan 0.3151 vs v1's data when postpaid_5g appeared, against a trigger of 0.25
  • 05Online API: p50 2.67 ms, p95 2.93 ms per subscriber; 1,000 rows scored in 11.4 ms; max difference to batch scores 5.0e-6
  • 06Rollback: @champion moved from v4 to v3 served after 3.41 s, and back to v4 after 15.27 s (15 s poll), with no restart
  • 07Evidently vs in-house PSI: default detector flags 3-7 of 16 columns in all 6 monitored months; the PSI > 0.25 trigger agrees in 5 of 6 months; realised AUC identical (delta 0.0)
  • 08Feast point-in-time: 0 of 194,913 training rows differ from the hand-written join, while a naive latest-snapshot join leaves all 11,179 churners without features
  • 09Canary rollout: shuffled-label v6 rolled back at 5% (Spearman -0.088); v5 passed 5/25/50% stages, paired delta AUC -0.0007 [-0.0031, +0.0016], and was promoted
  • 10Root-cause report: v6 re-rolled against champion v5 was rolled back again at 5% (Spearman -0.073), and the report took 2.1 s; of six hypotheses only model signal (holdout AUC 0.4414) and training labels were supported, with the verdict label corruption in the training job
  • 11Root-cause control: retrained from v6's own lineage tags the recipe scores 0.8297 while the registered artefact scores 0.4414 (0.4484 on its own training labels); for v5 all hypotheses were ruled out
  • 12Drift watcher replay over 40,000 served subscribers: a sustained plan breach (PSI 0.266 at 20,000, sustained at 22,500) retrained v10, which was rejected (0.7816 vs v1 0.7819); with 2026-08 traffic and labels up to 2026-07, v11 was promoted (0.819 vs 0.7796) and served 4.1 s later
  • 13Drift watcher reached exactly the models the monthly DAG built (v10 = v2, v11 = v3); a retrain plus registration took 3.5 to 3.7 s and a run without retraining 2.5 s

Honest limitations

  • The subscriber base, drift and broken feed are all generated synthetically, so the generator sets the ceiling for how much retraining can help; the mechanics (gate, triggers, promotion, serving) are what transfer, not the exact AUC numbers
  • Results come from a single deterministic run (seed 42); thresholds like PSI 0.25, decay 0.03 and gain 0.002 were set from domain defaults rather than tuned on this run
  • The final 2026-11 month was triggered by hand rather than waiting for the real monthly schedule
  • Training runs inside the Airflow worker itself, which is fine at this data scale but would need to move to a separate job at operator scale
  • The lake uses pandas and parquet rather than Spark and Iceberg, keeping the repo small and readable by design
  • The serving API relies on polling (checks aliases every 15 s) rather than events, since open-source MLflow 2.22 has no registry webhooks
  • Lab-grade security: services bind to localhost only, credentials are lab placeholders, MLflow and the API have no authentication, and the S3 store is single-node
  • The canary rollout replays a single past month's traffic in minutes rather than real traffic arriving over weeks with labels a month later
  • Only one rollout was exercised, with one obviously broken candidate and one normal one; a subtler failure such as a single shifted feature was not tested
  • No business metric is computed; AUC and top-decile lift stand in for retention value rather than a priced uplift evaluation
  • The rollout moved @champion outside the DAG: v5 was promoted by scripts/rollout.py, so the decisions table still ends at v4 and the promotion is recorded in registry tags and docs/results/rollout.json
  • The evidently_report and publish_features tasks were run for the 12 existing months with airflow tasks test after the backfill, which records no task state
  • Evidently's numeric PSI is not the DAG's PSI: it uses equal-width bins while the in-house PSI uses reference deciles, so they agree on categorical columns and on the trigger in 5 of 6 months, not on every numeric value
  • Feast runs on files: the offline store is one parquet file rewritten each month and the registry is a local file, and training still uses the hand-written join that Feast was shown to match
  • The root-cause report covers six hypotheses and was tested on one injected incident (shuffled labels) and one healthy control; a segment-only failure or an online/offline feature mismatch is not among its checks, and its deciding check retrains, which is seconds here and can be hours at scale
  • The drift watcher was exercised by replay with airflow dags test after every 2,500 subscribers, not by the scheduler, so every 10 minutes was not measured in wall time; it added model versions 7 to 11 to the registry

Screenshots & diagrams

Architecture: monthly feeds into Airflow; Airflow logs and registers to MLflow; MLflow backed by PostgreSQL and S3; FastAPI follows the champion alias
Architecture: monthly feeds into Airflow; Airflow logs and registers to MLflow; MLflow backed by PostgreSQL and S3; FastAPI follows the champion alias
churn_monthly DAG: land, dq_gate, halt_month, realise_last_month, check_drift, decide, train_and_promote, score
churn_monthly DAG: land, dq_gate, halt_month, realise_last_month, check_drift, decide, train_and_promote, score
Decision per month: keep, halted, promoted, rejected, with task seconds
Decision per month: keep, halted, promoted, rejected, with task seconds
Realised AUC per month for the auto policy, the static policy and the oracle
Realised AUC per month for the auto policy, the static policy and the oracle
PSI heatmap per feature and month against the champion's training data
PSI heatmap per feature and month against the champion's training data
Holdout AUC per registered model version
Holdout AUC per registered model version
Diagram: Airflow publishes features to Feast and writes Evidently reports; the API reads Feast online features, routes a sticky canary and logs predictions to PostgreSQL; the rollout script reads the log
Diagram: Airflow publishes features to Feast and writes Evidently reports; the API reads Feast online features, routes a sticky canary and logs predictions to PostgreSQL; the rollout script reads the log
Bar chart per month: columns flagged by Evidently's default detector, by Evidently PSI over 0.25, and by the in-house PSI over 0.25
Bar chart per month: columns flagged by Evidently's default detector, by Evidently PSI over 0.25, and by the in-house PSI over 0.25
Left: share of training rows with a different value per feature under a naive latest-snapshot join. Right: online fetch latency p50 and p95
Left: share of training rows with a different value per feature under a naive latest-snapshot join. Right: online fetch latency p50 and p95
Left: Spearman rank correlation of each candidate against the shadow champion per stage. Right: AUC of the unpaired arms and the paired comparison at 50 percent
Left: Spearman rank correlation of each candidate against the shadow champion per stage. Right: AUC of the unpaired arms and the paired comparison at 50 percent
Hypothesis checks for v6 and v5, and the lineage reproduction AUCs
Hypothesis checks for v6 and v5, and the lineage reproduction AUCs
Max PSI per watcher run with the actions taken
Max PSI per watcher run with the actions taken
Airflow grid of churn_monthly with 12 successful runs
Airflow grid of churn_monthly with 12 successful runs
Airflow graph view of the 2026-08 run that promoted v3
Airflow graph view of the 2026-08 run that promoted v3
MLflow registry page for churn with versions, tags and aliases
MLflow registry page for churn with versions, tags and aliases
MLflow experiment churn-training with one run per challenger
MLflow experiment churn-training with one run per challenger
Swagger UI of the scoring API showing GET /model answered by version 4
Swagger UI of the scoring API showing GET /model answered by version 4
RustFS console with monthly score partitions
RustFS console with monthly score partitions
Evidently UI dashboard of the churn-monitoring project with drifted columns per month and realised ROC AUC
Evidently UI dashboard of the churn-monitoring project with drifted columns per month and realised ROC AUC
Evidently data drift report for 2026-07 against the v1 reference: 7 of 16 columns drifted
Evidently data drift report for 2026-07 against the v1 reference: 7 of 16 columns drifted
Feast UI showing the subscriber_monthly feature view with 16 features and the churn_model feature service
Feast UI showing the subscriber_monthly feature view with 16 features and the churn_model feature service
Feast lineage from the snapshot source through the feature view to the churn_model feature service
Feast lineage from the snapshot source through the feature view to the churn_model feature service
MLflow registry after the rollout: v5 holds champion, v6 carries a rollback reason, canary_percent is 0
MLflow registry after the rollout: v5 holds champion, v6 carries a rollback reason, canary_percent is 0
MLflow version 6 page with the tag rollback_reason: stage 5%: rank_agreement
MLflow version 6 page with the tag rollback_reason: stage 5%: rank_agreement
Airflow graph of churn_monthly with the new publish_features and evidently_report tasks
Airflow graph of churn_monthly with the new publish_features and evidently_report tasks
Mapping of each lab component to Cloudera CDE and CML
Mapping of each lab component to Cloudera CDE and CML