-
Notifications
You must be signed in to change notification settings - Fork 10
/
german-credit-train-and-register.yml
57 lines (51 loc) · 1.75 KB
/
german-credit-train-and-register.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
variables:
- template: german-credit-config.yml
trigger: none
pool:
vmImage: ubuntu-20.04
steps:
- task: AzureCLI@2
displayName: 'Install AML CLI'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
az extension add -n azure-cli-ml
- task: AzureCLI@2
displayName: 'Attach to workspace'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: $(ml_model_path)
inlineScript: |
az ml folder attach -g $(ml_workspace_rg) -w $(ml_workspace_name)
- task: AzureCLI@2
displayName: 'Train and explain model'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: $(ml_model_path)
inlineScript: |
az ml run submit-script \
--run-configuration-name config/train-amlcompute \
--target $(ml_compute_name) \
--experiment-name $(ml_experiment_name) \
--output-metadata-file $(Build.ArtifactStagingDirectory)/run.json
- task: AzureCLI@2
displayName: 'Register model'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: $(ml_model_path)
inlineScript: |
az ml model register \
--name $(ml_model_name) \
--asset-path outputs/$(ml_model_filename) \
--run-metadata-file $(Build.ArtifactStagingDirectory)/run.json \
--output-metadata-file $(Build.ArtifactStagingDirectory)/model.json \
--property git-repo-url=$(Build.Repository.Uri) \
--property git-commit-id=$(Build.SourceVersion)