- Perform the initial setup if not already done
- Fork the MLOps repository
- Visit the MLOps github project and click
Fork
on top right. - Give a name & let it remain "Public" for course of this workshop
- In your project page copy your clone https url by clicking on the
Clone or Download
button - 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.
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_pipelines/EnvCreatePipeline.yml
-> Click Continue -> Click Run - You can monitor the status by clicking on the stages. Check if your pipeline ran successfully.
- 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 workspace
and 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/dataset/german_credit_data.csv
- Important Change dataset name to
credit_dataset
- Follow the onscreen instructions by clicking
Next
till 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 projectgoto: 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_pipelines/BuildReleasePipeline.yml
-> Click Continue -> Click Run
- Click
You can monitor the status by clicking on the stages. Check if your pipeline ran successfully.
- Get the service endpoint:
- Navigate to the Azure ML portal
- Go to
Endpoints
in the left nav bar -> click on the deployed service - copy the url of the
REST endpoint
from 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
Test
button - You should see
[0]
in the response body (The label0
means bad and1
means good from this credit risk model's perspective). For this data you will see a0
.
- 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_pipelines/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.