Skip to content

Commit

Permalink
adding scripts for deploying an online endpoint e2e using arm templat…
Browse files Browse the repository at this point in the history
…es with az cli or rest (Azure#954)
  • Loading branch information
karishmadaga committed Jun 9, 2022
1 parent 772fa60 commit 3461642
Show file tree
Hide file tree
Showing 7 changed files with 1,141 additions and 0 deletions.
56 changes: 56 additions & 0 deletions arm-templates/code-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string",
"metadata": {
"description": "Specifies the name of the Azure Machine Learning Workspace which will contain this compute."
}
},
"codeAssetName": {
"type": "string",
"metadata": {
"description": "Specifies the name of the Azure Machine Learning code asset which will be created or updated."
}
},
"codeAssetVersion": {
"defaultValue": "1",
"type": "string",
"metadata": {
"description": "Specifies the version of the Azure Machine Learning code asset which will be created or updated."
}
},
"codeUri": {
"type": "string",
"metadata": {
"description": "Specifies the location of the Azure Machine Learning code asset in a storage account."
}
},
"codeAssetDescription": {
"defaultValue": "This is a test description for a code asset created by an ARM template",
"type": "string"
},
"isAnonymous": {
"defaultValue": false,
"type": "bool",
"metadata": {
"description": "If the name version are system generated (anonymous registration)."
}
}
},
"resources": [
{
"type": "Microsoft.MachineLearningServices/workspaces/codes/versions",
"apiVersion": "2021-10-01",
"name": "[concat(parameters('workspaceName'), '/', parameters('codeAssetName'), '/', parameters('codeAssetVersion'))]",
"properties": {
"description": "[parameters('codeAssetDescription')]",
"codeUri": "[parameters('codeUri')]",
"isAnonymous": "[parameters('isAnonymous')]",
"properties": {},
"tags": {}
}
}
]
}
51 changes: 51 additions & 0 deletions arm-templates/environment-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string"
},
"environmentAssetName": {
"type": "string"
},
"environmentAssetVersion": {
"defaultValue": "1",
"type": "string"
},
"environmentDescription": {
"defaultValue": "This is a test description for an environment created from an ARM template",
"type": "string"
},
"condaFile": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages."
}
},
"isAnonymous": {
"defaultValue": false,
"type": "bool"
},
"dockerImage": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "Docker image path, for example: 'docker.io/tensorflow/serving:latest'."
}
}
},
"resources": [
{
"type": "Microsoft.MachineLearningServices/workspaces/environments/versions",
"apiVersion": "2021-10-01",
"name": "[concat(parameters('workspaceName'), '/', parameters('environmentAssetName'), '/', parameters('environmentAssetVersion'))]",
"properties": {
"isAnonymous": "[parameters('isAnonymous')]",
"description": "[parameters('environmentDescription')]",
"image": "[parameters('dockerImage')]",
"condaFile": "[parameters('condaFile')]"
}
}
]
}
53 changes: 53 additions & 0 deletions arm-templates/model-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string",
"metadata": {
"description": "The name of the Azure Machine Learning Workspace."
}
},
"modelAssetVersion": {
"defaultValue": "1",
"type": "string",
"metadata": {
"description": "The version of the Azure Machine Learning model which will be created or updated."
}
},
"modelAssetName": {
"type": "string",
"metadata": {
"description": "Specifies the name of the Azure Machine Learning model container which will contain this model."
}
},
"modelUri": {
"type": "string"
},
"modelDescription": {
"defaultValue": "This is a test description for a model version created by an ARM template",
"type": "string"
},
"isAnonymous": {
"defaultValue": false,
"type": "bool",
"metadata": {
"description": "If the name version are system generated (anonymous registration)."
}
}
},
"resources": [
{
"type": "Microsoft.MachineLearningServices/workspaces/models/versions",
"apiVersion": "2021-10-01",
"name": "[concat(parameters('workspaceName'), '/', parameters('modelAssetName'), '/', parameters('modelAssetVersion'))]",
"properties": {
"description": "[parameters('modelDescription')]",
"isAnonymous": "[parameters('isAnonymous')]",
"modelUri": "[parameters('modelUri')]",
"properties": {},
"tags": {}
}
}
]
}
107 changes: 107 additions & 0 deletions arm-templates/online-endpoint-deployment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string",
"metadata": {
"description": "Specifies the name of the Azure Machine Learning Workspace which will contain this compute."
}
},
"location": {
"type": "string"
},
"appInsightsEnabled": {
"type": "bool",
"defaultValue": false
},
"onlineEndpointName": {
"type": "string",
"metadata": {
"description": "Specifies the name of the Azure Machine Learning online endpoint which will be deployed."
}
},
"onlineDeploymentName": {
"defaultValue": "blue",
"type": "string",
"metadata": {
"description": "Specifies the name of the Azure Machine Learning online endpoint which will be deployed."
}
},
"onlineEndpointDescription": {
"defaultValue": "This is an online endpoint deployment created by an ARM template",
"type": "string"
},
"onlineDeploymentTags": {
"defaultValue": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"type": "object"
},
"codeId": {
"type": "string"
},
"scoringScript": {
"type": "string",
"defaultValue": "score.py",
"metadata": {
"description": "The script to execute on startup. eg. 'score.py'"
}
},
"environmentId": {
"type": "string"
},
"model": {
"type": "string"
},
"endpointComputeType": {
"type": "string",
"allowedValues": [
"Managed",
"Kubernetes",
"AzureMLCompute"
]
},
"skuName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the SKU. Ex - P3. It is typically a letter+number code"
}
},
"skuCapacity": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."
}
}
},
"resources": [
{
"type": "Microsoft.MachineLearningServices/workspaces/onlineEndpoints/deployments",
"apiVersion": "2021-10-01",
"name": "[concat(parameters('workspaceName'), '/', parameters('onlineEndpointName'),'/', parameters('onlineDeploymentName'))]",
"location": "[parameters('location')]",
"tags": "[parameters('onlineDeploymentTags')]",
"sku": {
"name": "[parameters('skuName')]",
"capacity": "[parameters('skuCapacity')]"
},
"properties": {
"description": "[parameters('onlineEndpointDescription')]",
"codeConfiguration": {
"codeId": "[parameters('codeId')]",
"scoringScript": "[parameters('scoringScript')]"
},
"environmentId": "[parameters('environmentId')]",
"appInsightsEnabled": "[parameters('appInsightsEnabled')]",
"endpointComputeType": "[parameters('endpointComputeType')]",
"model": "[parameters('model')]",
"properties": {}
}
}
]
}
72 changes: 72 additions & 0 deletions arm-templates/online-endpoint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string"
},
"location": {
"type": "string"
},
"onlineEndpointName": {
"type": "string"
},
"onlineEndpointDescription": {
"defaultValue": "This is an online endpoint created by an ARM template",
"type": "string"
},
"identityType": {
"allowedValues": [
"SystemAssigned",
"UserAssigned",
"SystemAssignedUserAssigned",
"None"
],
"type": "string",
"metadata": {
"description": "The MSI Identity that is associated with this resource."
}
},
"allowPublicAccess": {
"defaultValue": true,
"type": "bool",
"metadata": {
"description": "Set to true for endpoints that should allow public access when Private Link is enabled."
}
},
"authMode": {
"defaultValue": "Key",
"allowedValues": [
"AMLToken",
"Key",
"AADToken"
],
"type": "string"
},
"onlineEndpointTags": {
"defaultValue": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"type": "object"
}
},
"resources": [
{
"type": "Microsoft.MachineLearningServices/workspaces/onlineEndpoints",
"apiVersion": "2021-10-01",
"name": "[concat(parameters('workspaceName'), '/', parameters('onlineEndpointName'))]",
"location": "[parameters('location')]",
"tags": "[parameters('onlineEndpointTags')]",
"identity": {
"type": "[parameters('identityType')]"
},
"properties": {
"authMode": "[parameters('authMode')]",
"description": "[parameters('onlineEndpointDescription')]",
"properties": {}
}
}
]
}
Loading

0 comments on commit 3461642

Please sign in to comment.