Skip to content

Commit dbfc4b7

Browse files
committed
Edit content
1 parent fbf7004 commit dbfc4b7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

articles/machine-learning/how-to-safely-rollout-online-endpoints.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ You can configure default values to use with the Azure CLI. To avoid passing in
9898

9999
### Clone the examples repository
100100

101-
To follow along with this article, first clone the [examples repository (azureml-examples)](https://github.com/azure/azureml-examples). Then, go to the repository's `cli/` directory:
101+
To follow along with this article, first clone the [examples repository (azureml-examples)](https://github.com/azure/azureml-examples). Then go to the repository's `cli/` directory:
102102

103103
```azurecli
104104
git clone --depth 1 https://github.com/Azure/azureml-examples
@@ -109,16 +109,16 @@ cd cli
109109
> [!TIP]
110110
> Use `--depth 1` to clone only the latest commit to the repository, which reduces the time that's needed to complete the operation.
111111
112-
The commands in this tutorial are in the file `deploy-safe-rollout-online-endpoints.sh` in the `cli` directory, and the YAML configuration files are in the `endpoints/online/managed/sample/` subdirectory.
112+
The commands in this tutorial are in the deploy-safe-rollout-online-endpoints.sh file in the cli directory, and the YAML configuration files are in the endpoints/online/managed/sample/ subdirectory.
113113

114114
> [!NOTE]
115-
> The YAML configuration files for Kubernetes online endpoints are in the `endpoints/online/kubernetes/` subdirectory.
115+
> The YAML configuration files for Kubernetes online endpoints are in the endpoints/online/kubernetes/ subdirectory.
116116
117117
# [Python SDK](#tab/python)
118118

119119
### Clone the examples repository
120120

121-
To run the training examples, first clone the [examples repository (azureml-examples)](https://github.com/azure/azureml-examples). Then, go into the `azureml-examples/sdk/python/endpoints/online/managed` directory:
121+
To run the training examples, first clone the [examples repository (azureml-examples)](https://github.com/azure/azureml-examples). Then go to the azureml-examples/sdk/python/endpoints/online/managed directory:
122122

123123
```bash
124124
git clone --depth 1 https://github.com/Azure/azureml-examples
@@ -128,14 +128,14 @@ cd azureml-examples/sdk/python/endpoints/online/managed
128128
> [!TIP]
129129
> Use `--depth 1` to clone only the latest commit to the repository, which reduces the time that's needed to complete the operation.
130130
131-
The information in this article is based on the [online-endpoints-safe-rollout.ipynb](https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/online/managed/online-endpoints-safe-rollout.ipynb) notebook. This article contains the same content as the notebook, but the order of the code blocks diffs slightly between the two documents.
131+
The information in this article is based on the [online-endpoints-safe-rollout.ipynb](https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/online/managed/online-endpoints-safe-rollout.ipynb) notebook. This article contains the same content as the notebook, but the order of the code blocks differs slightly between the two documents.
132132

133133
> [!NOTE]
134134
> The steps for the Kubernetes online endpoint are based on the [kubernetes-online-endpoints-safe-rollout.ipynb](https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/online/kubernetes/kubernetes-online-endpoints-safe-rollout.ipynb) notebook.
135135
136136
### Connect to an Azure Machine Learning workspace
137137

138-
The [workspace](concept-workspace.md) is the top-level resource for Azure Machine Learning. A workspace provides a centralized place to work with all the artifacts you create when you use Azure Machine Learning. In this section, you connect to your workspace, where you perform deployment tasks. To follow along, open your `online-endpoints-safe-rollout.ipynb` notebook.
138+
The [workspace](concept-workspace.md) is the top-level resource for Azure Machine Learning. A workspace provides a centralized place to work with all the artifacts you create when you use Azure Machine Learning. In this section, you connect to your workspace, where you perform deployment tasks. To follow along, open your online-endpoints-safe-rollout.ipynb notebook.
139139

140140
1. Import the required libraries:
141141

@@ -158,7 +158,7 @@ If you have Git installed on your local machine, you can follow the instructions
158158

159159
### Clone the examples repository
160160

161-
To follow along with this article, clone the [azureml-examples repository](https://github.com/azure/azureml-examples), and then go to the `azureml-examples/cli/endpoints/online/model-1` folder.
161+
To follow along with this article, clone the [azureml-examples repository](https://github.com/azure/azureml-examples), and then go to the azureml-examples/cli/endpoints/online/model-1 folder.
162162

163163
```bash
164164
git clone --depth 1 https://github.com/Azure/azureml-examples
@@ -194,7 +194,7 @@ The following table lists key attributes to specify when you define an endpoint.
194194
| Traffic | Optional | Rules on how to route traffic across deployments. You represent the traffic as a dictionary of key-value pairs, where the key represents the deployment name and the value represents the percentage of traffic to that deployment. You can set the traffic only when the deployments under an endpoint have been created. You can also update the traffic for an online endpoint after the deployments have been created. For more information about how to use mirrored traffic, see [Allocate a small percentage of live traffic to the new deployment](#allocate-a-small-percentage-of-live-traffic-to-the-new-deployment). |
195195
| Mirror traffic | Optional | The percentage of live traffic to mirror to a deployment. For more information about how to use mirrored traffic, see [Test the deployment with mirrored traffic](#test-the-deployment-with-mirrored-traffic). |
196196

197-
To see a full list of attributes that you can specify when you create an endpoint, see [CLI (v2) online endpoint YAML schema](/azure/machine-learning/reference-yaml-endpoint-online) or for version 2 of the Python SDK, see [ManagedOnlineEndpoint Class](/python/api/azure-ai-ml/azure.ai.ml.entities.managedonlineendpoint).
197+
To see a full list of attributes that you can specify when you create an endpoint, see [CLI (v2) online endpoint YAML schema](/azure/machine-learning/reference-yaml-endpoint-online) or for version 2 of the Azure Machine Learning SDK for Python, see [ManagedOnlineEndpoint Class](/python/api/azure-ai-ml/azure.ai.ml.entities.managedonlineendpoint).
198198

199199
### Define a deployment
200200

@@ -217,7 +217,7 @@ To see a full list of attributes that you can specify when you create a deployme
217217

218218
### Create an online endpoint
219219

220-
First set the endpoint name and then configure it. In this article, you use the endpoints/online/managed/sample/endpoint.yml file to configure the endpoint. That file contains the following lines:
220+
You first set the endpoint name and then configure it. In this article, you use the endpoints/online/managed/sample/endpoint.yml file to configure the endpoint. That file contains the following lines:
221221

222222
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/online/managed/sample/endpoint.yml":::
223223

@@ -259,7 +259,7 @@ To use the blue-deployment.yml file to create the `blue` deployment for your end
259259
> [!IMPORTANT]
260260
> The `--all-traffic` flag in the `az ml online-deployment create` command allocates 100 percent of the endpoint traffic to the newly created `blue` deployment.
261261
262-
In the blue-deployment.yaml file, the `path` line specifies where to upload files from. The CLI uses this information to upload the files and register the model and environment. As a best practice for production, you should register the model and environment and specify the registered name and version separately in the YAML code. Use the format `model: azureml:<model-name>:<model-version>` for the model, for example, `model: azureml:my-model:1`. For the environment, use the format `environment: azureml:<environment-name>:<environment-version>`, for example, `environment: azureml:my-env:1`.
262+
In the blue-deployment.yaml file, the `path` line specifies where to upload files from. The Azure Machine Learning CLI uses this information to upload the files and register the model and environment. As a best practice for production, you should register the model and environment and specify the registered name and version separately in the YAML code. Use the format `model: azureml:<model-name>:<model-version>` for the model, for example, `model: azureml:my-model:1`. For the environment, use the format `environment: azureml:<environment-name>:<environment-version>`, for example, `environment: azureml:my-env:1`.
263263

264264
For registration, you can extract the YAML definitions of `model` and `environment` into separate YAML files and use the commands `az ml model create` and `az ml environment create`. To learn more about these commands, run `az ml model create -h` and `az ml environment create -h`.
265265

@@ -290,7 +290,7 @@ To create a deployment for your managed online endpoint, use the `ManagedOnlineD
290290

291291
[!notebook-python[](~/azureml-examples-main/sdk/python/endpoints/online/managed/online-endpoints-safe-rollout.ipynb?name=configure_deployment)]
292292

293-
In this example, the `path` parameter specifies where to upload files from. The SDK uses this information to upload the files and register the model and environment. As a best practice for production, you should register the model and environment and specify the registered name and version separately in the code.
293+
In this example, the `path` parameter specifies where to upload files from. The Python SDK uses this information to upload the files and register the model and environment. As a best practice for production, you should register the model and environment and specify the registered name and version separately in the code.
294294

295295
For more information about registering your model as an asset, see [Register a model by using the Azure CLI or Python SDK](how-to-manage-models.md#register-a-model-by-using-the-azure-cli-or-python-sdk).
296296

@@ -385,7 +385,7 @@ One way to create a managed online endpoint in the studio is from the **Models**
385385
1. Select **Next**.
386386

387387
1. On the **Code and environment for inferencing** page, take the following steps:
388-
1. Under "Select a scoring script for inferencing**, select **Browse**, and then select the \azureml-examples\cli\endpoints\online\model-1\onlinescoring\score.py file from the repo you cloned or downloaded earlier.
388+
1. Under **Select a scoring script for inferencing**, select **Browse**, and then select the \azureml-examples\cli\endpoints\online\model-1\onlinescoring\score.py file from the repo you cloned or downloaded earlier.
389389
1. In the search box above the list of environments, start entering **sklearn**, and then select the **sklearn-1.5:19** curated environment.
390390
1. Select **Next**.
391391

@@ -658,16 +658,16 @@ Even though 0 percent of the traffic goes to the `green` deployment, you can sti
658658

659659
## Test the deployment with mirrored traffic
660660

661-
After you test your `green` deployment, you can *mirror*, or copy, a percentage of the live traffic to it. Traffic mirroring, which is also called shadowing, doesn't change the results returned to clients—100 percent of requests still flow to the `blue` deployment. The mirrored percentage of the traffic is copied and also submitted to the `green` deployment so that you can gather metrics and logging without impacting your clients.
661+
After you test your `green` deployment, you can *mirror* a percentage of the live traffic to your endpoint by copying that percentage of traffic and sending it to the `green` deployment. Traffic mirroring, which is also called shadowing, doesn't change the results returned to clients—100 percent of requests still flow to the `blue` deployment. The mirrored percentage of the traffic is copied and also submitted to the `green` deployment so that you can gather metrics and logging without impacting your clients.
662662

663663
Mirroring is useful when you want to validate a new deployment without impacting clients. For example, you can use mirroring to check whether latency is within acceptable bounds or to check that there are no HTTP errors. Using traffic mirroring, or shadowing, to test a new deployment is also known as [shadow testing](https://microsoft.github.io/code-with-engineering-playbook/automated-testing/shadow-testing/). The deployment that receives the mirrored traffic, in this case, the `green` deployment, can also be called the *shadow deployment*.
664664

665665
Mirroring has the following limitations:
666666

667-
* Mirroring is supported for versions 2.4.0 and later of the Azure Machine Learning CLI and versions 1.0.0 and later of the Azure Machine Learning SDK for Python. If you use an older version of the Azure Machine Learning CLI or the SDK to update an endpoint, you lose the mirror traffic setting.
667+
* Mirroring is supported for versions 2.4.0 and later of the Azure Machine Learning CLI and versions 1.0.0 and later of the Python SDK. If you use an older version of the Azure Machine Learning CLI or the Python SDK to update an endpoint, you lose the mirror traffic setting.
668668
* Mirroring isn't currently supported for Kubernetes online endpoints.
669669
* You can mirror traffic to only one deployment in an endpoint.
670-
* The maximum percentage of traffic you can mirror is 50 percent. This cap limits the effect on your [endpoint bandwidth quota](how-to-manage-quotas.md#azure-machine-learning-online-endpoints-and-batch-endpoints), which has a default value of 5 MBPS. Your endpoint bandwidth is throttled if you exceed the allocated quota. For information about monitoring bandwidth throttling, see [Supported metrics for Microsoft.MachineLearningServices/workspaces/onlineEndpoints](monitor-azure-machine-learning-reference.md#supported-metrics-for-microsoftmachinelearningservicesworkspacesonlineendpoints).
670+
* The maximum percentage of traffic you can mirror is 50 percent. This cap limits the effect on your [endpoint bandwidth quota](how-to-manage-quotas.md#azure-machine-learning-online-endpoints-and-batch-endpoints), which has a default value of 5 MBps. Your endpoint bandwidth is throttled if you exceed the allocated quota. For information about monitoring bandwidth throttling, see [Supported metrics for Microsoft.MachineLearningServices/workspaces/onlineEndpoints](monitor-azure-machine-learning-reference.md#supported-metrics-for-microsoftmachinelearningservicesworkspacesonlineendpoints).
671671

672672
Also note the following behavior:
673673

@@ -696,7 +696,7 @@ done
696696
You can confirm that the specified percentage of the traffic was sent to the `green` deployment by checking the logs from the deployment:
697697

698698
```azurecli
699-
az ml online-deployment get-logs --name blue --endpoint $ENDPOINT_NAME
699+
az ml online-deployment get-logs --name green --endpoint $ENDPOINT_NAME
700700
```
701701

702702
After testing, you can set the mirror traffic to zero to disable mirroring:

0 commit comments

Comments
 (0)