forked from MicrosoftDocs/pipelines-azureml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
59 lines (49 loc) · 1.79 KB
/
azure-pipelines.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
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
variables:
- group: ml
steps:
- task: AzureCLI@1
displayName: 'Install the CLI'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az extension add -n azure-cli-ml'
- task: AzureCLI@1
displayName: 'Attach folder to workspace'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az ml folder attach -w ml_workspace_test -g ml_test_rg'
- task: AzureCLI@1
displayName: 'Create compute for training'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az ml computetarget create amlcompute -n cpu --vm-size STANDARD_D2_V2 --max-nodes 4 -w ml_workspace_test -g ml_test_rg'
- task: AzureCLI@1
displayName: 'Submit script run'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az ml run submit-script -c sklearn -e test -d myenv.yml train.py'
- task: AzureCLI@1
displayName: 'Register model'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az ml model register -n mymodel -p sklearn_regression_model.pkl -t model.json -w ml_workspace_test -g ml_test_rg'
- task: AzureCLI@1
displayName: 'Deploy model'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az ml model deploy -n acicicd -f model.json --ic inferenceConfig.yml --dc deploymentConfig.yml --overwrite -w ml_workspace_test -g ml_test_rg'
- task: AzureCLI@1
displayName: 'Delete deployed service'
inputs:
azureSubscription: $(azureSubscription)
scriptLocation: inlineScript
inlineScript: 'az ml service delete -n acicicd -w ml_workspace_test -g ml_test_rg'