Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 4.01 KB

Challenge-04.md

File metadata and controls

47 lines (33 loc) · 4.01 KB

Challenge 4 – Create a Release Pipeline In Azure DevOps

< Previous Challenge - Home - Next Challenge >

Introduction

The Release pipeline demonstrates the automation of various stages/tasks involved in deploying an ML model and operationalizing the model in production. The stages generally constitute collecting the Build Artifacts, creating a web service and testing the web service. This web service that gets created in the Release Pipeline is a REST endpoint (a Scoring URI) used to predict/forecast on a new dataset. Additionally, it can be plugged into business applications to leverage the intelligence of the model.

There are several ways to create a Release pipeline. The two most common and popular ways are:

  • Using a YAML file that represents the entire pipeline.
  • Using a classic GUI pipeline & adding tasks sequentially.

We can setup Continuous Deployment (CID) trigger for every Release pipeline. The pipeline shows how to operationalize the scoring image and promote it safely across different environments.

Description

  • Create a Release pipeline.
  • Start with an empty job.
  • Add Build Artifact that you created in the previous challenge (your built pipeline).
    • Set Agent Pool to Azure Pipelines.
    • Set Agent Specification to ubuntu-18.04.
  • Add Release pipeline tasks (add task to Agent job):
    • Add a task to install the required version of Python Python 3.6.
    • Add a task to setup environment by using install_environment.sh file in environment_setup/ folder. This will install all the python modules required to deploy the forecasting model.
    • Important: Add the path to the artifact in the Advanced -> Working Directory section (and for all tasks below).
    • Add a task to deploy the scoring image on ACI using deployOnAci.py in service/code/ folder. A “healthy” ACI deployment will be created under Azure ML Endpoints. It contains a REST-based Scoring URI/Endpoint that you can call using Postman or Swagger.
    • TIP: Use the Azure CLI task to run the Python scripts since they need to interact with the Azure Machine Learning resource(for this task and beyond, where you will need to run the Python script). Azure CLI task for Azure ML Workspace connection with python service/code/deployOnAci.py in the Inline Script. Script type: Shell
      • NOTE: ACI is recommended to use testing or pre-production stages. Since bigger inferencing compute is needed in production for low latency and high throughput, it is recommended to use AKS cluster in production.
    • Add a task to test the ACI web service using AciWebserviceTest.py in service/code/ folder. This allows you to run the web service on new data (or test data) to forecast demand for new items.
      • NOTE: If the deployment fails or the web service is "unhealthy", check logs in Azure DevOps or Azure ML Studio for issues and additional information.

Success Criteria

  • An end-to-end Release pipeline in Azure DevOps.
  • A “healthy” ACI deployment is created under Azure ML Endpoints, which can be confirmed to be operational by using a tool like Postman or Swagger.

Tips

Learning resources