-
Notifications
You must be signed in to change notification settings - Fork 9
/
1-german-credit-infrastructure.yml
100 lines (91 loc) · 3.84 KB
/
1-german-credit-infrastructure.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
variables:
- template: german-credit-config.yml
trigger: none
pool:
vmImage: ubuntu-20.04
steps:
- task: AzureCLI@2
displayName: 'Install AML CLI, AML Python SDK'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
az extension add -n azure-cli-ml
pip install azureml-core==1.35.0
pip install azure-cli-core==2.22.1 # resolved dependency issue between azure-cli-core and azure cli 2.31
pip install azureml-dataset-runtime==1.35.0
- task: AzureCLI@2
displayName: 'Create Azure ML workspace'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: $(ml_model_path)
inlineScript: |
amlexist=$(az ml workspace show -g $(ml_workspace_rg) -w $(ml_workspace_name))
amlname=$(jq .name -r <<< "$amlexist")
if [[ $amlname = $(ml_workspace_name) ]]; then
echo "AML workspace already exists and does not have to be redeployed"
exit 0
fi
az ml workspace create -g $(ml_workspace_rg) -w $(ml_workspace_name)
- task: AzureCLI@2
displayName: 'Create Data set'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: ''
inlineScript: |
python pipelines/scripts/german-credit-dataset.py $(ml_workspace_name) $(ml_subscription_id) $(ml_workspace_rg)
- task: AzureCLI@2
displayName: 'Create CPU Cluster'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: $(ml_model_path)
inlineScript: |
az ml computetarget create amlcompute -n $(ml_compute_name) --vm-size Standard_DS3_v2 --max-nodes 2 -g $(ml_workspace_rg) -w $(ml_workspace_name)
- task: AzureCLI@2
displayName: 'Create VNET and subnets'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: ''
inlineScript: |
az network vnet create -g $(ml_workspace_rg) -n $(ml_vnet_name) --address-prefix $(ml_vnet_address_range)
az network vnet subnet create -g $(ml_workspace_rg) --vnet-name $(ml_vnet_name) -n aks --address-prefixes $(ml_subnet_aks_address_range)
az network vnet subnet create -g $(ml_workspace_rg) --vnet-name $(ml_vnet_name) -n apim --address-prefixes $(ml_subnet_apim_address_range)
- task: AzureCLI@2
displayName: 'Create Private AKS cluster'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: bash
scriptLocation: inlineScript
workingDirectory: ''
inlineScript: |
aksclusterexist=$(az ml computetarget show -n $(ml_aks_cluster) -g $(ml_workspace_rg) -w $(ml_workspace_name))
aksclustername=$(jq .name -r <<< "$aksclusterexist")
if [[ $aksclustername = $(ml_aks_cluster) ]]; then
echo "AKS cluster name already exists and does not have to be redeployed"
exit 0
fi
python pipelines/scripts/german-credit-aksprivate.py $(ml_workspace_name) $(ml_subscription_id) $(ml_workspace_rg) $(ml_vnet_name) $(ml_aks_cluster) $(ml_vnet_address_range) $(dns_service_ip)
- task: AzurePowerShell@5
displayName: 'Create API management'
inputs:
azureSubscription: $(ml_workspace_connection)
scriptType: filePath
scriptPath: pipelines/scripts/germin-credit-apim.ps1
scriptArguments:
-ml_subscription_id $(ml_subscription_id) `
-ml_workspace_rg $(ml_workspace_rg) `
-ml_vnet_name $(ml_vnet_name) `
-ml_apim_name $(ml_apim_name) `
-ml_apim_email $(ml_apim_email) `
-ml_location $(ml_location)
azurePowerShellVersion: latestVersion
pwsh: true