Skip to content

(stepfunctions-tasks): AWS Batch integration with container overrides breaks with token values #19546

@jstag711

Description

@jstag711

What is the problem?

I was eagerly awaiting 1.149 as it appeared to fix the issue that prevents container overrides of memory and cpu:

#18993
#19298

However, now I get the following error:

{
  "resourceType": "batch",
  "resource": "submitJob.sync",
  "error": "Batch.ClientException",
  "cause": "Value -1.888154589709072e+289 for type MEMORY in resourceRequirement is not valid. Provide a valid number as input. (Service: AWSBatch; Status Code: 400; Error Code: ClientException; Request ID: dcd8c27a-baac-414a-9b64-da5733cc1344; Proxy: null)"
}

Reproduction Steps

This is the code that sets up the container overrides

BatchContainerOverrides containerOverrides = BatchContainerOverrides.builder()
                .command(JsonPath.listAt("$." + SOLVER_TASK_PARAMETERS + "." + COMMAND))
                .vcpus(JsonPath.numberAt("$." + SOLVER_TASK_PARAMETERS + "." + CPU))
                .memory(Size.mebibytes(JsonPath.numberAt("$." + SOLVER_TASK_PARAMETERS + "." + MEMORY)))
                .build();

After I updated to 1.149 there is still no resourceRequirements field on BatchContainerOverrides. Based on the fix it appears that these values would just be copied from the top-level vcpus and memory.

Previously I was receiving the warning that my container overrides were being ignored, but the job would still execute.

What did you expect to happen?

I expected that with this update my container overrides would be respected.

What actually happened?

{
  "resourceType": "batch",
  "resource": "submitJob.sync",
  "error": "Batch.ClientException",
  "cause": "Value -1.888154589709072e+289 for type MEMORY in resourceRequirement is not valid. Provide a valid number as input. (Service: AWSBatch; Status Code: 400; Error Code: ClientException; Request ID: dcd8c27a-baac-414a-9b64-da5733cc1344; Proxy: null)"
}

CDK CLI Version

1.149.0

Framework Version

No response

Node.js Version

12.22.11

OS

MacOS 10.15.7

Language

Java

Language Version

Java 11

Other information

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions