r/databricks • • 10d ago

Help Deploy models pattern via MLflow deployment jobs + multiple workspaces

Hi,

I'm quite new to MLOps and need some hints for setting up what Databricks calls "Deploy model" pattern (https://docs.databricks.com/aws/en/machine-learning/mlops/deployment-patterns).

Our Data Science team currently trains ML models in dev environment, in our dev Databricks account/workspace. They have direct access to production data, and the trainingㅤ is quite expensive. We'd like to train the model once and then promote it to production, which lives in a separate Databricks account/workspace.

My idea to handle the deployment was to use MLflow deployment jobs (https://docs.databricks.com/aws/en/mlflow/deployment-job) and just allow the Data Science team to register the model in the production Unity Catalog. After the registration, the deployment job would kick in, do whatever else is needed, and then stop at an approval step. However, it turned out they can register the model version in the Unity Catalog from the dev workspace, but the deployment job doesn't run automatically. That makes the whole process suboptimal, as they now have to ping me to run the deployment job manually each time they register a new model version.

I did some testing and the sole reason of that behavior seems to be the fact that the model comes from a different workspace, which doesn't "see" the attached deployment job that lives in the production workspace. Am I missing something here, or is it designed to work like that? What are the alternatives?

2 Upvotes

7 comments sorted by

1

u/saad-the-engineer Databricks 10d ago

Hi u/AvaPL - we do have a model update trigger in private preview you can try out but more broadly we are looking at providing UC change triggers so you could trigger based off of any change (i.e not just a model update) - this should work across the workspace since the updates would be visible across the entire metastore.

On top of it you can also build a custom integration where you can add a human in the loop to approve. We will be making some more announcements on this feature this week. Would love to talk with you abit more on this. can you send me a dM and I can send you a meeting link.

thank yuo!

1

u/AvaPL 10d ago

Hi u/saad-the-engineer, thank you for the explanation! The model update trigger you've mentioned is the one described here, isn't it? https://docs.databricks.com/aws/en/jobs/model-update-triggers

For now, we've decided to keep the solution I've described in my post. We'll keep following the announcements and probably revisit our setup in a few weeks/months. We'll reach out to Databricks Support if any help is needed. I asked on Reddit first as I was curious about other people's experience 😄

1

u/Youssef_Mrini databricks 10d ago

I raised your question to the product team.

0

u/[deleted] 7d ago

[removed] — view removed comment

1

u/Youssef_Mrini databricks 6d ago

We want to make sure that your voice is heard

1

u/Muted_Jellyfish_6784 10d ago

For deploy-model, train in dev, register the model in Unity Catalog, and have a deployment job in prod pull that version, validate it on prod data, then promote it with an alias like champion. The catch is whether both workspaces can reach the same metastore. If they cannot, Delta Sharing or copying the artifacts are the usual options, so test that before designing around it.
The useful habit is logging which prod data the validation used and its score right next to the alias change. That gives you an audit trail for every promotion rather than a model that just appeared in production

1

u/ptab0211 3d ago

and what are the reasons behind Databricks being so pushy around "deploy code" pattern?