question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-batch): Most JobDefinition.ContainerProperties.LinuxParameters are not rendered

See original GitHub issue

JobDefinition.buildJobContainer() explicitly only renders devices from container.linuxParams, omitting all other parameters.

The implementation for JobDefinition makes it seem like this is intentional.

Reproduction Steps

new JobDefinition(this, 'jobDef', {
    container: {
        linuxParams: new LinuxParameters(this, 'linuxParams', {
          sharedMemorySize: 24_000,
        }),
        ...
    },
    jobDefinitionName: 'test',
})

What did you expect to happen?

The rendered stack should contain:

          "LinuxParameters": {
            "SharedMemorySize": 24000
          },

What actually happened?

No parameters are rendered:

          "LinuxParameters": {},

Environment

  • CDK CLI Version: 1.89.0
  • Framework Version: 1.89.0
  • Node.js Version: v12.20.2
  • OS : MacOS 11.2.1
  • Language (Version): Typescript 4.1.5

Other

Here’s the relevant code in job-definition.js:

    buildJobContainer(container) {
        if (container === undefined) {
            return undefined;
        }
        return {
            ...
            linuxParameters: container.linuxParams
                ? { devices: container.linuxParams.renderLinuxParameters().devices }
                : undefined,
            ...

This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:33 (25 by maintainers)

github_iconTop GitHub Comments

2reactions
stephnrcommented, Feb 23, 2021

Yep, so I can confirm that I will try switching over to the ECS construct for Linux Params.

However, they are missing some newer params that are now supported (i.e. Swappiness). So I’ll look into adding these along with the change.

2reactions
stephnrcommented, Feb 22, 2021

So - I can see that at the time of creation, this was built to support only devices and no other linux parameters. However, it should be an easy fix to have this extended. I will give it a shot 👌

https://docs.aws.amazon.com/batch/latest/APIReference/API_LinuxParameters.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Batch::JobDefinition LinuxParameters - AWS CloudFormation
You can use this parameter to tune a container's memory swappiness behavior. A swappiness value of 0 causes swapping to not occur unless...
Read more >
awsbatch - Go Packages
AWS Batch is a batch processing tool for efficiently running hundreds of thousands ... If you pass CDK classes or structs, they will...
Read more >
AWS::Batch::JobDefinition ContainerProperties - 亚马逊云科技
Container properties are used for Amazon ECS based job definitions. ... String InstanceType: String JobRoleArn: String LinuxParameters: LinuxParameters ...
Read more >
Registering the job definition - Amazon EC2 Spot Workshops
With AWS Batch multi-node you can run large-scale, tightly coupled, high performance computing applications. Note multi-node jobs are not supported with Spot ...
Read more >
Tag Archives: AWS Batch - Noise
AWS Batch for Amazon EKS is ideal for customers who no longer want to ... This process is repeated, scaling as needed across...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found