Skip to content

Commit 85ec3ab

Browse files
committed
Getting started Documentation, supporting images and adding release-pipelines
1 parent fcb9236 commit 85ec3ab

20 files changed

+93
-64
lines changed

docs/getting_started.md

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,103 @@ We now have 3 pipelines that we would set up
5858
2. Once you are in the right devops project, click Pipelines on the left hand menu and select Builds
5959
3. In the Build Menu, click **New** dropdown and then select **New build pipeline**
6060
![new build pipeline](./images/new-build-pipeline.png)
61-
4. Select Connect and link to your GitHub repository where you cloned this repo.
62-
![build connnect step](./images/buuo)
61+
4. On the Connect option page, select **GitHub**
62+
![build connnect step](./images/build-connect.png)
63+
64+
5. On the Select option page, select the GitHub repository where you forked the code.
65+
![select repo](./images/build-selectrepo.png)
66+
67+
6. Since the repository contains azure-pipelines.yml at the root level, Azure DevOps recognizes it and auto imports it. Click run and this will start the build pipeline.
68+
![select repo](./images/build-createpipeline.png)
69+
70+
7. Your build run would look similar to the following image
71+
![select repo](./images/build-run.png)
72+
73+
Great, you now have the build pipeline setup, you can either manually trigger it or it gets automatically triggered everytime there is a change in the master branch.
6374

6475
### 6. Set up Retraining trigger release pipeline
6576

77+
**Note:** For setting up release pipelines, first download the [release-pipelines](../release-pipelines) to your local filesystem so you can import it.
78+
79+
1. Select the Release tab from the menu on the left, then click the New dropdown on top and click on **Import Release pipeline**
80+
![import release pipeline](./images/release-import.png)
81+
82+
1. On the next screen, navigate to release-pipelines folder and select retrainingtrigger.json pipeline file, click import. You should now see the following screen. Under Stages click on the Retrain stage, where it shows the red error sign.
83+
![release retraining triggger](./images/release-retrainingtrigger.png)
84+
85+
Click on agent job and then from the drop down for Agent Pool on the right side select **Hosted Ubuntu 1604** agent to execute your run and click **Save** button on top right.
86+
![release retraining agent](./images/release-retrainingagent.png)
87+
88+
1. We want the retraining pipeline to be triggered every time build pipeline is complete. To create this dependency, we will link the artifact from build pipeline as a trigger for retraining trigger release pipeline. To do so, click on the pipeline tab and then hit **Add an artifact** option under Artifacts.
89+
![release pipeline view](./images/release-retrainingpipeline.png)
90+
91+
1. This will open up a pop up window, on this screen:
92+
- for source type, select **Build**
93+
- for project, select your project in Azure DevOps that you created in previous steps.
94+
- For Source select the source build pipeline.
95+
- Other fields will get auto populated, you can leave them as it is.
96+
![release retraining artifact](./images/release-retrainingartifact.png)
97+
98+
1. Artifact is now added for retraining trigger pipeline, hit the **save** button on top right and then click **ok**. You now have the retraining trigger pipeline all set up and it will get executed everytime your build pipeline finishes its run. If you want to run this pipeline on a schedule, you can set one by clicking on **Schedule set** in Artifacts section.
99+
![release retraining artifact](./images/release-retrainingartifactsuccess.png)
100+
101+
To view the newly created pipeline, click on the release tab on the left hand side and it will show the retraining trigger pipeline.
66102

67103
### 7. Set up release (Deployment) pipeline
68104

