[[TOC]]
Click --> Start free
---------- I signed up using GitHub ------------------------------
================ END OF TASK 1 =======================================
Once you signed up - You will be directed to https://portal.azure.com/#home
Go to --> https://portal.azure.com/#create/Microsoft.ResourceGroup
Create Resource Group
- Search - DevOps - from the Azure Portal Search**
- Create Organization in Azure DevOps
Go to --> https://dev.azure.com/ --> Select "New Organization"
- Create Project inside the Organization --> Select "New Project"
- This will create a Repository
- Wiki
- Project Board
Once created you will see below the console
================ END OF TASK 2 =======================================
- Search - "Azure Machine Learning - from the Azure Portal Search**
- Click on "Create" - Wait for 5-10 minutes till Workspace get created.
- Open Azure ML Workspace Studio URL
-
Check Notebooks
-
Data
-
Jobs and Experiements
-
Model
-
Endpoints
-
Compute
-
Data Stores
- Go to Manage - Compute
Click Create
- Go to Assets --> Data --> Create --> From Local Files
- Browse and Select the files from local
- You can see the Data Discovered and Preview., Also data schema type
- Enable Checkbox of "Profile the Data Set" and select the Compute created in before steps"
================ END OF TASK 3 =======================================
-
Go to https://dev.azure.com/ --> Select your project
-
Select Project Settings
or https://dev.azure.com///_settings
- Click Service Connection. --> New Service Connection --> Select "Azure Resource Manager"
- Select "Service Principal (automatic) for Azure DevOps
- Select "Subscription" - We need this to be created, In Order for Azure DevOps to create the required resources inside the Resource group.
-
Select "Service Principal (automatic) for Azure DevOps to Azure ML
-
Select "Machine Learning Workspace " - We need this to be created, In Order for Azure DevOps to create the resources in the Azure Workspace via Azure Pipeline
- Install Machine Learning Extention to Azure DevOps Click on the Highlight red one --> Manage Extension --> Browser Market Place
Select Machine Learning
================ END OF TASK 4 =======================================
- Go to the Azure Projected created in #Task 2
- Let us create Required Variables in the Library Section Pipeline
- Create a Variable group
AZURE_RM_SVC_CONNECTION | mlops-demo-azure-devops-service-connection |
---|---|
BASE_NAME | mlopsblrws |
LOCATION | eastus2 |
RESOURCE_GROUP | mlops-demo-blr-resource-group |
WORKSPACE_NAME | mlops-blr-ws-aml |
WORKSPACE_SVC_CONNECTION | mlops-aml-service-connection |
- Select "Azure Repos Git"
- Select the Repo and Cli
- Select "Existing Azure Pipeline YAML File"
- Provide the Path of YAML
- Select the Pipeline and go to the Run and Make sure it is GREEN
Check the Jobs for Pipeline Run logs
- Select the recent logs --> go to Jobs and check the Jobs
================ END OF TASK 5 =======================================
- Follow the same procedure as above to create a Pipeline but select different path for creating MLOps Pipeline
- Create a Variables.
Name | Value |
---|---|
aml.sp | Get the Object ID from DevOps Service Principle |
amlcompute.clusterName | mldemocluster |
amlcompute.idleSecondsBeforeScaledown | 300 |
amlcompute.maxNodes | 2 |
amlcompute.minNodes | 0 |
amlcompute.vmSize | STANDARD_DS2_V2 |
azureml.location | eastus2 |
azureml.resourceGroup | mlops-demo-blr-resource-group |
azureml.workspaceName | mlops-blr-ws-aml |
-
Run the Pipeline - It takes 10 Minutes to execute.
-
Select the Run and Click on "Agent Job 1" - and You can see all Tasks in Pipeline succeeded.
================ END OF TASK 6 =======================================
- Go to Azure devops project --> Pipelines --> Releases --> Create New Release
- You can select the Artifacts from the pipeline created before. - Click Add and Artifact
-
Add a Stage to perform the deployment - The best practice is to Create a Deployment to staging environment as part of (Stage 2 )and if succeed deploy to Prod.
-
For Demo Purpose, I am directly deploying to the Production environment.
-
Click Add - New Agent will be created. - Rename to ML-Deployment-Agent
-
Create Variables
Name | Value |
---|---|
aks.clusterName | Select your existing cluster |
aks.vmSize | Standard_B2ms |
azureml.resourceGroup | mlops-demo-blr-resource-group |
azureml.workspaceName | mlops-blr-ws-aml |
service.name.prod | insurance-ml-model-prod |
aks.agentCount | 3 |
- Set the Agent Job
- Rename the Display Name
- Agent Pool --> Azure Pipeline
- Agent Specification --> Ubuntu-18.04
- Click on Add task from the Agent
Search for Python Version
- Click on Add task from the Agent -> Search Azure CLI -> Change Display - Add ML Extension
- Inline script - Add below Value
az extension add -n azure-cli-ml
-
Click on Add task from the Agent -> Search Azure CLI -> Change Display -Deploy to AKS
- Inline script - Add below Value
az ml model deploy -g $(azureml.resourceGroup) -w $(azureml.workspaceName) -n $(service.name.prod) -f ../metadata/model.json --dc aksDeploymentConfigProd.yml --ic inferenceConfig.yml --ct $(aks.clusterName) --overwrite
- Inline script - Add below Value
- Validate the Status of Pipeline
================ END OF TASK 7 =======================================
- Go to Azure Machine learning Workspace
- Validate the Model - You can see the New Model Created
- Validate Endpoint.
- Validate with test data - Step 1 - Get the Python Code
- Go to Assets - Endpoints -- Consume - Check Python and Take the code
-
Validate with test data - Step 1 - Test in Notebook
- Go to Author - Notebook -- Consume - Create the Notebook file. -> Paste the Python Code. -> Change the Value of the Data as mentioned below --> Run the Cell
Replace the line 8 Data with below Values
data = {'data': [[0,1,8,1,0,0,1,0,0,0,0,0,0,0,12,1,0,0,0.5,0.3,0.610327781,7,1,-1,0,-1,1,1,1,2,1,65,1,0.316227766,0.669556409,0.352136337,3.464101615,0.1,0.8,0.6,1,1,6,3,6,2,9,1,1,1,12,0,1,1,0,0,1],[4,2,5,1,0,0,0,0,1,0,0,0,0,0,5,1,0,0,0.9,0.5,0.771362431,4,1,-1,0,0,11,1,1,0,1,103,1,0.316227766,0.60632002,0.358329457,2.828427125,0.4,0.5,0.4,3,3,8,4,10,2,7,2,0,3,10,0,0,1,1,0,1]]}
- Monitor using the Application Insights using the Application Insight URL from Endpoints.
- Go to Assets - Endpoints - Details --> Application Insights URL --> Click the URL
- You can see the Application throughput here.
================ END OF LAB =======================================