GitHub Actions Does Not Know What a Model Is

Pie chart of MLOps startup categories that raised money in 2020
Where the 2020 funding went. The thick slices are monitoring, data management, platforms, and accelerators. Versioning, experiment tracking, and deployment are thin. That matched our week: lots of ways to watch a server, no shared id between a metric and a file.

"MLOps" was on every slide this spring. Under the word sat a notebook, a pickle in a bucket, and a job someone was afraid to edit. GitHub Actions had become the CI system people actually turned on. It runs tests. It does not know which parquet file trained the model it is about to copy into production.

Stacked area chart of ML and AI tools growing from 2008 to 2019
The catalogue grew every year through 2019, across data, training, infrastructure, and serving. A new box on this chart did not give us a run id. We had four of the boxes and still could not say what was serving traffic.

The fraud model, specifically

The model was an XGBoost classifier for a fraud score. Actions ran pytest on the feature code. MLflow had a run with an AUC we liked. DVC was supposed to pin the parquet. Those three facts lived in three systems, and nothing joined them.

Someone retrained on a laptop, logged a higher AUC, and went to lunch. The deploy job pulled models/latest from the bucket. latest was the older file. The new run id was a row in MLflow and nowhere else. The slide improved. The score coming back from the service did not.

Seven parts of an end-to-end MLOps platform, from data processing through infrastructure
The seven rooms everyone draws: data, training, tracking, deploy, monitoring, workflow, machines. Our break was the hallway between training, tracking, and deploy. The rooms existed. They did not share a key.

One id, checked by the job that ships

We picked the MLflow run id and made it the only name the deploy job accepts.

  • The training command is the same on a laptop and in Actions. There is no path called "it worked in the notebook."
  • The data is a DVC hash, committed beside the code that reads it. A changed parquet shows up in the diff.
  • Training writes the run id into a sidecar next to the model file. A model file without the sidecar is not an artifact we will copy.
  • The validation AUC is computed on a split frozen in the repo, not on whatever the last cell of the notebook held that afternoon.
  • Deploy exits non-zero if the run id is missing from the registry, or if the recorded AUC is under the bar for this model. The bar is a number in the workflow file, reviewed like code.

Actions still does not understand models. It understands a script that exits non-zero. So the script that understands the model is the thing that fails the job. We did not need another platform from the thick part of the funding chart. We needed the deploy step to be willing to fail when the id was wrong. The tools were already installed. They were not pointed at the same name.