All Projects → machine-learning-apps → Ml Template Azure

machine-learning-apps / Ml Template Azure

Licence: mit
Template for getting started with automated ML Ops on Azure Machine Learning

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ml Template Azure

Rumble
⛈️ Rumble 1.11.0 "Banyan Tree"🌳 for Apache Spark | Run queries on your large-scale, messy JSON-like data (JSON, text, CSV, Parquet, ROOT, AVRO, SVM...) | No install required (just a jar to download) | Declarative Machine Learning and more
Stars: ✭ 58 (+11.54%)
Mutual labels:  azure, data-science
Datasciencevm
Tools and Docs on the Azure Data Science Virtual Machine (http://aka.ms/dsvm)
Stars: ✭ 153 (+194.23%)
Mutual labels:  azure, data-science
Recommenders
Best Practices on Recommendation Systems
Stars: ✭ 11,818 (+22626.92%)
Mutual labels:  azure, data-science
Machinelearningnotebooks
Python notebooks with ML and deep learning examples with Azure Machine Learning Python SDK | Microsoft
Stars: ✭ 2,790 (+5265.38%)
Mutual labels:  azure, data-science
Azureml Examples
Official community-driven Azure Machine Learning examples, tested with GitHub Actions
Stars: ✭ 101 (+94.23%)
Mutual labels:  azure, data-science
Computervision Recipes
Best Practices, code samples, and documentation for Computer Vision.
Stars: ✭ 8,214 (+15696.15%)
Mutual labels:  azure, data-science
Azuremonitoringhackathon
Operationalize Azure deployments with Azure platform tools​
Stars: ✭ 46 (-11.54%)
Mutual labels:  azure
Numerical Linear Algebra
Free online textbook of Jupyter notebooks for fast.ai Computational Linear Algebra course
Stars: ✭ 8,263 (+15790.38%)
Mutual labels:  data-science
Python data analysis and mining action
《python数据分析与挖掘实战》的代码笔记
Stars: ✭ 1,027 (+1875%)
Mutual labels:  data-science
Zenml
ZenML 🙏: MLOps framework to create reproducible ML pipelines for production machine learning.
Stars: ✭ 1,019 (+1859.62%)
Mutual labels:  data-science
Ppd599
USC urban data science course series with Python and Jupyter
Stars: ✭ 1,062 (+1942.31%)
Mutual labels:  data-science
Terraform Azure Reference
This repository helps you to implement Infrastructure as Code best practices using Terraform and Microsoft Azure.
Stars: ✭ 51 (-1.92%)
Mutual labels:  azure
Presentations
Talks & Workshops by the CODAIT team
Stars: ✭ 50 (-3.85%)
Mutual labels:  data-science
Causalnex
A Python library that helps data scientists to infer causation rather than observing correlation.
Stars: ✭ 1,036 (+1892.31%)
Mutual labels:  data-science
Devops Exercises
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions
Stars: ✭ 20,905 (+40101.92%)
Mutual labels:  azure
Hands On Microservices With Csharp 8 And .net Core 3 Third Edition
Hands-On Microservices with C# 8 and .NET Core 3, Third Edition, published by Packt
Stars: ✭ 46 (-11.54%)
Mutual labels:  azure
Kubernetes Guides
Crosswalk Playbooks and Code for Teams to Manage Kubernetes in Production
Stars: ✭ 51 (-1.92%)
Mutual labels:  azure
10 Simple Hacks To Speed Up Your Data Analysis In Python
Some useful Tips and Tricks to speed up the data analysis process in Python.
Stars: ✭ 45 (-13.46%)
Mutual labels:  data-science
Acs Engine
WE HAVE MOVED: Please join us at Azure/aks-engine!
Stars: ✭ 1,049 (+1917.31%)
Mutual labels:  azure
Tpot
A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
Stars: ✭ 8,378 (+16011.54%)
Mutual labels:  data-science

ML Ops with GitHub Actions and Azure Machine Learning

plus Azure Machine Learning + Actions

This template can be used for easily setting up a data science or machine learning project with automated training and deployment using GitHub Actions and Azure Machine Learning. For a more comprehensive version of this automated pipeline, see the aml-template repository.

Getting started

YouTube Video

Click on the image to view the video on YouTube. The video shows you the setup process, which is also described below: Azure Machine Learning GitHub Actions - Setup Guide

1. Prerequisites

The following prerequisites are required to make this repository work:

  • Azure subscription
  • Contributor access to the Azure subscription
  • Access to GitHub Actions

If you don’t have an Azure subscription, create a free account before you begin. Try the free or paid version of Azure Machine Learning today.

2. Create repository

To get started with ML Ops, simply create a new repo based off this template, by clicking on the green "Use this template" button:

GitHub Template repository

3. Setting up the required secrets

A service principal needs to be generated for authentication and getting access to your Azure subscription. We suggest adding a service principal with contributor rights to a new resource group or to the one where you have deployed your existing Azure Machine Learning workspace. Just go to the Azure Portal to find the details of your resource group or workspace. Then start the Cloud CLI or install the Azure CLI on your computer and execute the following command to generate the required credentials:

# Replace {service-principal-name}, {subscription-id} and {resource-group} with your 
# Azure subscription id and resource group name and any name for your service principle
az ad sp create-for-rbac --name {service-principal-name} \
                         --role contributor \
                         --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} \
                         --sdk-auth

This will generate the following JSON output:

{
  "clientId": "<GUID>",
  "clientSecret": "<GUID>",
  "subscriptionId": "<GUID>",
  "tenantId": "<GUID>",
  (...)
}

Add this JSON output as a secret with the name AZURE_CREDENTIALS in your GitHub repository:

GitHub Template repository