105+
**Note:** For setting up release pipelines, first download the [release-pipelines](../release-pipelines) to your local filesystem so you can import it.
106+
107+
**Also Note:** Before creating this pipeline, make sure that the build pipeline and retraining trigger release pipeline have been executed, as they will be creating resources during their run like docker images that we will deploy as part of this pipeline. So it is important for them to have successful runs before the setup here.
108+
109+
Let's set up the release deployment pipeline now.
110+
1. As done in previous step, Select the Release tab from the menu on the left, then click the New dropdown on top and click on **Import Release pipeline**
111+
![import release pipeline](./images/release-import.png)
112+
113+
1. On the next screen, navigate to release-pipelines folder and select **releasedeployment.json** pipeline file, click import. You should now see the following screen. Under Stages click on the QA environment's **view stage task", where it shows the red error sign.
114+
![release retraining triggger](./images/release-deployment.png)
115+
116+
Click on agent job and then from the drop down for Agent Pool on the right side select **Hosted Ubuntu 1604** agent to execute your run and click **Save** button on top right.
117+
![release retraining agent](./images/release-deploymentqaagent.png)
118+
119+
Follow the same steps for **Prod Environment** and select **Hosted Ubuntu 1604** for agent pool and save the pipeline.
120+
![release retraining agent](./images/release-deploymentprodagent.png)
121+
122+
1. We now need to add artifact that will trigger this pipeline, it gets triggered everytime there is a new image that gets published to Azure container registry (ACR) as part of retraining pipeline. We will also add our build output as artifact since that contains our configuration and code files that we require in this pipeline.
123+
124+
![release retraining agent](./images/release-deploymentacr.png)
125+
126+
Here are the steps to add ACR as an artifact
127+
- Click on pipeline tab to go back to pipeline view and click **Add an artifact**. This will open a pop up window
128+
- For Source type, click on **more artifact types** dropdown and select **Azure Container Registry**
129+
- For service connection, select an existing service connection to Azure, if you don't see anything in the dropdown, click on Manage and create one.
130+
**Note:** You must have sufficient privileges to create a service connection, if not contact your subscription adminstrator.
131+
- For Resource Group, select **DevOps_AzureML_Demo**, this is the default resource group name that we are using and if the previous pipelines executed properly you will see this resource group in the drop down.
132+
- Under Azure container registry dropdown, select the container registry, there should be only one container registry entry.
133+
- For repository, select **diabetes-model-score** repository.
134+
- For Default version, keep it to **latest**
135+
- For Source alias, keep the default generated name.
136+
- Click Add
137+
- Click on lighting sign to enable the **Continous Deployment Trigger**, click Save.
138+
![release retraining artifact](./images/release-deploymentcitrigger.png)
139+
140+
Here are the steps to add build output as artifact
141+
![release retraining artifact](./images/release-retrainingartifact.png)
142+
- Click on pipeline tab to go back to pipeline view and click **Add an artifact**. This will open a pop up window
143+
- For source type, select **Build**
144+
- For project, select your project in Azure DevOps that you created in previous steps.
145+
- For Source, select the source build pipeline.
146+
- Other fields will get auto populated, you can leave them as it is.
147+
148+
149+
1. We now have QA environment continously deployed each time there is a new image available in container registry. You can select pre-deployment conditions for prod environment, normally you don't want it to be auto deployed, so select manual only trigger here.
69150

151+
![release retraining artifact](./images/release-deploymentprodtrigger.png)
70152

71-
### Testing end to end flow
153+
To deploy a release manually, follow the document [here](https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-designer?view=azure-devops&tabs=new-nav#deploy-a-release)
72154

73-
Now you have all the pipelines setup, each time you make a commit to the repository the following should happen automatically for first time
74155

75-
- build pipeline should run tests for you and set up the infrastructure (Azure ML workspace, Azure ML pipeline)
76-
- A new retraining job will be triggered on Azure ML pipelines, you can view this job by going to portal.azure.com > your AML workspace > and then pipelines tab.
77-
- A new docker image will get deployed to Azure container instance and prod deployment to AKS will also be created but won't be triggered.
156+
Congratulations, you now have three pipelines set up end to end.
157+
- Build pipeline: triggered on code change to master branch on GitHub.
158+
- Release Trigger pipeline: triggered on build pipeline execution and produces a new model image if better than previous one.
159+
- Release Deployment pipeline: QA environment is auto triggered when there is a new image.
160+
Prod is manual only and user decides when to release to this environment.

docs/images/build-connect.png

169 KB
Loading
205 KB
Loading

docs/images/build-run.png

216 KB
Loading

docs/images/build-selectrepo.png

92.9 KB
Loading

docs/images/release-deployment.png

165 KB
Loading
263 KB
Loading
203 KB
Loading
211 KB
Loading
212 KB
Loading

0 commit comments

Comments
 (0)