Challenge 6: Deploy and test the model

Challenge scenario

To get value from a model, you’ll want to deploy it. You can deploy a model to a managed online or batch endpoint.

Prerequisites

If you haven’t, complete the previous challenge before you continue.

Objectives

By completing this challenge, you’ll learn how to:

  • Register the model with GitHub Actions.
  • Deploy the model to an online endpoint with GitHub Actions.
  • Test the deployed model.

Important! Each challenge is designed to allow you to explore how to implement DevOps principles when working with machine learning models. Some instructions may be intentionally vague, inviting you to think about your own preferred approach. If for example, the instructions ask you to create an Azure Machine Learning workspace, it’s up to you to explore and decide how you want to create it. To make it the best learning experience for you, it’s up to you to make it as simple or as challenging as you want.

Challenge Duration

  • Estimated Time: 45 minutes

Instructions

When a model is trained and logged by using MLflow, you can easily register and deploy the model with Azure Machine Learning. After training the model, you want to deploy the model to a real-time endpoint so that it can be consumed by a web app.

  • Register the model from the production job output in the Azure Machine Learning Studio.
  • Create a GitHub Actions workflow which deploys the latest version of the registered model.
  • The workflow should create an endpoint and deploy your model to the endpoint using the CLI (v2).
Hint
The model's output was automatically generated by the MLflow auto log function in the training script. When you register the model as an MLflow type model, you don't need to provide a scoring script or environment to deploy the model.
  • Test whether the deployed model returns predictions as expected.
Hint
You can test the endpoint in the Studio, using the CLI, or by calling the endpoint from an app like Postman.

Here’s some sample data to test your endpoint with:

Pregnancies,PlasmaGlucose,DiastolicBloodPressure,TricepsThickness,SerumInsulin,BMI,DiabetesPedigree,Age
9,104,51,7,24,27.36983156,1.350472047,43
6,73,61,35,24,18.74367404,1.074147566,75
4,115,50,29,243,34.69215364,0.741159926,59

Success criteria

To complete this challenge successfully, you should be able to show:

  • A model registered in the Azure Machine Learning workspace.
  • A successfully completed Action in your GitHub repo that deploys the model to a managed online endpoint.

Useful resources