1- # Continuous Integration (CI) pipeline that orchestrates the training, evaluation, registration, deployment, and testing of the diabetes_regression model.
1+ # Continuous Integration (CI) pipeline that orchestrates the training, evaluation, and registration of the diabetes_regression model.
22
33resources :
44 containers :
2727stages :
2828- stage : ' Model_CI'
2929 displayName : ' Model CI'
30- condition : not(variables['MODEL_BUILD_ID'])
3130 jobs :
3231 - job : " Model_CI_Pipeline"
3332 displayName : " Model CI Pipeline"
@@ -48,8 +47,8 @@ stages:
4847 displayName : ' Publish Azure Machine Learning Pipeline'
4948
5049- stage : ' Trigger_AML_Pipeline'
51- displayName : ' Train model'
52- condition : and( succeeded(), not(variables['MODEL_BUILD_ID']) )
50+ displayName : ' Train and evaluate model'
51+ condition : succeeded()
5352 variables :
5453 BUILD_URI : ' $(SYSTEM.COLLECTIONURI)$(SYSTEM.TEAMPROJECT)/_build/results?buildId=$(BUILD.BUILDID)'
5554 jobs :
@@ -91,116 +90,8 @@ stages:
9190 - job : " Training_Run_Report"
9291 dependsOn : " Run_ML_Pipeline"
9392 condition : always()
94- displayName : " Determine if evaluation succeeded and new model is registered"
93+ displayName : " Publish artifact if new model was registered"
9594 container : mlops
9695 timeoutInMinutes : 0
9796 steps :
98- - template : diabetes_regression-get-model-version-template.yml
99-
100- - stage : ' Deploy_ACI'
101- displayName : ' Deploy to ACI'
102- dependsOn : Trigger_AML_Pipeline
103- condition : and(or(succeeded(), variables['MODEL_BUILD_ID']), variables['ACI_DEPLOYMENT_NAME'])
104- jobs :
105- - job : " Deploy_ACI"
106- displayName : " Deploy to ACI"
107- container : mlops
108- timeoutInMinutes : 0
109- steps :
110- - template : diabetes_regression-get-model-version-template.yml
111- - task : ms-air-aiagility.vss-services-azureml.azureml-model-deploy-task.AMLModelDeploy@0
112- displayName : ' Azure ML Model Deploy'
113- inputs :
114- azureSubscription : $(WORKSPACE_SVC_CONNECTION)
115- modelSourceType : manualSpec
116- modelName : ' $(MODEL_NAME)'
117- modelVersion : $(MODEL_VERSION)
118- inferencePath : ' $(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/inference_config.yml'
119- deploymentTarget : ACI
120- deploymentName : $(ACI_DEPLOYMENT_NAME)
121- deployConfig : ' $(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/deployment_config_aci.yml'
122- overwriteExistingDeployment : true
123- - task : AzureCLI@1
124- displayName : ' Smoke test'
125- inputs :
126- azureSubscription : ' $(WORKSPACE_SVC_CONNECTION)'
127- scriptLocation : inlineScript
128- inlineScript : |
129- set -e # fail on error
130- export SUBSCRIPTION_ID=$(az account show --query id -o tsv)
131- python -m ml_service.util.smoke_test_scoring_service --type ACI --service "$(ACI_DEPLOYMENT_NAME)"
132-
133- - stage : ' Deploy_AKS'
134- displayName : ' Deploy to AKS'
135- dependsOn : Deploy_ACI
136- condition : and(succeeded(), variables['AKS_DEPLOYMENT_NAME'])
137- jobs :
138- - job : " Deploy_AKS"
139- displayName : " Deploy to AKS"
140- container : mlops
141- timeoutInMinutes : 0
142- steps :
143- - template : diabetes_regression-get-model-version-template.yml
144- - task : ms-air-aiagility.vss-services-azureml.azureml-model-deploy-task.AMLModelDeploy@0
145- displayName : ' Azure ML Model Deploy'
146- inputs :
147- azureSubscription : $(WORKSPACE_SVC_CONNECTION)
148- modelSourceType : manualSpec
149- modelName : ' $(MODEL_NAME)'
150- modelVersion : $(MODEL_VERSION)
151- inferencePath : ' $(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/inference_config.yml'
152- deploymentTarget : AKS
153- aksCluster : $(AKS_COMPUTE_NAME)
154- deploymentName : $(AKS_DEPLOYMENT_NAME)
155- deployConfig : ' $(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/scoring/deployment_config_aks.yml'
156- overwriteExistingDeployment : true
157- - task : AzureCLI@1
158- displayName : ' Smoke test'
159- inputs :
160- azureSubscription : ' $(WORKSPACE_SVC_CONNECTION)'
161- scriptLocation : inlineScript
162- inlineScript : |
163- set -e # fail on error
164- export SUBSCRIPTION_ID=$(az account show --query id -o tsv)
165- python -m ml_service.util.smoke_test_scoring_service --type AKS --service "$(AKS_DEPLOYMENT_NAME)"
166-
167- - stage : ' Deploy_Webapp'
168- displayName : ' Deploy to Webapp'
169- dependsOn : Trigger_AML_Pipeline
170- condition : and(or(succeeded(), variables['MODEL_BUILD_ID']), variables['WEBAPP_DEPLOYMENT_NAME'])
171- jobs :
172- - job : " Deploy_Webapp"
173- displayName : " Deploy to Webapp"
174- container : mlops
175- timeoutInMinutes : 0
176- steps :
177- - template : diabetes_regression-get-model-version-template.yml
178- - task : AzureCLI@1
179- displayName : ' Create scoring image and set IMAGE_LOCATION variable'
180- inputs :
181- azureSubscription : ' $(WORKSPACE_SVC_CONNECTION)'
182- scriptLocation : inlineScript
183- inlineScript : |
184- set -e # fail on error
185- export SUBSCRIPTION_ID=$(az account show --query id -o tsv)
186- python -m ml_service.util.create_scoring_image --output_image_location_file image_location.txt
187- # Output image location to Azure DevOps job
188- IMAGE_LOCATION="$(cat image_location.txt)"
189- echo "##vso[task.setvariable variable=IMAGE_LOCATION]$IMAGE_LOCATION"
190- - task : AzureWebAppContainer@1
191- name : WebAppDeploy
192- displayName : ' Azure Web App on Container Deploy'
193- inputs :
194- azureSubscription : ' $(AZURE_RM_SVC_CONNECTION)'
195- appName : ' $(WEBAPP_DEPLOYMENT_NAME)'
196- resourceGroupName : ' $(RESOURCE_GROUP)'
197- imageName : ' $(IMAGE_LOCATION)'
198- - task : AzureCLI@1
199- displayName : ' Smoke test'
200- inputs :
201- azureSubscription : ' $(WORKSPACE_SVC_CONNECTION)'
202- scriptLocation : inlineScript
203- inlineScript : |
204- set -e # fail on error
205- export SUBSCRIPTION_ID=$(az account show --query id -o tsv)
206- python -m ml_service.util.smoke_test_scoring_service --type Webapp --service "$(WebAppDeploy.AppServiceApplicationUrl)/score"
97+ - template : diabetes_regression-publish-model-artifact-template.yml
0 commit comments