You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/service/how-to-deploy-and-where.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.topic: conceptual
9
9
ms.author: jordane
10
10
author: jpe316
11
11
ms.reviewer: larryfr
12
-
ms.date: 05/21/2019
12
+
ms.date: 05/31/2019
13
13
14
14
ms.custom: seoapril2019
15
15
---
@@ -277,7 +277,7 @@ To see quota and region availability for ACI, see the [Quotas and region availab
277
277
278
278
For more information, see the reference documentation for the [AciWebservice](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.aciwebservice?view=azure-ml-py) and [Webservice](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.webservice?view=azure-ml-py) classes.
279
279
280
-
### <aid="aks"></a>Azure Kubernetes Service (PRODUCTION)
280
+
### <aid="aks"></a>Azure Kubernetes Service (DEVTEST & PRODUCTION)
281
281
282
282
You can use an existing AKS cluster or create a new one using the Azure Machine Learning SDK, CLI, or the Azure portal.
283
283
@@ -289,6 +289,7 @@ If you already have an AKS cluster attached, you can deploy to it. If you haven'
289
289
290
290
```python
291
291
aks_target = AksCompute(ws,"myaks")
292
+
# If deploying to a cluster configured for dev/test, we recommend setting cpu_cores = 2.
service = Model.deploy(ws, "aksservice", [model], inference_config, deployment_config, aks_target)
294
295
service.wait_for_deployment(show_output=True)
@@ -311,16 +312,21 @@ Learn more about AKS deployment and autoscale in the [AksWebservice.deploy_confi
311
312
#### Create a new AKS cluster<aid="create-attach-aks"></a>
312
313
**Time estimate:** Approximately 5 minutes.
313
314
315
+
Creating or attaching an AKS cluster is a one time process for your workspace. You can reuse this cluster for multiple deployments. If you delete the cluster or the resource group that contains it, you must create a new cluster the next time you need to deploy. You can have multiple AKS clusters attached to your workspace.
316
+
317
+
If you want to create an AKS cluster for development, validation, and testing, you set `cluster_purpose = AksCompute.ClusterPurpose.DEV_TEST` when using [`provisioning_configuration()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.compute.akscompute?view=azure-ml-py). A cluster created with this setting will only have one node.
318
+
314
319
> [!IMPORTANT]
315
-
> Creating or attaching an AKS cluster is a one time process for your workspace. You can reuse this cluster for multiple deployments. If you delete the cluster or the resource group that contains it, you must create a new cluster the next time you need to deploy.
320
+
> Setting `cluster_purpose = AksCompute.ClusterPurpose.DEV_TEST` creates an AKS cluster that is not suitable for handling production traffic, and may increase inference times for the deployed model. When deploying a model to a devtest cluster, Microsoft recommends configuring 2 cores.
316
321
317
-
For more information on setting `autoscale_target_utilization`, `autoscale_max_replicas`, and `autoscale_min_replicas`, see the [AksWebservice.deploy_configuration](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.akswebservice?view=azure-ml-py#deploy-configuration-autoscale-enabled-none--autoscale-min-replicas-none--autoscale-max-replicas-none--autoscale-refresh-seconds-none--autoscale-target-utilization-none--collect-model-data-none--auth-enabled-none--cpu-cores-none--memory-gb-none--enable-app-insights-none--scoring-timeout-ms-none--replica-max-concurrent-requests-none--max-request-wait-time-none--num-replicas-none--primary-key-none--secondary-key-none--tags-none--properties-none--description-none-) reference.
318
322
The following example demonstrates how to create a new Azure Kubernetes Service cluster:
319
323
320
324
```python
321
325
from azureml.core.compute import AksCompute, ComputeTarget
322
326
323
-
# Use the default configuration (you can also provide parameters to customize this)
327
+
# Use the default configuration (you can also provide parameters to customize this).
@@ -337,23 +343,34 @@ For more information on creating an AKS cluster outside of the Azure Machine Lea
337
343
*[Create an AKS cluster](https://docs.microsoft.com/cli/azure/aks?toc=%2Fazure%2Faks%2FTOC.json&bc=%2Fazure%2Fbread%2Ftoc.json&view=azure-cli-latest#az-aks-create)
338
344
*[Create an AKS cluster (portal)](https://docs.microsoft.com/azure/aks/kubernetes-walkthrough-portal?view=azure-cli-latest)
339
345
340
-
341
346
> [!IMPORTANT]
342
347
> For [`provisioning_configuration()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.compute.akscompute?view=azure-ml-py), if you pick custom values for agent_count and vm_size, then you need to make sure agent_count multiplied by vm_size is greater than or equal to 12 virtual CPUs. For example, if you use a vm_size of "Standard_D3_v2", which has 4 virtual CPUs, then you should pick an agent_count of 3 or greater.
343
348
344
349
**Time estimate**: Approximately 20 minutes.
345
350
346
351
#### Attach an existing AKS cluster
347
352
348
-
If you already have AKS cluster in your Azure subscription, and it is version 1.12.## and has at least 12 virtual CPUs, you can use it to deploy your image. The following code demonstrates how to attach an existing AKS 1.12.## cluster to your workspace:
353
+
If you already have AKS cluster in your Azure subscription, and it is version 1.12.##, you can use it to deploy your image.
354
+
355
+
> [!WARNING]
356
+
> When attaching an AKS cluster to a workspace, you can define how you will use the cluster by setting the `cluster_purpose` parameter.
357
+
>
358
+
> If you do not set the `cluster_purpose` parameter, or set `cluster_purpose = AksCompute.ClusterPurpose.FAST_PROD`, then the cluster must have at least 12 virtual CPUs available.
359
+
>
360
+
> If you set `cluster_purpose = AksCompute.ClusterPurpose.DEV_TEST`, then the cluster does not need to have 12 virtual CPUs. However a cluster that is configured for dev/test will not be suitable for production level traffic and may increase inference times.
361
+
362
+
The following code demonstrates how to attach an existing AKS 1.12.## cluster to your workspace:
349
363
350
364
```python
351
365
from azureml.core.compute import AksCompute, ComputeTarget
352
366
# Set the resource group that contains the AKS cluster and the cluster name
353
367
resource_group ='myresourcegroup'
354
368
cluster_name ='mycluster'
355
369
356
-
# Attach the cluster to your workgroup
370
+
# Attach the cluster to your workgroup. If the cluster has less than 12 virtual CPUs, use the following instead:
0 commit comments