Skip to content

Commit 6616026

Browse files
authored
fix(batch): make instanceType optional on multinode jobs (#27223)
Make `instanceType` optional. It used to be required. It will default to a batch optimal instance type. The breaking change is for `MultiNodeJobDefinition.instanceType`, which is now optional. This is not truly breaking because everyone has this property explicitly set now, and will continue to have it set after this change. Closes #27185. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent acd0ace commit 6616026

File tree

8 files changed

+156
-92
lines changed

8 files changed

+156
-92
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.multinode-job-definition.js.snapshot/manifest.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.multinode-job-definition.js.snapshot/stack.assets.json

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.multinode-job-definition.js.snapshot/stack.template.json

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
]
7777
},
7878
"Image": "amazon/amazon-ecs-sample",
79-
"InstanceType": "r4.large",
8079
"ReadonlyRootFilesystem": false,
8180
"ResourceRequirements": [
8281
{

packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.multinode-job-definition.js.snapshot/tree.json

+66-66
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.multinode-job-definition.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const app = new App();
88
const stack = new Stack(app, 'stack');
99

1010
new batch.MultiNodeJobDefinition(stack, 'SingleContainerMultiNodeJob', {
11-
instanceType: InstanceType.of(InstanceClass.R4, InstanceSize.LARGE),
1211
containers: [{
1312
startNode: 0,
1413
endNode: 10,

packages/aws-cdk-lib/aws-batch/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ In particular, the environment variable that tells the containers which one is t
556556

557557
```ts
558558
const multiNodeJob = new batch.MultiNodeJobDefinition(this, 'JobDefinition', {
559-
instanceType: ec2.InstanceType.of(ec2.InstanceClass.R4, ec2.InstanceSize.LARGE),
559+
instanceType: ec2.InstanceType.of(ec2.InstanceClass.R4, ec2.InstanceSize.LARGE), // optional, omit to let Batch choose the type for you
560560
containers: [{
561561
container: new batch.EcsEc2ContainerDefinition(this, 'mainMPIContainer', {
562562
image: ecs.ContainerImage.fromRegistry('yourregsitry.com/yourMPIImage:latest'),

0 commit comments

Comments
 (0)