Search code examples
azurebatch-processingazure-batch

Limit node resources given to an Azure Batch job or task


Is there a way to limit the amount of resources given to a task execution in Azure Batch? The pool I set up is configured with a ContainerConfiguration (python SDK) and the tasks have TaskContainerSettings set. I don't see a way to limit the resources given to the task anywhere. I'd like to limit things like CPU cores and RAM given based off the image the task is going run.

Is it something that can be set in the container_run_options?


Solution

  • Yes you can set options for docker create in that property (https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.batch.taskcontainersettings.containerrunoptions?view=azure-dotnet#Microsoft_Azure_Batch_TaskContainerSettings_ContainerRunOptions). Please see https://docs.docker.com/engine/reference/commandline/create/ for valid options for docker create.