Skip to content

feat(batch): add ECS_AL2023_NVIDIA#36161

Open
Sas-ry wants to merge 5 commits intoaws:mainfrom
Sas-ry:ecs-machineimage-nvidia-al2023
Open

feat(batch): add ECS_AL2023_NVIDIA#36161
Sas-ry wants to merge 5 commits intoaws:mainfrom
Sas-ry:ecs-machineimage-nvidia-al2023

Conversation

@Sas-ry
Copy link
Copy Markdown

@Sas-ry Sas-ry commented Nov 23, 2025

Issue # (if applicable)

#35839

Reason for this change

As explained in #35839, Amazon Linux 2 will reach its end of life (EOL) at the end of June 2026. Therefore, we have added a new option, “ECS_AL2023_NVIDIA,” to enable the specification of Amazon Linux 2023.

Description of changes

This release adds support for ECS_AL2023_NVIDIA to AWS Batch Compute Environment, enabling the execution of GPU workloads on Amazon Linux 2023.

Describe any new or updated permissions being added

N/A - Supports ECS_AL2023_NVIDIA

Description of how you validated changes

Unit tests and integration tests have been updated, and it is now possible to verify that both pass.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Nov 23, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 23, 2025 13:51
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@Sas-ry Sas-ry changed the title feat(batch):add ECS_AL2023_NVIDIA feat(batch): add ECS_AL2023_NVIDIA Nov 23, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 23, 2025 16:53

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 23, 2025
@XaaXaaX
Copy link
Copy Markdown

XaaXaaX commented Nov 25, 2025

@Sas-ry thanks for submitting the PR ;)

hope the contribution team will give it a review soon

this.instanceTypes = props.instanceTypes ?? [];
this.instanceClasses = props.instanceClasses ?? [];
if (this.images?.find(image => image.imageType === EcsMachineImageType.ECS_AL2023) &&
if (this.images?.find(image => image.imageType === EcsMachineImageType.ECS_AL2023 || image.imageType === EcsMachineImageType.ECS_AL2023_NVIDIA) &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if( [ EcsMachineImageType.ECS_AL2023, EcsMachineImageType.ECS_AL2023_NVIDIA ].includes(image.imageType)) ...`

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XaaXaaX
Thanks for your review comment!
I think your suggestion is better than the current code, so I’ve applied it.

@Sas-ry
Copy link
Copy Markdown
Author

Sas-ry commented Jan 2, 2026

Hi maintainers,
Just a gentle ping to see if there’s any feedback I can address.
Happy to make changes if needed. Thanks for your work!

@kumvprat kumvprat self-assigned this Jan 13, 2026
Copy link
Copy Markdown
Contributor

@kumvprat kumvprat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good. I have added a couple of comments on the PR

Will also take a merge from main so that we can take benefit of latest changes in main branch

this.instanceTypes = props.instanceTypes ?? [];
this.instanceClasses = props.instanceClasses ?? [];
if (this.images?.find(image => image.imageType === EcsMachineImageType.ECS_AL2023) &&
if (this.images?.find(image => image.imageType !== undefined &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good but if we can make the checks cleaner it will be helpful in long run to reason about it.

Something like :

if (this.images?.some(image => 
  image.imageType === EcsMachineImageType.ECS_AL2023 || 
  image.imageType === EcsMachineImageType.ECS_AL2023_NVIDIA
) && (
  this.instanceClasses.includes(ec2.InstanceClass.A1) ||
  this.instanceTypes.some(instanceType => 
    instanceType.sameInstanceClassAs(ec2.InstanceType.of(ec2.InstanceClass.A1, ec2.InstanceSize.LARGE))
  )
)) {
  throw new ValidationError('Amazon Linux 2023 does not support A1 instances.', this);
}

imageType: EcsMachineImageType.ECS_AL2023_NVIDIA,
},
],
})).toThrow('Amazon Linux 2023 does not support A1 instances.');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : Can we have a distinct error message so it's easier to debug which machine type cause test failures ? (something like NVIDIA in the message will be helpful)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 13, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results24 ran24 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 13, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates24 ran24 passed
TestResult
No test annotations available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants