-
Notifications
You must be signed in to change notification settings - Fork 7
Component MLOps
During the "Scaling responsible MLOps with Azure Machine Learning" breakout session you saw Bea updating AzureML components via a nice CI/CD process using GitHub Actions. This documentation will walk you through how to set that up!
It is assumed that you have set up the AzureML infrastructure as described in the Setup instructions. You will need the Resource Group name you created along with the name of the AzureML Workspace to complete this exercise.
There are a couple of steps required to enable the CI/CD process:
- Fork the repo
- Enable GitHub Actions
- Add Secrets
- Modify a component
As soon as you clone the repo, head over to the Actions tab and enable GitHub Actions. You should see a screen like this one:
This GitHub Action uses three secrets:
-
AML_RG
- the name of your resource group -
AML_WORKSPACE
- the name of your AzureML Workspace -
AZURE_TOKEN
- your connection token to Azure (used by the Azure ML CLI to access your workspace)
The first two are pretty straight forward to get and are visible if you head over to the resource group int he Azure Portal:
Adding a secret consists of navigating to the Settings tab,
clicking on Secrets / Actions. Here's what it looks like
to add the AML_WORKSPACE
key:
The AZURE_TOKEN
secret is created by running the following
command in the Azure Cloud Shell:
az ad sp create-for-rbac --name "<YOUR_APP>-ci" --role contributor --scopes /subscriptions/<YOUR_SUBSCRIPTION_ID>/resourceGroups/<YOUR_RESOURCE_GROUP> --sdk-auth
The Azure Cloud Shell is accessible at the top of the portal:
Running the command should look something like this:
The contents of the output are then added as a secret in GitHub as follows:
Once the process is complete, your Action secrets should look like this:
This action currently only works if a component is modified.
This can be done by editing any *.py
or *.yml
file in
the components directory. If you have not created any
components yet (meaning your Workspace has no custom componets),
you can create them by following the Finetuning Component
instructions.
Once a file is modified, the action should fire and update the components!