Databricks ML Professional Practice Question 18: Deploy Code Not Models
Databricks Certified Machine Learning Professional · Test 2 · question 8 of 10
An organisation is designing promotion for a retraining pipeline across dev, staging and prod workspaces. Production data is governed and readable only from the production environment; development holds a small anonymised sample. The team requires that the production model be trained on production data and that every piece of code reaching production has passed review and automated tests.
Which promotion approach does Databricks recommend here?
Show answer and explanation
Answer:
This is the "deploy code" pattern, which Databricks recommends for most situations: the artifact that moves between environments is the code, not the model. The same reviewed, tested repository is deployed to each bundle target, and the production model is produced by running production code against production data in the production environment. That satisfies both constraints at once; the training data is the real data, and nothing reaches production without passing the review and test gates that govern the repository.
Option A is the "deploy models" pattern, which is legitimate in its own right and is how a *validated* artifact gets promoted once it exists. It fails here on the stated constraint: a model trained on an anonymised development sample was never fitted to production data, so copying it forward promotes the wrong model regardless of the mechanics.
Option C solves the constraint by removing it, which is the opposite of what governed data is for. Widening production access to the development workspace expands the blast radius of every experiment run there.
Option D abandons a single source of truth. Independently evolving copies guarantee that what was tested in staging is not what runs in production, and reproducing a production model becomes impossible.
Reference: MLOps workflow on Databricks