To do so, click on the Settings tab in your repository, then click on Secrets and finally add the new secret with the name AZURE_CREDENTIALS to your repository.

Please follow this link for more details.

4. Define your workspace parameters

You have to modify the parameters in the /.cloud/.azure/workspace.json" file in your repository, so that the GitHub Actions create or connect to the desired Azure Machine Learning workspace. Just click on the link and edit the file.

Please use the same value for the resource_group parameter that you have used when generating the azure credentials. If you already have an Azure ML Workspace under that resource group, change the name parameter in the JSON file to the name of your workspace, if you want the Action to create a new workspace in that resource group, pick a name for your new workspace, and assign it to the name parameter. You can also delete the name parameter, if you want the action to use the default value, which is the repository name.

Once you save your changes to the file, the predefined GitHub workflow that trains and deploys a model on Azure Machine Learning gets triggered. Check the actions tab to view if your actions have successfully run.

GitHub Actions Tab

5. Modify the code

Now you can start modifying the code in the code folder, so that your model and not the provided sample model gets trained on Azure. Where required, modify the environment yaml so that the training and deployment environments will have the correct packages installed in the conda environment for your training and deployment. Upon pushing the changes, actions will kick off your training and deployment run. Check the actions tab to view if your actions have successfully run.

Comment lines 39 to 55 in your "/.github/workflows/train_deploy.yml" file if you only want to train the model. Uncomment line 7 to 8, if you only want to kick off the workflow when pushing changes to the "/code/" file.

6. Viewing your AML resources and runs

The log outputs of your action will provide URLs for you to view the resources that have been created in AML. Alternatively, you can visit the Machine Learning Studio to view the progress of your runs, etc. For more details, read the documentation below.

Documentation

Code structure

File/folder Description
code Sample data science source code that will be submitted to Azure Machine Learning to train and deploy machine learning models.
code/train Sample code that is required for training a model on Azure Machine Learning.
code/train/train.py Training script that gets executed on a cluster on Azure Machine Learning.
code/train/environment.yml Conda environment specification, which describes the dependencies of train.py. These packages will be installed inside a Docker image on the Azure Machine Learning compute cluster, when executing your train.py.
code/train/run_config.yml YAML files, which describes the execution of your training run on Azure Machine Learning. This file also references your environment.yml. Please look at the comments in the file for more details.
code/deploy Sample code that is required for deploying a model on Azure Machine Learning.
code/deploy/score.py Inference script that is used to build a Docker image and that gets executed within the container when you send data to the deployed model on Azure Machine Learning.
code/deploy/environment.yml Conda environment specification, which describes the dependencies of score.py. These packages will be installed inside the Docker image that will be used for deploying your model.
code/test/test.py Test script that can be used for testing your deployed webservice. Add a deploy.json to the .cloud/.azure folder and add the following code { "test_enabled": true } to enable tests of your webservice. Change the code according to the tests that zou would like to execute.
.cloud/.azure Configuration files for the Azure Machine Learning GitHub Actions. Please visit the repositories of the respective actions and read the documentation for more details.
.github/workflows Folder for GitHub workflows. The train_deploy.yml sample workflow shows you how your can use the Azure Machine Learning GitHub Actions to automate the machine learning process.
docs Resources for this README.
CODE_OF_CONDUCT.md Microsoft Open Source Code of Conduct.
LICENSE The license for the sample.
README.md This README file.
SECURITY.md Microsoft Security README.

Documentation of Azure Machine Learning GitHub Actions

The template uses the open source Azure certified Actions listed below. Click on the links and read the README files for more details.

  • aml-workspace - Connects to or creates a new workspace
  • aml-compute - Connects to or creates a new compute target in Azure Machine Learning
  • aml-run - Submits a ScriptRun, an Estimator or a Pipeline to Azure Machine Learning
  • aml-registermodel - Registers a model to Azure Machine Learning
  • aml-deploy - Deploys a model and creates an endpoint for the model

Known issues

Error: MissingSubscriptionRegistration

Error message:

Message: ***'error': ***'code': 'MissingSubscriptionRegistration', 'message': "The subscription is not registered to use namespace 'Microsoft.KeyVault'. See https://aka.ms/rps-not-found for how to register subscriptions.", 'details': [***'code': 'MissingSubscriptionRegistration', 'target': 'Microsoft.KeyVault', 'message': "The subscription is not registered to use namespace 'Microsoft.KeyVault'. See https://aka.ms/rps-not-found for how to register subscriptions

Solution:

This error message appears, in case the Azure/aml-workspace action tries to create a new Azure Machine Learning workspace in your resource group and you have never deployed a Key Vault in the subscription before. We recommend to create an Azure Machine Learning workspace manually in the Azure Portal. Follow the steps on this website to create a new workspace with the desired name. After ou have successfully completed the steps, you have to make sure, that your Service Principal has access to the resource group and that the details in your /.cloud/.azure/workspace.json" file are correct and point to the right workspace and resource group.

What is MLOps?

Azure Machine Learning Lifecycle

MLOps empowers data scientists and machine learning engineers to bring together their knowledge and skills to simplify the process of going from model development to release/deployment. ML Ops enables you to track, version, test, certify and reuse assets in every part of the machine learning lifecycle and provides orchestration services to streamline managing this lifecycle. This allows practitioners to automate the end to end machine Learning lifecycle to frequently update models, test new models, and continuously roll out new ML models alongside your other applications and services.

This repository enables Data Scientists to focus on the training and deployment code of their machine learning project (code folder of this repository). Once new code is checked into the code folder of the master branch of this repository the GitHub workflow is triggered and open source Azure Machine Learning actions are used to automatically manage the training through to deployment phases.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].