-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdeploy-simple-pipeline.yml
64 lines (54 loc) · 1.89 KB
/
deploy-simple-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This DevOps pipeline:
# * deploys the ML training pipeline (similar to the previous exercise)
# Disabled for the sake of this workshop
trigger:
- none
pool:
vmImage: 'ubuntu-20.04'
variables:
resourcegroup: 'aml-mlops-workshop' # replace with your resource group (same as you've used for the Service Connection)
workspace: 'aml-mlops-workshop' # replace with your workspace name (same as you've used for the Service Connection)
aml_compute_target: 'cpu-cluster'
# Azure Resource Manager connection created during pipeline creation
aml_service_connection: 'aml_workspace'
steps:
- task: UsePythonVersion@0
displayName: 'Setting Python version'
inputs:
versionSpec: '3.7'
- task: Bash@3
displayName: 'Install Requirements'
inputs:
filePath: devops-common-files/install_requirements.sh
- task: AzureCLI@2
displayName: 'Install the az ml CLI'
inputs:
azureSubscription: '$(aml_service_connection)'
scriptLocation: inlineScript
scriptType: bash
inlineScript: |
az extension add -n azure-cli-ml
- task: AzureCLI@2
displayName: 'Attach folder to AML workspace (authenticate)'
inputs:
azureSubscription: '$(aml_service_connection)'
scriptLocation: inlineScript
scriptType: bash
inlineScript: |
az ml folder attach -w $(workspace) -g $(resourcegroup)
- task: AzureCLI@2
displayName: 'Create AML Compute Target (will skip if it already exists)'
inputs:
azureSubscription: '$(aml_service_connection)'
scriptLocation: inlineScript
scriptType: bash
inlineScript: |
az ml computetarget create amlcompute -n $(aml_compute_target) --min-nodes 0 --max-nodes 1 -s STANDARD_D3_V2
- task: AzureCLI@2
displayName: 'Deploy pipeline to AML'
inputs:
azureSubscription: '$(aml_service_connection)'
scriptLocation: inlineScript
scriptType: bash
inlineScript: |
python devops-deploy-simple-pipeline/deploy_pipeline.py