Skip to content

Commit f025b11

Browse files
committed
merged from upgrade
2 parents b327ac4 + e22f243 commit f025b11

File tree

6 files changed

+227
-16
lines changed

6 files changed

+227
-16
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
pool:
22
vmImage: 'Ubuntu 16.04'
3-
#Your build pipeline references a secret variable named ‘sp_username’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972
4-
#Your build pipeline references a secret variable named ‘sp_password’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972
5-
#Your build pipeline references a secret variable named ‘sp_tenantid’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972
6-
#Your build pipeline references a secret variable named ‘subscription_id’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972
3+
4+
container:
5+
image: mlopscr.azurecr.io/public/mlops/mlopspython:latest
6+
endpoint: acrconnection
77

88
variables:
99
- group: AzureKeyVaultSecrets
@@ -14,18 +14,6 @@ trigger:
1414
- develop
1515

1616
steps:
17-
- task: UsePythonVersion@0
18-
inputs:
19-
versionSpec: '3.6'
20-
architecture: 'x64'
21-
22-
- task: Bash@3
23-
displayName: 'Install Requirements'
24-
inputs:
25-
targetType: filePath
26-
filePath: 'environment_setup/install_requirements.sh'
27-
workingDirectory: 'environment_setup'
28-
2917
- script: |
3018
az login --service-principal -u $(spidentity) -p $(spsecret) --tenant $(sptenant)
3119

