3
votes

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

1

1 Answers

2
votes

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"
        }
        ...
    ]