Skip to content

Commit d79338f

Browse files
jotaylodtzar
authored andcommitted
Making clarifications in Getting Started guide (#131)
1 parent 6c2f03f commit d79338f

File tree

1 file changed

+35
-40
lines changed

1 file changed

+35
-40
lines changed

docs/getting_started.md

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# Getting Started with this Repo
22

3-
## Clone or fork this repository
4-
5-
## Create an Azure DevOps account
3+
## Create an Azure DevOps organization
64

75
We use Azure DevOps for running our multi-stage pipeline with build(CI), ML training and scoring service release
8-
(CD) stages. If you don't already have an Azure DevOps account, create one by
6+
(CD) stages. If you don't already have an Azure DevOps organization, create one by
97
following the instructions [here](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops).
108

11-
If you already have Azure DevOps account, create a [new project](https://docs.microsoft.com/en-us/azure/devops/organizations/projects/create-project?view=azure-devops).
9+
If you already have an Azure DevOps organization, create a [new project](https://docs.microsoft.com/en-us/azure/devops/organizations/projects/create-project?view=azure-devops).
10+
11+
## Clone or fork this repository
12+
Fork this repository within GitHub, or clone it into your Azure DevOps project.
1213

1314
## Create an ARM Service Connection to deploy resources
1415

15-
The repository includes a DevOps pipeline to deploy the Azure ML workspace and associated resources through Azure Resource Manager.
16+
This repository includes a YAML pipeline definition file for an Azure DevOps pipeline that will create the Azure ML workspace and associated resources through Azure Resource Manager.
1617

1718
The pipeline requires an **Azure Resource Manager**
1819
[service connection](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#create-a-service-connection).
@@ -32,7 +33,7 @@ permissions on the subscription.
3233

3334
## Create a Variable Group for your Pipeline
3435

35-
We make use of variable group inside Azure DevOps to store variables and their
36+
We make use of a variable group inside Azure DevOps to store variables and their
3637
values that we want to make available across multiple pipelines or pipeline stages. You can either
3738
store the values directly in [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=designer#create-a-variable-group)
3839
or connect to an Azure Key Vault in your subscription. Please refer to the
@@ -43,55 +44,56 @@ Click on **Library** in the **Pipelines** section as indicated below:
4344

4445
![library_variable groups](./images/library_variable_groups.png)
4546

46-
Please name your variable group **``devopsforai-aml-vg``** as we are using this
47-
name within our build yaml file.
47+
Create a variable group named **``devopsforai-aml-vg``**. The YAML pipeline definitions in this repository refer to this variable group by name.
4848

4949
The variable group should contain the following required variables:
5050

5151
| Variable Name | Suggested Value |
5252
| --------------------------- | -----------------------------------|
5353
| BASE_NAME | [unique base name] |
5454
| LOCATION | centralus |
55-
| RESOURCE_GROUP | |
55+
| RESOURCE_GROUP | mlops-RG |
5656
| WORKSPACE_NAME | mlops-AML-WS |
5757
| WORKSPACE_SVC_CONNECTION | aml-workspace-connection |
5858
| ACI_DEPLOYMENT_NAME | diabetes-aci |
5959

6060
**Note:**
6161

62-
The **WORKSPACE_NAME** parameter is used for the Azure Machine Learning Workspace creation. You can provide here an existing AML Workspace if you have one.
62+
The **WORKSPACE_NAME** parameter is used for the Azure Machine Learning Workspace creation. You can provide an existing AML Workspace here if you have one.
6363

6464
The **BASE_NAME** parameter is used throughout the solution for naming
6565
Azure resources. When the solution is used in a shared subscription, there can
6666
be naming collisions with resources that require unique names like azure blob
6767
storage and registry DNS naming. Make sure to give a unique value to the
6868
BASE_NAME variable (e.g. MyUniqueML), so that the created resources will have
69-
unique names (e.g. MyUniqueML-AML-RG, MyUniqueML-AML-KV, etc.). The length of
69+
unique names (e.g. MyUniqueMLamlcr, MyUniqueML-AML-KV, etc.). The length of
7070
the BASE_NAME value should not exceed 10 characters.
7171

72+
The **RESOURCE_GROUP** parameter is used as the name for the resource group that will hold the Azure resources for the solution. If providing an existing AML Workspace, set this value to the corresponding resource group name.
73+
7274
Make sure to select the **Allow access to all pipelines** checkbox in the
7375
variable group configuration.
7476

7577
## More variable options
7678

77-
There are more variables used in the project. They're defined in two places one for local execution one for using Azure DevOps Pipelines
79+
There are more variables used in the project. They're defined in two places, one for local execution and one for using Azure DevOps Pipelines.
7880

7981
### Local configuration
8082

81-
In order to configure the project locally you have to create a copy from `.env.example` to the root and name it `.env`. Fill out all missing values and adjust the existing ones to your needs.
83+
In order to configure the project locally, create a copy of `.env.example` in the root directory and name it `.env`. Fill out all missing values and adjust the existing ones to suit your requirements.
8284

83-
For local development, you will also need to [install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). Azure CLI will be used to log you in interactively.
85+
For local development, you will also need to [install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). The Azure CLI will be used to log you in interactively.
8486
Please be aware that the local environment also needs access to the Azure subscription so you have to have Contributor access on the Azure ML Workspace.
8587

8688
### Azure DevOps configuration
8789

88-
For using Azure DevOps Pipelines all other variables are stored in the file `.pipelines/azdo-variables.yml`. Adjust as needed the variables, also the defaults will give you an easy jump start.
90+
For using Azure DevOps Pipelines all other variables are stored in the file `.pipelines/azdo-variables.yml`. Using the default values as a starting point, adjust the variables to suit your requirements.
8991

9092
Up until now you should have:
9193

9294
* Forked (or cloned) the repo
93-
* Created a devops account or use an existing one
94-
* A variable group with all configuration values
95+
* Configured an Azure DevOps project with a service connection to Azure Resource Manager
96+
* Set up a variable group with all configuration values
9597

9698
## Create Resources with Azure Pipelines
9799

@@ -100,32 +102,25 @@ Container Registry, Storage Account, etc.) is to leverage an
100102
"Infrastructure as Code" [pipeline in this repository](../environment_setup/iac-create-environment.yml). This **IaC** pipeline takes care of setting up
101103
all required resources based on these [ARM templates](../environment_setup/arm-templates/cloud-environment.json).
102104

103-
To set up this pipeline, you will need to do the following steps:
104-
105-
1. Create an Azure Resource Manager Service Connection
106-
1. Create a Build IaC Pipeline
107-
108105
### Create a Build IaC Pipeline
109106

110-
In your DevOps project, create a build pipeline from your forked **GitHub**
111-
repository:
107+
In your Azure DevOps project, create a build pipeline from your forked repository:
112108

113109
![build connnect step](./images/build-connect.png)
114110

115-
Then, refer to an **Existing Azure Pipelines YAML file**:
111+
Select the **Existing Azure Pipelines YAML file** option and set the path to [/environment_setup/iac-create-environment.yml](../environment_setup/iac-remove-environment.yml):
116112

117113
![configure step](./images/select-iac-pipeline.png)
118114

119115
Having done that, run the pipeline:
120116

121117
![iac run](./images/run-iac-pipeline.png)
122118

123-
Check out created resources in the [Azure Portal](portal.azure.com):
119+
Check out the newly created resources in the [Azure Portal](portal.azure.com):
124120

125121
![created resources](./images/created-resources.png)
126122

127-
Alternatively, you can also use a [cleaning pipeline](../environment_setup/iac-remove-environment.yml) that removes resources created for this project or
128-
you can just delete a resource group in the [Azure Portal](portal.azure.com).
123+
(Optional) To remove the resources created for this project you can use the [/environment_setup/iac-remove-environment.yml](../environment_setup/iac-remove-environment.yml) definition or you can just delete the resource group in the [Azure Portal](portal.azure.com).
129124

130125
## Create an Azure DevOps Azure ML Workspace Service Connection
131126
Install the **Azure Machine Learning** extension to your organization from the
@@ -147,7 +142,7 @@ you can set up the pipeline necessary for deploying your ML model
147142
to production. The pipeline has a sequence of stages for:
148143

149144
1. **Model Code Continuous Integration:** triggered on code change to master branch on GitHub,
150-
performs linting, unit testing, publishing a training pipeline, and runs the published training pipeline to train, evaluate, and register a model.
145+
performs linting, unit testing, publishes a training pipeline, and runs the published training pipeline to train, evaluate, and register a model.
151146
1. **Train Model**: invokes the Azure ML service to trigger model training.
152147
1. **Release Deployment:** deploys a model to QA (ACI) and Prod (AKS)
153148
environments, or alternatively to Azure App Service.
@@ -156,37 +151,37 @@ environments, or alternatively to Azure App Service.
156151

157152
In your [Azure DevOps](https://dev.azure.com) project create and run a new build
158153
pipeline referring to the [azdo-ci-build-train.yml](../.pipelines/azdo-ci-build-train.yml)
159-
pipeline in your forked **GitHub** repository:
154+
pipeline definition in your forked repository:
160155

161156
![configure ci build pipeline](./images/ci-build-pipeline-configure.png)
162157

163158
Once the pipeline is finished, explore the execution result:
164159

165160
![build](./images/multi-stage-aci.png)
166161

167-
and checkout a published training pipeline in the **mlops-AML-WS** workspace in
162+
and check out the published training pipeline in the **mlops-AML-WS** workspace in
168163
[Azure Portal](https://ms.portal.azure.com/):
169164

170165
![training pipeline](./images/training-pipeline.png)
171166

172167
Great, you now have the build pipeline set up which automatically triggers every time there's a change in the master branch.
173168

174-
* The first stage of the pipeline, **Model CI**, perform linting, unit testing, build and publishes an **ML Training Pipeline** in a **ML Workspace**.
169+
* The first stage of the pipeline, **Model CI**, performs linting, unit testing, build and publishes an **ML Training Pipeline** in an **ML Workspace**.
175170

176171
**Note:** The build pipeline also supports building and publishing ML
177172
pipelines using R to train a model. This is enabled
178-
by changing the `build-train-script` pipeline variable to either `build_train_pipeline_with_r.py`, or `build_train_pipeline_with_r_on_dbricks.py`. For the pipeline training a model with R on Databricks you have
173+
by changing the `build-train-script` pipeline variable to either `build_train_pipeline_with_r.py`, or `build_train_pipeline_with_r_on_dbricks.py`. For pipeline training a model with R on Databricks you'll need
179174
to manually create a Databricks cluster and attach it to the ML Workspace as a
180175
compute (Values DB_CLUSTER_ID and DATABRICKS_COMPUTE_NAME variables should be
181176
specified).
182177

183-
* The second stage of the pipeline, **Train model**, triggers the run of the ML Training Pipeline. The training pipeline will train, evaluate, and register a new model. The actual computation is performed in an [Azure Machine Learning Compute cluster](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute). In Azure DevOps, this stage runs an agentless job that waits for the completion of the Azure ML job, so it can wait for training completion for hours or even days without using agent resources.
178+
* The second stage of the pipeline, **Train model**, triggers the run of the ML Training Pipeline. The training pipeline will train, evaluate, and register a new model. The actual computation is performed in an [Azure Machine Learning Compute cluster](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute). In Azure DevOps, this stage runs an agentless job that waits for the completion of the Azure ML job, allowing the pipeline to wait for training completion for hours or even days without using agent resources.
184179

185180
**Note:** If the model evaluation determines that the new model does not perform better than the previous one then the new model will not be registered and the pipeline will be cancelled.
186181

187182
* The third stage of the pipeline, **Deploy to ACI**, deploys the model to the QA environment in [Azure Container Instances](https://azure.microsoft.com/en-us/services/container-instances/). It then runs a *smoke test* to validate the deployment, i.e. sends a sample query to the scoring web service and verifies that it returns a response in the expected format.
188183

189-
Wait until the pipeline finished and make sure there is a new model in the **ML Workspace**:
184+
Wait until the pipeline finishes and verify that there is a new model in the **ML Workspace**:
190185

191186
![trained model](./images/trained-model.png)
192187

@@ -197,11 +192,11 @@ To disable the automatic trigger of the training pipeline, change the `auto-trig
197192
The final stage is to deploy the model to the production environment running on
198193
[Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service).
199194

200-
**Note:** Creating of a Kubernetes cluster on AKS is out of scope of this
201-
tutorial, but you can find set up information in the docs
195+
**Note:** Creating a Kubernetes cluster on AKS is out of scope of this
196+
tutorial, but you can find set up information
202197
[here](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal#create-an-aks-cluster).
203198

204-
**Note:** If your target deployment environment is a K8s cluster and you want to implement Canary and/or A/B testing deployemnt strategies check out this [tutorial](./canary_ab_deployment.md).
199+
**Note:** If your target deployment environment is a K8s cluster and you want to implement Canary and/or A/B testing deployment strategies check out this [tutorial](./canary_ab_deployment.md).
205200

206201
In the Variables tab, edit your variable group (`devopsforai-aml-vg`). In the variable group definition, add the following variables:
207202

@@ -265,4 +260,4 @@ Make sure your webapp has the credentials to pull the image from the Azure Conta
265260
| project-away id1
266261

267262
* **Distributed tracing**: The smoke test client code sets an HTTP `traceparent` header (per the [W3C Trace Context proposed specification](https://www.w3.org/TR/trace-context-1)), and the `score.py` code logs this header. The query above shows how to surface this value. You can adapt this to your tracing framework.
268-
* **Monitoring**: You can use [Azure Monitor for containers](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-overview) to monitor the Azure ML scoring containers' performance, just as for any other container.
263+
* **Monitoring**: You can use [Azure Monitor for containers](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-overview) to monitor the Azure ML scoring containers' performance, just as for any other container.

0 commit comments

Comments
 (0)