0
votes

I have an Azure Batch pool with nodes supporting Docker. That is, the OS offer is MicrosoftWindowsServer WindowsServer 2016-Datacenter-with-Containers.

I create a task as recommended:

private static CloudTask CreateTask(string id, string commandLine)
{
    var autoUserSpec = new AutoUserSpecification(elevationLevel: ElevationLevel.Admin);
    var containerSettings = new TaskContainerSettings(_imageName);
    var task = new CloudTask(id, commandLine)
    {
        UserIdentity = new UserIdentity(autoUserSpec),
        ContainerSettings = containerSettings,
    };

    return task;
}

When the task is run, it completes with the error ContainerPoolNotSupported, The compute node does not support container feature.

This does not make sense. When I connect to the node, I see docker there, the image is preinstalled so I can even run the container right away. The task finishes nearly immediately so likely Azure Batch just notices the container settings and for some reason throws.

Are there any workarounds? Google offers 0 references for the error name.

2

2 Answers

1
votes

Without the context of how you created the pool, this answer is not definitive. But most likely you did not specify the ContainerConfiguration on VirtualMachineConfiguration of the CloudPool object.

Please see this guide for a tutorial on running container workloads on Azure Batch.

0
votes

What helped was to disregard TaskContainerSettings altogether, that is to imitate an ordinary CloudTask yet to have docker run in the task command line:

private static CloudTask CreateTask(string id, string commandLine)
{
    var autoUserSpec = new AutoUserSpecification(elevationLevel: ElevationLevel.Admin);
    var task = new CloudTask(id, $"docker run {_imageName} {commandLine}")
    {
        UserIdentity = new UserIdentity(autoUserSpec),
    };

    return task;
}

So this is truly a workaround until the support of containers becomes more stable in Azure.