|
2 | 2 | title: Container workloads |
3 | 3 | description: Learn how to run and scale apps from container images on Azure Batch. Create a pool of compute nodes that support running container tasks. |
4 | 4 | ms.topic: how-to |
5 | | -ms.date: 09/10/2020 |
| 5 | +ms.date: 10/06/2020 |
6 | 6 | ms.custom: "seodec18, devx-track-csharp" |
7 | 7 | --- |
8 | 8 | # Run container applications on Azure Batch |
9 | 9 |
|
10 | 10 | Azure Batch lets you run and scale large numbers of batch computing jobs on Azure. Batch tasks can run directly on virtual machines (nodes) in a Batch pool, but you can also set up a Batch pool to run tasks in Docker-compatible containers on the nodes. This article shows you how to create a pool of compute nodes that support running container tasks, and then run container tasks on the pool. |
11 | 11 |
|
12 | | -You should be familiar with container concepts and how to create a Batch pool and job. The code examples use the Batch .NET and Python SDKs. You can also use other Batch SDKs and tools, including the Azure portal, to create container-enabled Batch pools and to run container tasks. |
| 12 | +The code examples here use the Batch .NET and Python SDKs. You can also use other Batch SDKs and tools, including the Azure portal, to create container-enabled Batch pools and to run container tasks. |
13 | 13 |
|
14 | 14 | ## Why use containers? |
15 | 15 |
|
16 | 16 | Using containers provides an easy way to run Batch tasks without having to manage an environment and dependencies to run applications. Containers deploy applications as lightweight, portable, self-sufficient units that can run in several different environments. For example, build and test a container locally, then upload the container image to a registry in Azure or elsewhere. The container deployment model ensures that the runtime environment of your application is always correctly installed and configured wherever you host the application. Container-based tasks in Batch can also take advantage of features of non-container tasks, including application packages and management of resource files and output files. |
17 | 17 |
|
18 | 18 | ## Prerequisites |
19 | 19 |
|
| 20 | +You should be familiar with container concepts and how to create a Batch pool and job. |
| 21 | + |
20 | 22 | - **SDK versions**: The Batch SDKs support container images as of the following versions: |
21 | 23 | - Batch REST API version 2017-09-01.6.0 |
22 | 24 | - Batch .NET SDK version 8.0.0 |
@@ -277,6 +279,12 @@ To run a container task on a container-enabled pool, specify container-specific |
277 | 279 |
|
278 | 280 | - If you run tasks on container images, the [cloud task](/dotnet/api/microsoft.azure.batch.cloudtask) and [job manager task](/dotnet/api/microsoft.azure.batch.cloudjob.jobmanagertask) require container settings. However, the [start task](/dotnet/api/microsoft.azure.batch.starttask), [job preparation task](/dotnet/api/microsoft.azure.batch.cloudjob.jobpreparationtask), and [job release task](/dotnet/api/microsoft.azure.batch.cloudjob.jobreleasetask) do not require container settings (that is, they can run within a container context or directly on the node). |
279 | 281 |
|
| 282 | +- For Windows, tasks must be run with [ElevationLevel](/rest/api/batchservice/task/add#elevationlevel) set to `admin`. |
| 283 | + |
| 284 | +- For Linux, Batch will map the user/group permission to the container. If access to any folder within the container requires Administrator permission, you may need to run the task as pool scope with admin elevation level. This will ensure Batch runs the task as root in the container context. Otherwise, a non-admin user may not have access to those folders. |
| 285 | + |
| 286 | +- For container pools with GPU-enabled hardware, Batch will automatically enable GPU for container tasks, so you shouldn't include the `–gpus` argument. |
| 287 | + |
280 | 288 | ### Container task command line |
281 | 289 |
|
282 | 290 | When you run a container task, Batch automatically uses the [docker create](https://docs.docker.com/engine/reference/commandline/create/) command to create a container using the image specified in the task. Batch then controls task execution in the container. |
|
0 commit comments