You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable deploy of model registered by previous build (#207)
Allows you to skip the first two stages of the pipeline and deploy a model registered by a previous build by setting the variable MODEL_BUILD_ID to the previous build's id when queuing the pipeline. This speeds up the process of fixing issues with the scoring or deployment configuration.
Copy file name to clipboardExpand all lines: docs/getting_started.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,6 @@ This repository contains a template and demonstrates how to apply it to a sample
17
17
18
18
If the desire is to adopt this template for your project and to use it with your machine learning code, it is recommended to go through this guide as it is first. This ensures everything is working on your environment. After the sample is working, follow the [bootstrap instructions](../bootstrap/README.md) to convert the ***diabetes_regression*** sample into your project starting point.
19
19
20
-
21
20
## Create a Variable Group for your Pipeline
22
21
23
22
We make use of a variable group inside Azure DevOps to store variables and their
@@ -173,7 +172,6 @@ and check out the published training pipeline in the **mlops-AML-WS** workspace
173
172
174
173
Great, you now have the build pipeline set up which automatically triggers every time there's a change in the master branch.
175
174
176
-
177
175
* The first stage of the pipeline, **Model CI**, performs linting, unit testing, build and publishes an **ML Training Pipeline** in an **ML Workspace**.
178
176
179
177
**Note:** The build pipeline also supports building and publishing ML
@@ -187,22 +185,24 @@ with R on Azure ML Compute. You will also need to uncomment (i.e. include) the
187
185
to train a model with R on Databricks. You will need
188
186
to manually create a Databricks cluster and attach it to the ML Workspace as a
189
187
compute (Values DB_CLUSTER_ID and DATABRICKS_COMPUTE_NAME variables should be
190
-
specified). Example ML pipelines using R have a single step to train a model. They don't demonstrate how to evaluate and register a model. The evaluation and registering techniques are shown only in the Python implementation.
188
+
specified). Example ML pipelines using R have a single step to train a model. They don't demonstrate how to evaluate and register a model. The evaluation and registering techniques are shown only in the Python implementation.
191
189
192
190
* The second stage of the pipeline, **Train model**, triggers the run of the ML Training Pipeline. The training pipeline will train, evaluate, and register a new model. The actual computation is performed in an [Azure Machine Learning Compute cluster](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute). In Azure DevOps, this stage runs an agentless job that waits for the completion of the Azure ML job, allowing the pipeline to wait for training completion for hours or even days without using agent resources.
193
191
194
192
**Note:** If the model evaluation determines that the new model does not perform better than the previous one then the new model will not be registered and the pipeline will be cancelled.
195
193
196
194
* The third stage of the pipeline, **Deploy to ACI**, deploys the model to the QA environment in [Azure Container Instances](https://azure.microsoft.com/en-us/services/container-instances/). It then runs a *smoke test* to validate the deployment, i.e. sends a sample query to the scoring web service and verifies that it returns a response in the expected format.
197
195
198
-
The pipeline uses a Docker container on the Azure Pipelines agents to accomplish the pipeline steps. The image of the container ***mcr.microsoft.com/mlops/python:latest*** is built with this [Dockerfile](./environment_setup/Dockerfile) and it has all necessary dependencies installed for the purposes of this repository. This image serves as an example of using a custom Docker image that provides a pre-baked environment. This environment is guaranteed to be the same on any building agent, VM or local machine. In your project you will want to build your own Docker image that only contains the dependencies and tools required for your use case. This image will be more likely smaller and therefore faster, and it will be totally maintained by your team.
196
+
The pipeline uses a Docker container on the Azure Pipelines agents to accomplish the pipeline steps. The image of the container ***mcr.microsoft.com/mlops/python:latest*** is built with this [Dockerfile](./environment_setup/Dockerfile) and it has all necessary dependencies installed for the purposes of this repository. This image serves as an example of using a custom Docker image that provides a pre-baked environment. This environment is guaranteed to be the same on any building agent, VM or local machine. In your project you will want to build your own Docker image that only contains the dependencies and tools required for your use case. This image will be more likely smaller and therefore faster, and it will be totally maintained by your team.
199
197
200
198
Wait until the pipeline finishes and verify that there is a new model in the **ML Workspace**:
201
199
202
200

203
201
204
202
To disable the automatic trigger of the training pipeline, change the `auto-trigger-training` variable as listed in the `.pipelines\diabetes_regression-ci-build-train.yml` pipeline to `false`. This can also be overridden at runtime execution of the pipeline.
205
203
204
+
To skip model training and registration, and deploy a model successfully registered by a previous build (for testing changes to the score file or inference configuration), add the variable `MODEL_BUILD_ID` when the pipeline is queued, and set the value to the id of the previous build.
205
+
206
206
### Deploy the Model to Azure Kubernetes Service
207
207
208
208
The final stage is to deploy the model to the production environment running on
@@ -238,7 +238,7 @@ In the Variables tab, edit your variable group (`devopsforai-aml-vg`). In the va
Set **WEBAPP_DEPLOYMENT_NAME** to the name of your Azure Web App. This app must exist before you can deploy the model to it.
241
+
Set **WEBAPP_DEPLOYMENT_NAME** to the name of your Azure Web App. This app must exist before you can deploy the model to it.
242
242
243
243
Delete the **ACI_DEPLOYMENT_NAME** variable.
244
244
@@ -254,10 +254,10 @@ Make sure your webapp has the credentials to pull the image from the Azure Conta
254
254
255
255

256
256
257
-
# Next steps
257
+
##Next steps
258
258
259
259
* You may wish to follow the [bootstrap instructions](../bootstrap/README.md) to create a starting point for your project use case.
260
-
* Use the [Convert ML experimental code to production code](https://docs.microsoft.com/azure/machine-learning/tutorial-convert-ml-experiment-to-production#use-your-own-model-with-mlopspython-code-template) tutorial which explains how to bring your machine learning code on top of this template.
260
+
* Use the [Convert ML experimental code to production code](https://docs.microsoft.com/azure/machine-learning/tutorial-convert-ml-experiment-to-production#use-your-own-model-with-mlopspython-code-template) tutorial which explains how to bring your machine learning code on top of this template.
261
261
* The provided pipeline definition YAML file is a sample starting point, which you should tailor to your processes and environment.
262
262
* You should edit the pipeline definition to remove unused stages. For example, if you are deploying to ACI and AKS, you should delete the unused `Deploy_Webapp` stage.
263
263
* You may wish to enable [manual approvals](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/approvals) before the deployment stages.
0 commit comments