Skip to content

Commit c79440a

Browse files
authored
Update how-to-use-batch-endpoint.md
1 parent 3de5587 commit c79440a

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

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

Lines changed: 27 additions & 19 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,7 +269,7 @@ 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
@@ -284,25 +288,30 @@ A deployment is a set of resources required for hosting the model that does the
284288
285289
# [Studio](#tab/azure-studio)
286290
291+
On [Azure ML studio portal](https://ml.azure.com), follow these steps:
292+
287293
1. Navigate to the __Environments__ tab on the side menu.
288294
1. Select the tab __Custom environments__ > __Create__.
289295
1. Enter the name of the environment, in this case `torch-batch-env`.
290296
1. On __Select environment type__ select __Use existing docker image with conda__.
291297
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-
298+
1. On __Customize__ section copy the content of the file `./mnist/environment/conda.yml` included in the repository into the portal.
296299
1. Click on __Next__ and then on __Create__.
297300
1. The environment is ready to be used.
298301
299302
---
303+
304+
The conda file we used looks as follows:
305+
306+
__mnist/environment/conda.yml__
307+
308+
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist/environment/conda.yml":::
300309
301310
> [!WARNING]
302311
> 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.
303312
304313
> [!IMPORTANT]
305-
> Do not forget to include the library `azureml-core` in your deployment as it is required by the executor.
314+
> The packages `azureml-core` and `azureml-dataset-runtime[fuse]` are required by batch deployments and should be included in the environment dependencies.
306315
307316
308317
1. Create a deployment definition
@@ -376,7 +385,9 @@ A deployment is a set of resources required for hosting the model that does the
376385
* `logging_level`- The log verbosity level. Allowed values are `warning`, `info`, `debug`. Default is `info`.
377386
378387
# [Studio](#tab/azure-studio)
379-
388+
389+
On [Azure ML studio portal](https://ml.azure.com), follow these steps:
390+
380391
1. Navigate to the __Endpoints__ tab on the side menu.
381392
1. Select the tab __Batch endpoints__ > __Create__.
382393
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 +712,29 @@ In this example, you will learn how to add a second deployment __that solves the
701712
1. Enter the name of the environment, in this case `keras-batch-env`.
702713
1. On __Select environment type__ select __Use existing docker image with conda__.
703714
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-
715+
1. On __Customize__ section copy the content of the file `./mnist-keras/environment/conda.yml` included in the repository into the portal.
708716
1. Click on __Next__ and then on __Create__.
709717
1. The environment is ready to be used.
710718

711719
---
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.
720+
721+
The conda file used looks as follows:
722+
723+
__mnist-keras/environment/conda.yml__
724+
725+
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/batch/mnist-keras/environment/conda.yml":::
718726

719727
1. Create a scoring script for the model:
720728

721-
__batch_driver.py__
729+
__mnist-keras/code/batch_driver.py__
722730

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

725733
3. Create a deployment definition
726734

727735
# [Azure CLI](#tab/azure-cli)
728736

729-
__mnist-keras-deployment__
737+
__mnist-keras-deployment.yml__
730738

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

0 commit comments

Comments
 (0)