GitHub Actions Does Not Know What a Model Is
"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.
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.
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.