Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Component MLOps

sethjuarez edited this page May 24, 2022 · 4 revisions

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!

Infrastructure Setup

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.

Basic Steps

There are a couple of steps required to enable the CI/CD process:

  1. Fork the repo
  2. Enable GitHub Actions
  3. Add Secrets
  4. Modify a component

Enable GitHub Actions

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:

Enable Workflows

Add Secrets

This GitHub Action uses three secrets:

  1. AML_RG - the name of your resource group
  2. AML_WORKSPACE - the name of your AzureML Workspace
  3. 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:

AzureML Resource Group and Workspace

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:

Workspace Secret

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:

Azure Cloud Shell

Running the command should look something like this:

Azure Token Command

The contents of the output are then added as a secret in GitHub as follows:

Adding Secret

Once the process is complete, your Action secrets should look like this:

Adding Secret

Modify a Component

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!

Clone this wiki locally