|
| 1 | +### Author: Praneet Singh Solanki |
| 2 | + |
| 3 | +# DevOps For AI |
| 4 | + |
| 5 | +[DevOps for AI template](https://azuredevopsdemogenerator.azurewebsites.net/?name=azure%20machine%20learning) 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 pipelines along with Azure ML services for ML/AI model management and operationalization. |
| 6 | + |
| 7 | +This template contains code and pipeline definition for a machine learning project demonstrating how to automate the end to end ML/AI project. 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, integration testing and functional testing. |
| 8 | + |
| 9 | +## Prerequisite |
| 10 | +- Active Azure subscription |
| 11 | +- Minimum contributor access to Azure subscription |
| 12 | + |
| 13 | +## Getting Started: |
| 14 | + |
| 15 | +### Import the DevOps for AI solution template from Azure DevOps Demo Generator: [Click here](https://azuredevopsdemogenerator.azurewebsites.net/?name=azure%20machine%20learning) |
| 16 | + |
| 17 | +Skip above step if already done. |
| 18 | + |
| 19 | +Once the template is imported for personal Azure DevOps account using DevOps demo generator, you need to follow below steps to get the pipeline running: |
| 20 | + |
| 21 | +### Update Pipeline Config: |
| 22 | + |
| 23 | +#### Build Pipeline |
| 24 | +1. Go to the **Pipelines -> Builds** on the newly created project and click **Edit** on top right |
| 25 | + |
| 26 | +2. Click on **Create or Get Workspace** task, select the Azure subscription where you want to deploy and run the solution, and click **Authorize** |
| 27 | + |
| 28 | +3. Click all other tasks below it and select the same subscription (no need to authorize again) |
| 29 | +4. Once the tasks are updated with subscription, click on **Save & queue** and select **Save** |
| 30 | + |
| 31 | + |
| 32 | +#### Release Pipeline |
| 33 | +1. Go to the **Pipelines -> Releases** and click **Edit** on top |
| 34 | + |
| 35 | +2. Click on **1 job, 4 tasks** to open the tasks in **QA stage** |
| 36 | + |
| 37 | +3. Update the subscription details in two tasks |
| 38 | + |
| 39 | +4. Click on **Tasks** on the top to switch to the Prod stage, update the subscription details for the two tasks in prod |
| 40 | + |
| 41 | +5. Once you fix all the missing subscription, the **Save** is no longer grayed, click on save to save the changes in release pepeline |
| 42 | + |
| 43 | + |
| 44 | +### Update Repo config: |
| 45 | +1. Go to the **Repos** on the newly created Azure DevOps project |
| 46 | +2. Open the config file [/aml_config/config.json](/aml_config/config.json) and edit it |
| 47 | +3. Put your Azure subscription ID in place of <> |
| 48 | +4. Change resource group and AML workspace name if you want |
| 49 | +5. Put the location where you want to deploy your Azure ML service workspace |
| 50 | +6. Save the changes and commit these changes to master branch |
| 51 | +7. The commit will trigger the build pipeline to run deploying AML end to end solution |
| 52 | +8. Go to **Pipelines -> Builds** to see the pipeline run |
| 53 | + |
| 54 | +## Steps Performed in the Build Pipeline: |
| 55 | + |
| 56 | +1. Prepare the python environment |
| 57 | +2. Get or Create the workspace |
| 58 | +3. Submit Training job on the remote DSVM / Local Python Env |
| 59 | +4. Register model to workspace |
| 60 | +5. Create Docker Image for Scoring Webservice |
| 61 | +6. Copy and Publish the Artifacts to Release Pipeline |
| 62 | + |
| 63 | +## Steps Performed in the Release Pipeline |
| 64 | +In Release pipeline we deploy the image created from the build pipeline to Azure Container Instance and Azure Kubernetes Services |
| 65 | + |
| 66 | +### Deploy on ACI - QA Stage |
| 67 | +1. Prepare the python environment |
| 68 | +2. Create ACI and Deploy webservice image created in Build Pipeline |
| 69 | +3. Test the scoring image |
| 70 | + |
| 71 | +### Deploy on AKS - PreProd/Prod Stage |
| 72 | +1. Prepare the python environment |
| 73 | +2. Deploy on AKS |
| 74 | + - Create AKS and create a new webservice on AKS with the scoring docker image |
| 75 | + |
| 76 | + OR |
| 77 | + |
| 78 | + - Get the existing AKS and update the webservice with new image created in Build Pipeline |
| 79 | +3. Test the scoring image |
| 80 | + |
| 81 | +### Repo Details |
| 82 | + |
| 83 | +You can find the details of the code ans scripts in the repository [here](/docs/code_description.md) |
| 84 | + |
| 85 | +### References |
| 86 | + |
| 87 | +- [Azure Machine Learning(Azure ML) Service Workspace](https://docs.microsoft.com/en-us/azure/machine-learning/service/overview-what-is-azure-ml) |
| 88 | + |
| 89 | +- [Azure ML Samples](https://docs.microsoft.com/en-us/azure/machine-learning/service/samples-notebooks) |
| 90 | +- [Azure ML Python SDK Quickstart](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-create-workspace-with-python) |
| 91 | +- [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/?view=vsts) |
1 | 92 |
|
2 | 93 | # Contributing |
3 | 94 |
|
|
0 commit comments