< Previous Challenge - Home - Next Challenge >
The Build pipeline demonstrates the automation of various stages/tasks involved in building an ML model and creating a container image on top of that model. The stages generally constitute creating a project environment, preparing the data, training the model, evaluating the model, registering/versioning the model, and scoring the model generally by containerizing the model.
There are several ways to create a Build
pipeline. The two most common and popular ways are:
Use whichever approach your team is most comfortable with.
We can setup Continuous Integration (CI) trigger for every Build
pipeline. The CI pipeline gets triggered every time code is checked in. It publishes an updated Azure Machine Learning pipeline after building the code.
Build
pipeline.
Azure Pipelines
.ubuntu-18.04
.Build
pipeline tasks
install_environment.sh
file in environment_setup/
folder. This will install all the python modules required for the project.Workspace.py
in service/code/
folder. This will establish connection to Azure ML workspace by using your workspace details in configuration/config.json
file.AcquireData.py
in service/code/
folder. This will download and extract the data required to train a forecasting model in the next steps.TrainOnLocal.py
in service/code/
folder. This will build a model to forecast demand of items from AdventureWorks database.EvaluateModel.py
in service/code/
folder. This will evaluate how well the model is doing by using evaluation metrics such as R-squared and RMSE(Root mean squared error).RegisterModel.py
in service/code/
folder.CreateScoringImage.py
in service/code/
folder. This will create a scoring file.Release
pipeline. An artifact is the deployable component of your model or application. Build Artifact
is one of the many artifact types. The following two tasks are required to create Build artifact
in your Build
pipeline.
$(Build.SourcesDirectory)
to $(Build.ArtifactStagingDirectory)
.$(Build.ArtifactStagingDirectory)
as path to publish.Build
pipeline.Build
Outputs - confirm that the model and Azure Container Image have been registered in the Azure ML workspace in respective registries.Build
pipeline in Azure DevOps.Bash
task to print all environment variables (which is how predefined variables are passed to your pipeline).
env | sort
Bash
task to print a tree
of the filesystem of your build agent.
find $(Pipeline.Workspace) -print | sed -e "s;[^/]*/;|____;g;s;____|; |;g"
Python 3.6
, there is a task for this)Azure CLI
task to run the Python scripts since they need to interact with the Azure Machine Learning
resource.