- Perform the initial setup if not already done
- Fork the MLOps repository
- Visit the MLOps github project and click
Forkon top right. - Give a name & let it remain "Public" for course of this workshop
- From your github repository, directly edit the file
mlops/recipes/common/Variables.yml: Change theBASE_NAMEas per the instructions given there. Note: If you wish to reuse your existing ML workspace, then update theVariables.ymlwith the details - In your project page copy your clone https url by clicking on the
Clone or Downloadbutton - you will need this for next step
- Visit the MLOps github project and click
- Setup integration between Devops & Github
- In the Azure Devops project you created earlier goto: Pipelines -> Pipelines
- Create new pipeline by clicking "New pipeline" button on top right
- To respond to question "Where is your code", click
Github (YAML)- Authorize the two requests: One for Azure devops to connect to github to load your pipelines & another for integration of triggers from github to Devops
- Click
Existing Azure Pipelines YAML file - Now you will see a list of YML (yaml) files. Follow next step below.
Note: Skip this step if you wish to reuse your existing Azure ML workspace
This step will create the cloud environment and provision all the required services including Resource group & Azure ML Workspace
- Continuing from the last section: select
mlops/recipes/IaC/ProvisionMLWorkspace.yml-> Click Continue -> Click Run - You can monitor the status by clicking on the stages. Check if your pipeline ran successfully.
- [Optional] Rename the pipeline run in Azure Devops to give a meaningful name.
You can do this by visiting
Pipelinein the left nav bar of Azure Devops. You can then From therecent runs, you can click the three dots in the right and clickrename
- Login into the Azure ML portal and switch to the new workspace that was created using the build pipeline:
- In the top nav bar, click the Switch Directory icon
- Click on the drop down
Machine learning workspaceand select the one that was just created (BASE_NAME-aml-ws)
- In the left panel click
Dataset->Create Dataset->from web files- Paste this url
https://raw.githubusercontent.com/rsethur/MLOps/master/models/risk-model/dataset/german_credit_data.csv - Important Change dataset name to
credit_dataset - If a
CORS errorshows up, open the page and check all boxes in theAllowed methodsdrop down. - Follow the onscreen instructions by clicking
Nexttill completion
- Paste this url
Now we can run training & automate the deployment by running the build release pipeline.
- Similar to first pipeline we ran, in the Azure Devops project goto: Pipelines -> Pipelines
- Create new pipeline by clicking "New pipeline" button on top right
- To respond to question "Where is your code", click
Github (YAML)- Click
Existing Azure Pipelines YAML file - Now you will see a list of YML (yaml) files: select
mlops/model_pipelines/risk-model/BuildReleasePipeline.yml-> Click Continue -> Click Run
- Click
You can monitor the status by clicking on the stages. Check if your pipeline ran successfully.
You can try various other pipelines from mlops/model_pipelines/risk-model. You will see pipelines fo
- Batch Scoring
- Release Pipeline for Pretrained model
- No code deploy
- In the
snippetsfolder inmlops/model_pipelines/risk-modelyou can find few smaller atomic pipelines to play with
- Get the service endpoint:
- Navigate to the Azure ML portal
- Go to
Endpointsin the left nav bar -> click on the deployed service - copy the url of the
REST endpointfrom the details
- Two options for testing the end point
- Easy option:
- Go to the prefilled request details in this page
- Replace the existing URL with the new endpoint url -> click the
Testbutton - You should see predictions in the response body.
- Another option:
- Use your favourite REST endpoint testing tool like Postman or API Tester (online)
- Fill the details:
- Your rest endpoint URL
- Set content-type to
application/json - Request type to
POST - Copy the following post data -> press submit/test
{ 'data': { "Age": [ 20 ], "Sex": [ "male" ], "Job": [ 0 ], "Housing": [ "own" ], "Saving accounts": [ "little" ], "Checking account": [ "little" ], "Credit amount": [ 100 ], "Duration": [ 48 ], "Purpose": [ "radio/TV" ] } }
- Easy option:
Once you understand the concepts & ready to delete the resources you can fo the the following:
From Azure Devops run the pipeline mlops/EnvTearDownPipeline.yml. Alternatively you can login to Azure Portal and delete the resource group that we created (i.e. your-unique-name-aml-rg).
Do ⭐ the repo if you like it.