Skip to content

Commit c4156c9

Browse files
Merge pull request #220303 from santiagxf/santiagxf/azureml-batch-quality
Update how-to-use-batch-endpoint.md
2 parents 3de5587 + 8aa13da commit c4156c9

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

articles/machine-learning/how-to-use-batch-endpoint.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ A batch endpoint is an HTTPS endpoint that clients can call to trigger a batch s
192192
# [Azure CLI](#tab/azure-cli)
193193
194194
The following YAML file defines a batch endpoint, which you can include in the CLI command for [batch endpoint creation](#create-a-batch-endpoint). In the repository, this file is located at `/cli/endpoints/batch/batch-endpoint.yml`.
195+
196+
__mnist-endpoint.yml__
195197
196198
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist-endpoint.yml":::
197199
@@ -254,6 +256,8 @@ Batch deployments require a scoring script that indicates how the given model sh
254256
> [!TIP]
255257
> For more information about how to write scoring scripts and best practices for it please see [Author scoring scripts for batch deployments](how-to-batch-scoring-script.md).
256258
259+
__mnist/code/batch_driver.py__
260+
257261
:::code language="python" source="~/azureml-examples-main/sdk/python/endpoints/batch/mnist/code/batch_driver.py" :::
258262
259263
## Create a batch deployment
@@ -265,11 +269,13 @@ A deployment is a set of resources required for hosting the model that does the
265269
* The environment in which the model runs.
266270
* The pre-created compute and resource settings.
267271
268-
1. Create an environment where your batch deployment will run. Include in the environment any dependency your code requires for running. You will also need to add the library `azureml-core` as it is required for batch deployments to work.
272+
1. Create an environment where your batch deployment will run. Include in the environment any dependency your code requires for running. In this case, the dependencies have been captured in a `conda.yml`.
269273
270274
# [Azure CLI](#tab/azure-cli)
271275
272-
*No extra step is required for the Azure ML CLI. The environment definition will be included in the deployment file as an anonymous environment.*
276+
The environment definition will be included in the deployment definition itself as an anonymous environment. You will see in the following lines in the deployment:
277+
278+
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist-torch-deployment.yml" range="10-12":::
273279
274280
# [Python](#tab/python)
275281
@@ -284,25 +290,30 @@ A deployment is a set of resources required for hosting the model that does the
284290
285291
# [Studio](#tab/azure-studio)
286292
293+
On [Azure ML studio portal](https://ml.azure.com), follow these steps:
294+
287295
1. Navigate to the __Environments__ tab on the side menu.
288296
1. Select the tab __Custom environments__ > __Create__.
289297
1. Enter the name of the environment, in this case `torch-batch-env`.
290298
1. On __Select environment type__ select __Use existing docker image with conda__.
291299
1. On __Container registry image path__, enter `mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04`.
292-
1. On __Customize__ section copy the content of the file `./mnist/environment/conda.yml` included in the repository into the portal. The conda file looks as follows:
293-
294-
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist/environment/conda.yml":::
295-
300+
1. On __Customize__ section copy the content of the file `./mnist/environment/conda.yml` included in the repository into the portal.
296301
1. Click on __Next__ and then on __Create__.
297302
1. The environment is ready to be used.
298303
299304
---
305+
306+
The conda file we used looks as follows:
307+
308+
__mnist/environment/conda.yml__
309+
310+
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist/environment/conda.yml":::
300311
301312
> [!WARNING]
302313
> Curated environments are not supported in batch deployments. You will need to indicate your own environment. You can always use the base image of a curated environment as yours to simplify the process.
303314
304315
> [!IMPORTANT]
305-
> Do not forget to include the library `azureml-core` in your deployment as it is required by the executor.
316+
> The packages `azureml-core` and `azureml-dataset-runtime[fuse]` are required by batch deployments and should be included in the environment dependencies.
306317
307318
308319
1. Create a deployment definition
@@ -376,7 +387,9 @@ A deployment is a set of resources required for hosting the model that does the
376387
* `logging_level`- The log verbosity level. Allowed values are `warning`, `info`, `debug`. Default is `info`.
377388
378389
# [Studio](#tab/azure-studio)
379-
390+
391+
On [Azure ML studio portal](https://ml.azure.com), follow these steps:
392+
380393
1. Navigate to the __Endpoints__ tab on the side menu.
381394
1. Select the tab __Batch endpoints__ > __Create__.
382395
1. Give the endpoint a name, in this case `mnist-batch`. You can configure the rest of the fields or leave them blank.
@@ -701,32 +714,29 @@ In this example, you will learn how to add a second deployment __that solves the
701714
1. Enter the name of the environment, in this case `keras-batch-env`.
702715
1. On __Select environment type__ select __Use existing docker image with conda__.
703716
1. On __Container registry image path__, enter `mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04`.
704-
1. On __Customize__ section copy the content of the file `./mnist-keras/environment/conda.yml` included in the repository into the portal. The conda file looks as follows:
705-
706-
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist-keras/environment/conda.yml":::
707-
717+
1. On __Customize__ section copy the content of the file `./mnist-keras/environment/conda.yml` included in the repository into the portal.
708718
1. Click on __Next__ and then on __Create__.
709719
1. The environment is ready to be used.
710720

711721
---
712-
713-
> [!WARNING]
714-
> Curated environments are not supported in batch deployments. You will need to indicate your own environment. You can always use the base image of a curated environment as yours to simplify the process.
715-
716-
> [!IMPORTANT]
717-
> Do not forget to include the library `azureml-core` in your deployment as it is required by the executor.
722+
723+
The conda file used looks as follows:
724+
725+
__mnist-keras/environment/conda.yml__
726+
727+
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist-keras/environment/conda.yml":::
718728

719729
1. Create a scoring script for the model:
720730

721-
__batch_driver.py__
731+
__mnist-keras/code/batch_driver.py__
722732

723733
:::code language="python" source="~/azureml-examples-main/sdk/python/endpoints/batch/mnist-keras/code/batch_driver.py" :::
724734

725735
3. Create a deployment definition
726736

727737
# [Azure CLI](#tab/azure-cli)
728738

729-
__mnist-keras-deployment__
739+
__mnist-keras-deployment.yml__
730740

731741
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist-keras-deployment.yml":::
732742

0 commit comments

Comments
 (0)