Skip to content

Commit 4529c18

Browse files
authored
Rename pipeline YAMLs for clarity (#212)
* Rename pipeline and pipeline template YAMLs to new convention * Rename references to pipelines and pipeline templates * Sort pipeline entries in code_description.md
1 parent 56eb992 commit 4529c18

16 files changed

+40
-43
lines changed

.pipelines/azdo-abtest-pipeline.yml .pipelines/abtest.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ stages:
6969
IMAGE_LOCATION="$(cat $(Pipeline.Workspace)/image_location/image_location.txt)"
7070
echo "##vso[task.setvariable variable=IMAGE_LOCATION]$IMAGE_LOCATION"
7171
displayName: 'Get Image Location'
72-
- template: azdo-helm-upgrade.yml
72+
- template: helm-upgrade-template.yml
7373
parameters:
7474
chartPath: '$(Pipeline.Workspace)/allcharts/abtest-model'
7575
releaseName: $(blueReleaseName)
@@ -81,7 +81,7 @@ stages:
8181
displayName: 50 50 rollout to blue environment
8282
timeoutInMinutes: 0
8383
steps:
84-
- template: azdo-helm-upgrade.yml
84+
- template: helm-upgrade-template.yml
8585
parameters:
8686
chartPath: '$(System.DefaultWorkingDirectory)/charts/abtest-istio'
8787
releaseName: 'abtest-istio'
@@ -96,7 +96,7 @@ stages:
9696
runOnce:
9797
deploy:
9898
steps:
99-
- template: azdo-helm-upgrade.yml
99+
- template: helm-upgrade-template.yml
100100
parameters:
101101
chartPath: '$(Pipeline.Workspace)/allcharts/abtest-istio'
102102
releaseName: 'abtest-istio'
@@ -113,7 +113,7 @@ stages:
113113
runOnce:
114114
deploy:
115115
steps:
116-
- template: azdo-helm-upgrade.yml
116+
- template: helm-upgrade-template.yml
117117
parameters:
118118
chartPath: '$(Pipeline.Workspace)/allcharts/abtest-istio'
119119
releaseName: 'abtest-istio'
@@ -134,7 +134,7 @@ stages:
134134
IMAGE_LOCATION="$(cat $(Pipeline.Workspace)/image_location/image_location.txt)"
135135
echo "##vso[task.setvariable variable=IMAGE_LOCATION]$IMAGE_LOCATION"
136136
displayName: 'Get Image Location'
137-
- template: azdo-helm-upgrade.yml
137+
- template: helm-upgrade-template.yml
138138
parameters:
139139
chartPath: '$(Pipeline.Workspace)/allcharts/abtest-model'
140140
releaseName: $(greenReleaseName)
@@ -145,7 +145,7 @@ stages:
145145
- job: 'Prod_Rollout_100'
146146
timeoutInMinutes: 0
147147
steps:
148-
- template: azdo-helm-upgrade.yml
148+
- template: helm-upgrade-template.yml
149149
parameters:
150150
chartPath: '$(System.DefaultWorkingDirectory)/charts/abtest-istio'
151151
releaseName: 'abtest-istio'
@@ -157,7 +157,7 @@ stages:
157157
- job: 'blue_disable'
158158
timeoutInMinutes: 0
159159
steps:
160-
- template: azdo-helm-install.yml
160+
- template: helm-install-template.yml
161161
- task: HelmDeploy@0
162162
displayName: 'helm uninstall blue'
163163
inputs:
File renamed without changes.

.pipelines/diabetes_regression-ci-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Builds the container image that is used by other pipelines for scoring.
1+
# Pipeline for building the container image that is used by other pipelines for scoring.
22

33
resources:
44
containers:

.pipelines/diabetes_regression-ci-build-train.yml .pipelines/diabetes_regression-ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trigger:
1818
- ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r_on_dbricks.py
1919

2020
variables:
21-
- template: diabetes_regression-variables.yml
21+
- template: diabetes_regression-variables-template.yml
2222
- group: devopsforai-aml-vg
2323

2424
pool:
@@ -34,7 +34,7 @@ stages:
3434
container: mlops
3535
timeoutInMinutes: 0
3636
steps:
37-
- template: azdo-base-pipeline.yml
37+
- template: code-quality-template.yml
3838
- task: AzureCLI@1
3939
inputs:
4040
azureSubscription: '$(WORKSPACE_SVC_CONNECTION)'
@@ -93,7 +93,7 @@ stages:
9393
container: mlops
9494
timeoutInMinutes: 0
9595
steps:
96-
- template: diabetes_regression-template-get-model-version.yml
96+
- template: diabetes_regression-get-model-version-template.yml
9797

9898
- stage: 'Deploy_ACI'
9999
displayName: 'Deploy to ACI'
@@ -105,7 +105,7 @@ stages:
105105
container: mlops
106106
timeoutInMinutes: 0
107107
steps:
108-
- template: diabetes_regression-template-get-model-version.yml
108+
- template: diabetes_regression-get-model-version-template.yml
109109
- task: ms-air-aiagility.vss-services-azureml.azureml-model-deploy-task.AMLModelDeploy@0
110110
displayName: 'Azure ML Model Deploy'
111111
inputs:
@@ -138,7 +138,7 @@ stages:
138138
container: mlops
139139
timeoutInMinutes: 0
140140
steps:
141-
- template: diabetes_regression-template-get-model-version.yml
141+
- template: diabetes_regression-get-model-version-template.yml
142142
- task: ms-air-aiagility.vss-services-azureml.azureml-model-deploy-task.AMLModelDeploy@0
143143
displayName: 'Azure ML Model Deploy'
144144
inputs:
@@ -172,7 +172,7 @@ stages:
172172
container: mlops
173173
timeoutInMinutes: 0
174174
steps:
175-
- template: diabetes_regression-template-get-model-version.yml
175+
- template: diabetes_regression-get-model-version-template.yml
176176
- task: AzureCLI@1
177177
displayName: 'Create scoring image and set IMAGE_LOCATION variable'
178178
inputs:
File renamed without changes.

.pipelines/azdo-helm-upgrade.yml .pipelines/helm-upgrade-template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
overrideValues: ''
66

77
steps:
8-
- template: azdo-helm-install.yml
8+
- template: helm-install-template.yml
99
- task: HelmDeploy@0
1010
displayName: 'helm upgrade'
1111
inputs:

.pipelines/azdo-pr-build-train.yml .pipelines/pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pool:
1717
container: mlops
1818

1919
variables:
20-
- template: diabetes_regression-variables.yml
20+
- template: diabetes_regression-variables-template.yml
2121
- group: devopsforai-aml-vg
2222

2323
steps:
24-
- template: azdo-base-pipeline.yml
24+
- template: code-quality-template.yml

bootstrap/bootstrap.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def validateargs(self):
9090
def replaceprojectname(project_dir, project_name, rename_name):
9191
# Replace instances of rename_name within files with project_name
9292
dirs = [r".env.example",
93-
r".pipelines/azdo-base-pipeline.yml",
94-
r".pipelines/azdo-pr-build-train.yml",
95-
r".pipelines/diabetes_regression-ci-build-train.yml",
93+
r".pipelines/code-quality-template.yml",
94+
r".pipelines/pr.yml",
95+
r".pipelines/diabetes_regression-ci.yml",
9696
r".pipelines/diabetes_regression-ci-image.yml",
97-
r".pipelines/diabetes_regression-template-get-model-version.yml", # NOQA: E501
98-
r".pipelines/diabetes_regression-variables.yml",
97+
r".pipelines/diabetes_regression-get-model-version-template.yml", # NOQA: E501
98+
r".pipelines/diabetes_regression-variables-template.yml",
9999
r"environment_setup/Dockerfile",
100100
r"environment_setup/install_requirements.sh",
101101
r"ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r_on_dbricks.py", # NOQA: E501

docs/canary_ab_deployment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ There are some extra variables that you need to setup in ***devopsforai-aml-vg**
3030

3131
#### 3. Configure a pipeline to build and deploy a scoring Image
3232

33-
Import and run the [azdo-abtest-pipeline.yml](./.pipelines/azdo-abtest-pipeline.yml) multistage deployment pipeline.
33+
Import and run the [abtest.yml](./.pipelines/abtest.yml) multistage deployment pipeline.
3434

3535
The result of the pipeline will be a registered Docker image in the ACR repository attached to the AML Service:
3636

@@ -46,7 +46,7 @@ model-green 1/1 1 1 19h
4646

4747
#### 4. Build a new Scoring Image
4848

49-
Change value of the ***SCORE_SCRIPT*** variable in the [azdo-abtest-pipeline.yml](./.pipelines/azdo-abtest-pipeline.yml) to point to ***scoring/scoreA.py*** and merge it to the master branch.
49+
Change value of the ***SCORE_SCRIPT*** variable in the [abtest.yml](./.pipelines/abtest.yml) to point to ***scoring/scoreA.py*** and merge it to the master branch.
5050

5151
**Note:** ***scoreA.py*** and ***scoreB.py*** files used in this tutorial are just mockups returning either "New Model A" or "New Model B" respectively. They are used to demonstrate the concept of testing two scoring images with different models or scoring code. In real life you would implement a scoring file similar to [score.py](./../code/scoring/score.py) (see [getting started](./getting_started.md)).
5252

docs/code_description.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ The repository provides a template with folders structure suitable for maintaini
4343

4444
### Pipelines
4545

46-
- `.pipelines/azdo-base-pipeline.yml` : a pipeline template used by ci-build-train pipeline and pr-build-train pipelines. It contains steps performing linting, data and unit testing.
47-
- `.pipelines/diabetes_regression-ci-build-train.yml` : a pipeline triggered when the code is merged into **master**. It performs linting, data integrity testing, unit testing, building and publishing an ML pipeline.
48-
- `.pipelines/azdo-pr-build-train.yml` : a pipeline triggered when a **pull request** to the **master** branch is created. It performs linting, data integrity testing and unit testing only.
49-
- `.pipelines/diabetes_regression-ci-image.yml` : a pipeline building a scoring image for the diabetes regression model.
50-
- `.pipelines/diabetes_regression-template-get-model-version.yml` : a pipeline template used by the `.pipelines/diabetes_regression-ci-build-train.yml` pipeline. It finds out if a new model was registered and retrieves a version of the new model.
51-
- `.pipelines/azdo-abtest-pipeline.yml` : a pipeline demonstrating [Canary deployment strategy](./docs/canary_ab_deployment.md).
52-
- `.pipelines/azdo-helm-*.yml` : pipeline templates used by the `.pipelines/azdo-abtest-pipeline.yml` pipeline.
53-
54-
46+
- `.pipelines/abtest.yml` : a pipeline demonstrating [Canary deployment strategy](./docs/canary_ab_deployment.md).
47+
- `.pipelines/code-quality-template.yml` : a pipeline template used by the CI and PR pipelines. It contains steps performing linting, data and unit testing.
48+
- `.pipelines/diabetes_regression-ci-image.yml` : a pipeline building a scoring image for the diabetes regression model.
49+
- `.pipelines/diabetes_regression-ci.yml` : a pipeline triggered when the code is merged into **master**. It performs linting, data integrity testing, unit testing, building and publishing an ML pipeline.
50+
- `.pipelines/diabetes_regression-get-model-version-template.yml` : a pipeline template used by the `.pipelines/diabetes_regression-ci.yml` pipeline. It finds out if a new model was registered and retrieves a version of the new model.
51+
- `.pipelines/helm-*.yml` : pipeline templates used by the `.pipelines/abtest.yml` pipeline.
52+
- `.pipelines/pr.yml` : a pipeline triggered when a **pull request** to the **master** branch is created. It performs linting, data integrity testing and unit testing only.
5553

5654
### ML Services
5755

@@ -90,4 +88,3 @@ The repository provides a template with folders structure suitable for maintaini
9088
- `diabetes_regression/scoring/score.py` : a scoring script which is about to be packed into a Docker Image along with a model while being deployed to QA/Prod environment.
9189
- `diabetes_regression/scoring/inference_config.yml`, `deployment_config_aci.yml`, `deployment_config_aks.yml` : configuration files for the [AML Model Deploy](https://marketplace.visualstudio.com/items?itemName=ms-air-aiagility.private-vss-services-azureml&ssr=false#overview) pipeline task for ACI and AKS deployment targets.
9290
- `diabetes_regression/scoring/scoreA.py`, `diabetes_regression/scoring/scoreB.py` : simplified scoring files for the [Canary deployment sample](./docs/canary_ab_deployment.md).
93-

docs/custom_container.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ run from that image.
5757

5858
## Modify the model pipeline
5959

60-
Modify the model pipeline file [diabetes_regression-ci-build-train.yml](../.pipelines/diabetes_regression-ci-build-train.yml) by replacing this section:
60+
Modify the model pipeline file [diabetes_regression-ci.yml](../.pipelines/diabetes_regression-ci.yml) by replacing this section:
6161

6262
```
6363
resources:
@@ -94,6 +94,6 @@ A better approach would be to use a distinct name for your modified environment,
9494
By changing the name of the image in your branch in both the container build pipeline
9595
[environment_setup/docker-image-pipeline.yml](../environment_setup/docker-image-pipeline.yml)
9696
and the model pipeline file
97-
[diabetes_regression-ci-build-train.yml](../.pipelines/diabetes_regression-ci-build-train.yml),
97+
[diabetes_regression-ci.yml](../.pipelines/diabetes_regression-ci.yml),
9898
and running both pipelines in sequence on your branch,
9999
you avoid any branch conflicts, and the name does not have to be changed after merging to master.

docs/getting_started.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ the BASE_NAME value should not exceed 10 characters and it should contain number
5858

5959
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.
6060

61-
The **AZURE_RM_SVC_CONNECTION** parameter is used by the [Azure DevOps pipeline]((../environment_setup/iac-create-environment.yml)) that creates the Azure ML workspace and associated resources through Azure Resource Manager. The pipeline requires an **Azure Resource Manager**
61+
The **AZURE_RM_SVC_CONNECTION** parameter is used by the [Azure DevOps pipeline]((../environment_setup/iac-create-environment-pipeline.yml)) that creates the Azure ML workspace and associated resources through Azure Resource Manager. The pipeline requires an **Azure Resource Manager**
6262
[service connection](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#create-a-service-connection).
6363

6464
![create service connection](./images/create-rm-service-connection.png)
@@ -88,7 +88,7 @@ For instructions on how to set up a local development environment, refer to the
8888

8989
### Azure DevOps configuration
9090

91-
For using Azure DevOps Pipelines all other variables are stored in the file `.pipelines/diabetes_regression-variables.yml`. Using the default values as a starting point, adjust the variables to suit your requirements.
91+
For using Azure DevOps Pipelines all other variables are stored in the file `.pipelines/diabetes_regression-variables-template.yml`. Using the default values as a starting point, adjust the variables to suit your requirements.
9292

9393
**Note:** In `diabetes_regression` folder you can find `config.json` file that we would recommend to use in order to provide parameters for training, evaluation and scoring scripts. An example of a such parameter is a hyperparameter of a training algorithm: in our case it's the ridge regression [*alpha* hyperparameter](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html). We don't provide any special serializers for this config file. So, it's up to you which template to support there.
9494

@@ -102,7 +102,7 @@ Up until now you should have:
102102

103103
The easiest way to create all required resources (Resource Group, ML Workspace,
104104
Container Registry, Storage Account, etc.) is to leverage an
105-
"Infrastructure as Code" [pipeline in this repository](../environment_setup/iac-create-environment.yml). This **IaC** pipeline takes care of setting up
105+
"Infrastructure as Code" [pipeline in this repository](../environment_setup/iac-create-environment-pipeline.yml). This **IaC** pipeline takes care of setting up
106106
all required resources based on these [ARM templates](../environment_setup/arm-templates/cloud-environment.json).
107107

108108
### Create a Build IaC Pipeline
@@ -111,7 +111,7 @@ In your Azure DevOps project, create a build pipeline from your forked repositor
111111

112112
![build connnect step](./images/build-connect.png)
113113

114-
Select the **Existing Azure Pipelines YAML file** option and set the path to [/environment_setup/iac-create-environment.yml](../environment_setup/iac-create-environment.yml):
114+
Select the **Existing Azure Pipelines YAML file** option and set the path to [/environment_setup/iac-create-environment-pipeline.yml](../environment_setup/iac-create-environment-pipeline.yml):
115115

116116
![configure step](./images/select-iac-pipeline.png)
117117

@@ -123,7 +123,7 @@ Check out the newly created resources in the [Azure Portal](https://portal.azure
123123

124124
![created resources](./images/created-resources.png)
125125

126-
(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](https://portal.azure.com).
126+
(Optional) To remove the resources created for this project you can use the [/environment_setup/iac-remove-environment-pipeline.yml](../environment_setup/iac-remove-environment-pipeline.yml) definition or you can just delete the resource group in the [Azure Portal](https://portal.azure.com).
127127

128128
**Note:** The training ML pipeline uses a [sample diabetes dataset](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_diabetes.html) as training data. To use your own data, you need to [create a Dataset](https://docs.microsoft.com/azure/machine-learning/how-to-create-register-datasets) in your workspace and specify its name in a DATASET_NAME variable in the ***devopsforai-aml-vg*** variable group. You will also need to modify the test cases in the **ml_service/util/smoke_test_scoring_service.py** script to match the schema of the training features in your dataset.
129129

@@ -157,7 +157,7 @@ performs linting, unit testing and publishes a training pipeline.
157157
### Set up the Pipeline
158158

159159
In your [Azure DevOps](https://dev.azure.com) project create and run a new build
160-
pipeline referring to the [diabetes_regression-ci-build-train.yml](../.pipelines/diabetes_regression-ci-build-train.yml)
160+
pipeline referring to the [diabetes_regression-ci.yml](../.pipelines/diabetes_regression-ci.yml)
161161
pipeline definition in your forked repository:
162162

163163
![configure ci build pipeline](./images/ci-build-pipeline-configure.png)
@@ -199,7 +199,7 @@ Wait until the pipeline finishes and verify that there is a new model in the **M
199199

200200
![trained model](./images/trained-model.png)
201201

202-
To disable the automatic trigger of the training pipeline, change the `auto-trigger-training` variable as listed in the `.pipelines\diabetes_regression-ci-build-train.yml` pipeline to `false`. This can also be overridden at runtime execution of the pipeline.
202+
To disable the automatic trigger of the training pipeline, change the `auto-trigger-training` variable as listed in the `.pipelines\diabetes_regression-ci.yml` pipeline to `false`. This can also be overridden at runtime execution of the pipeline.
203203

204204
To skip model training and registration, and deploy a model successfully registered by a previous build (for testing changes to the score file or inference configuration), add the variable `MODEL_BUILD_ID` when the pipeline is queued, and set the value to the id of the previous build.
205205

0 commit comments

Comments
 (0)