environment_setup/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM conda/miniconda3
2+
3+
LABEL org.label-schema.vendor = "Microsoft" \
4+
org.label-schema.url = "https://hub.docker.com/r/microsoft/mlopspython" \
5+
org.label-schema.vcs-url = "https://github.com/microsoft/MLOpsPython"
6+
7+
8+
9+
COPY environment_setup/requirements.txt /setup/
10+
11+
RUN apt-get update && apt-get install gcc -y && pip install --upgrade -r /setup/requirements.txt
12+
13+
CMD ["python"]
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"baseName": {
6+
"type": "string",
7+
"maxLength": 10,
8+
"minLength": 3,
9+
"metadata": {
10+
"description": "The base name to use as prefix to create all the resources."
11+
}
12+
},
13+
"location": {
14+
"type": "string",
15+
"defaultValue": "eastus",
16+
"allowedValues": [
17+
"eastus",
18+
"eastus2",
19+
"southcentralus",
20+
"southeastasia",
21+
"westcentralus",
22+
"westeurope",
23+
"westus2"
24+
],
25+
"metadata": {
26+
"description": "Specifies the location for all resources."
27+
}
28+
}
29+
},
30+
"variables": {
31+
"amlWorkspaceName": "[concat(parameters('baseName'),'-AML-WS')]",
32+
"storageAccountName": "[concat(toLower(parameters('baseName')), 'amlsa')]",
33+
"storageAccountType": "Standard_LRS",
34+
"keyVaultName": "[concat(parameters('baseName'),'-AML-KV')]",
35+
"tenantId": "[subscription().tenantId]",
36+
"applicationInsightsName": "[concat(parameters('baseName'),'-AML-AI')]",
37+
"containerRegistryName": "[concat(toLower(parameters('baseName')),'amlcr')]"
38+
},
39+
"resources": [
40+
{
41+
"type": "Microsoft.Storage/storageAccounts",
42+
"apiVersion": "2018-07-01",
43+
"name": "[variables('storageAccountName')]",
44+
"location": "[parameters('location')]",
45+
"sku": {
46+
"name": "[variables('storageAccountType')]"
47+
},
48+
"kind": "StorageV2",
49+
"properties": {
50+
"encryption": {
51+
"services": {
52+
"blob": {
53+
"enabled": true
54+
},
55+
"file": {
56+
"enabled": true
57+
}
58+
},
59+
"keySource": "Microsoft.Storage"
60+
},
61+
"supportsHttpsTrafficOnly": true
62+
}
63+
},
64+
{
65+
"type": "Microsoft.KeyVault/vaults",
66+
"apiVersion": "2018-02-14",
67+
"name": "[variables('keyVaultName')]",
68+
"location": "[parameters('location')]",
69+
"properties": {
70+
"tenantId": "[variables('tenantId')]",
71+
"sku": {
72+
"name": "standard",
73+
"family": "A"
74+
},
75+
"accessPolicies": []
76+
}
77+
},
78+
{
79+
"type": "Microsoft.Insights/components",
80+
"apiVersion": "2015-05-01",
81+
"name": "[variables('applicationInsightsName')]",
82+
"location": "[if(or(equals(parameters('location'),'eastus2'),equals(parameters('location'),'westcentralus')),'southcentralus',parameters('location'))]",
83+
"kind": "web",
84+
"properties": {
85+
"Application_Type": "web"
86+
}
87+
},
88+
{
89+
"type": "Microsoft.ContainerRegistry/registries",
90+
"apiVersion": "2017-10-01",
91+
"name": "[variables('containerRegistryName')]",
92+
"location": "[parameters('location')]",
93+
"sku": {
94+
"name": "Standard"
95+
},
96+
"properties": {
97+
"adminUserEnabled": true
98+
}
99+
},
100+
{
101+
"type": "Microsoft.MachineLearningServices/workspaces",
102+
"apiVersion": "2018-11-19",
103+
"name": "[variables('amlWorkspaceName')]",
104+
"location": "[parameters('location')]",
105+
"dependsOn": [
106+
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
107+
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]",
108+
"[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]",
109+
"[resourceId('Microsoft.ContainerRegistry/registries', variables('containerRegistryName'))]"
110+
],
111+
"identity": {
112+
"type": "systemAssigned"
113+
},
114+
"properties": {
115+
"friendlyName": "[variables('amlWorkspaceName')]",
116+
"keyVault": "[resourceId('Microsoft.KeyVault/vaults',variables('keyVaultName'))]",
117+
"applicationInsights": "[resourceId('Microsoft.Insights/components',variables('applicationInsightsName'))]",
118+
"containerRegistry": "[resourceId('Microsoft.ContainerRegistry/registries',variables('containerRegistryName'))]",
119+
"storageAccount": "[resourceId('Microsoft.Storage/storageAccounts/',variables('storageAccountName'))]"
120+
}
121+
}
122+
]
123+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
resources:
2+
- repo: self
3+
4+
queue:
5+
name: Hosted Ubuntu 1604
6+
7+
trigger:
8+
branches:
9+
include:
10+
- master
11+
12+
paths:
13+
include:
14+
- environment_setup/*
15+
16+
variables:
17+
containerRegistry: $[coalesce(variables['acrServiceConnection'], 'acrconnection')]
18+
imageName: $[coalesce(variables['agentImageName'], 'public/mlops/mlopspython')]
19+
20+
steps:
21+
- task: Docker@2
22+
displayName: Build and Push
23+
inputs:
24+
command: buildAndPush
25+
containerRegistry: '$(containerRegistry)'
26+
repository: '$(imageName)'
27+
tags: 'latest'
28+
buildContext: '$(Build.SourcesDirectory)'
29+
dockerFile: '$(Build.SourcesDirectory)/environment_setup/Dockerfile'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
trigger:
2+
branches:
3+
include:
4+
- master
5+
paths:
6+
include:
7+
- environment_setup/arm-templates/*
8+
9+
pool:
10+
vmImage: 'ubuntu-latest'
11+
12+
variables:
13+
baseName: $[coalesce(variables['baseNameOverride'], 'mlops')]
14+
location: $[coalesce(variables['locationOverride'], 'centralus')]
15+
azuresub: $[coalesce(variables['azuresubOverride'], 'davete02_sub')]
16+
17+
18+
steps:
19+
- task: AzureResourceGroupDeployment@2
20+
inputs:
21+
azureSubscription: $(azuresub)
22+
action: 'Create Or Update Resource Group'
23+
resourceGroupName: '$(baseName)-AML-RG'
24+
location: $(location)
25+
templateLocation: 'Linked artifact'
26+
csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/cloud-environment.json'
27+
overrideParameters: '-baseName $(baseName)'
28+
deploymentMode: 'Incremental'
29+
displayName: 'Deploy MLOps resources to Azure'
30+
31+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
trigger:
2+
branches:
3+
include:
4+
- master
5+
paths:
6+
include:
7+
- environment_setup/arm-templates/*
8+
9+
pool:
10+
vmImage: 'ubuntu-latest'
11+
12+
variables:
13+
baseName: $[coalesce(variables['baseNameOverride'], 'mlops')]
14+
location: $[coalesce(variables['locationOverride'], 'centralus')]
15+
azuresub: $[coalesce(variables['azuresubOverride'], 'davete02_sub')]
16+
17+
18+
steps:
19+
- task: AzureResourceGroupDeployment@2
20+
inputs:
21+
azureSubscription: $(azuresub)
22+
action: 'DeleteRG'
23+
resourceGroupName: '$(baseName)-AML-RG'
24+
location: $(location)
25+
displayName: 'Delete resources in Azure'
26+
27+

0 commit comments

Comments
 (0)