Code Monkey home page Code Monkey logo

azure-mlops-python's Introduction

page_type languages products description
sample
python
azure
azure-machine-learning-service
azure-devops
Code which demonstrates how to set up and operationalize an MLOps flow leveraging Azure Machine Learning and Azure DevOps.

MLOps with Azure ML

MLOps will help you to understand how to build the Continuous Integration and Continuous Delivery pipeline for a ML/AI project. We will be using the Azure DevOps Project for build and release/deployment pipelines along with Azure ML services for model retraining pipeline, model management and operationalization.

ML lifecycle

This template contains code and pipeline definition for a machine learning project demonstrating how to automate an end to end ML/AI workflow. The build pipelines include DevOps tasks for data sanity test, unit test, model training on different compute targets, model version management, model evaluation/model selection, model deployment as realtime web service, staged deployment to QA/prod and integration testing.

Prerequisite

  • Active Azure subscription
  • At least contributor access to Azure subscription

Getting Started

To deploy this solution in your subscription, follow the manual instructions in the getting started doc

If you have deployed this solution in Azure Pipeline AND want to recreate your Azure environment:

  1. Execute the infrastructure as code (IaC) pipeline to provision Azure resources
  2. Execute the build pipeline to publish AML training pipeline
  3. Confirm that release trigger pipeline is executing/executed (from automatic CI trigger). This will trigger AML pipeline to execute, which may take ~ 20 minutes to complete
  4. Execute the release deployment pipeline to deploy model to ACI and AKS, which may take ~ 20 minutes to complete

Architecture Diagram

This reference architecture shows how to implement continuous integration (CI), continuous delivery (CD), and retraining pipeline for an AI application using Azure DevOps and Azure Machine Learning. The solution is built on the scikit-learn diabetes dataset but can be easily adapted for any AI scenario and other popular build systems such as Jenkins and Travis.

Architecture

Architecture Flow

Train Model

  1. Data Scientist writes/updates the code and push it to git repo. This triggers the Azure DevOps build pipeline (continuous integration).

  2. Once the Azure DevOps build pipeline is triggered, it performs code quality checks, data sanity tests, unit tests, builds an Azure ML Pipeline and publishes it in an Azure ML Service Workspace.

  3. The Azure ML Pipeline is triggered once the Azure DevOps build pipeline completes. All the tasks in this pipeline runs on Azure ML Compute. Following are the tasks in this pipeline:

    • Train Model task executes model training script on Azure ML Compute. It outputs a model file which is stored in the run history.

    • Evaluate Model task evaluates the performance of the newly trained model with the model in production. If the new model performs better than the production model, the following steps are executed. If not, they will be skipped.

    • Register Model task takes the improved model and registers it with the Azure ML Model registry. This allows us to version control it.

Deploy Model

Once you have registered your ML model, you can use Azure ML + Azure DevOps to deploy it.

Azure DevOps release pipeline packages the new model along with the scoring file and its python dependencies into a docker image and pushes it to Azure Container Registry. This image is used to deploy the model as web service across QA and Prod environments. The QA environment is running on top of Azure Container Instances (ACI) and the Prod environment is built with Azure Kubernetes Service (AKS).

Repo Details

You can find the details of the code and scripts in the repository here

References


PLEASE NOTE FOR THE ENTIRETY OF THIS REPOSITORY AND ALL ASSETS

  1. No warranties or guarantees are made or implied.
  2. All assets here are provided by me "as is". Use at your own risk. Validate before use.
  3. I am not representing my employer with these assets, and my employer assumes no liability whatsoever, and will not provide support, for any use of these assets.
  4. Use of the assets in this repo in your Azure environment may or will incur Azure usage and charges. You are completely responsible for monitoring and managing your Azure usage.

Unless otherwise noted, all assets here are authored by me. Feel free to examine, learn from, comment, and re-use (subject to the above) as needed and without intellectual property restrictions.

If anything here helps you, attribution and/or a quick note is much appreciated.

azure-mlops-python's People

Contributors

kawofong avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.