How to override the docker image in an AWS Batch job?
Asked Answered
R

1

9

In AWS Batch, I am trying to override the image hardcoded in the job definition at the time of submitting a job. But I dont see any documentation around that.

When I try to add an image field during job submission, I get either:

Parameter validation failed: Unknown parameter in input: "image", must be one of: jobName, jobQueue, arrayProperties, dependsOn, jobDefinition, parameters, containerOverrides, retryStrategy, timeout

or

Parameter validation failed: Unknown parameter in containerOverrides: "image", must be one of: vcpus, memory, command, environment

Richardson answered 28/5, 2019 at 21:43 Comment(0)
P
5

I believe this is not possible.

image is a container property, as this doc shows it alongside command, vcpus, and memory, but many container properties (eg job role arn) are not listed as overrideable in the aws batch submit-job help docs.

Your second error message shows all the container properties that can be overridden, matching the ones from the docs.

--container-overrides (structure)

A list of container overrides in JSON format that specify the nameof a container in the specified job definition and the overrides itshould receive. You can override the default command for a container(that is specified in the job definition or the Docker image) with acommand override. You can also override existing environment variables (that are specified in the job definition or Docker image) ona container or add new environment variables to it with an environment override.

Shorthand Syntax:

vcpus=integer,memory=integer,command=string,string,instanceType=string,environment=[{name=string,value=string},{name=string,value=string}],resourceRequirements=[{value=string,type=string},{value=string,type=string}]

JSON Syntax:

{
    "vcpus": integer,
    "memory": integer,
    "command": ["string", ...],
    "instanceType": "string",
    "environment": [
        {
            "name": "string",
            "value": "string"
        }
        ...
    ],
    "resourceRequirements": [
        {
        "value": "string",
        "type": "GPU"
        }
        ...
    ]
Prothalamium answered 30/1, 2020 at 2:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.