Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs): enable Kernel 5.10 support on Amazon Linux 2 #29809

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

Konosh93
Copy link
Contributor

@Konosh93 Konosh93 commented Apr 12, 2024

Issue

#29800

Reason for this change

Allow using recommended kernel version instead of 4.14 which is marked as EOL Jan 2024, by opting in for the new kernel.

We recommend that you use an AMI with Linux kernel 5.10 because Linux kernel 4.14 reached end-of-life on January 10, 2024.

Description of changes

  • Deprecate the existing amazonLinux2 in favor of a new amazonLinux2WithKernel510.

Description of how you validated changes

Unit and integration tests.

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 p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Apr 12, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team April 12, 2024 02:33
Copy link
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.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation dismissed their stale review April 12, 2024 02:58

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

Copy link
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.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation dismissed their stale review April 12, 2024 04:40

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

@Konosh93 Konosh93 changed the title fix(ecs): set kernel-5.10 for EcsOptimizedImage SSM parameter fix(ecs): Specify AL2 kernel for EcsOptimizedImage SSM parameter Apr 12, 2024
Copy link
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.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@Konosh93 Konosh93 changed the title fix(ecs): Specify AL2 kernel for EcsOptimizedImage SSM parameter fix(ecs): specify AL2 kernel for EcsOptimizedImage SSM parameter Apr 12, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 12, 2024 05:29

✅ 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 Apr 12, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍
I left some suggestions for adjustments.
Also, does the recommended here refer to the kernel version? 🤔
If so, we should remove it when kernel is specified.

packages/aws-cdk-lib/aws-ecs/lib/amis.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/amis.ts Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Apr 14, 2024
@Konosh93
Copy link
Contributor Author

Konosh93 commented Apr 15, 2024

Also, does the recommended here refer to the kernel version? 🤔

I am not sure what recommended refers to, but since it precedes image_id, I thought it might be related to hardware type.

Both of the following commands return a valid AMI from SSM

aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2/kernel-5.10/gpu/recommended/image_id

and

aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2/kernel-5.10/recommended/image_id

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍
Left some comments for further adjustments, feel free to comment on those.

packages/aws-cdk-lib/aws-ecs/lib/amis.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/amis.ts Outdated Show resolved Hide resolved
@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

Copy link
Contributor

mergify bot commented Apr 20, 2024

update

✅ Branch has been successfully updated

@Konosh93
Copy link
Contributor Author

@Mergifyio update

Copy link
Contributor

mergify bot commented May 12, 2024

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/github-merit-badger.yml without workflows permission

@Konosh93
Copy link
Contributor Author

@TheRealAmazonKendra Can we go ahead and merge this change, or is it missing something?

@Konosh93
Copy link
Contributor Author

Konosh93 commented Jun 13, 2024

@TheRealAmazonKendra Do you have any other suggestions to add to this PR?

*
* @default none, uses the recommended kernel version
*/
readonly kernel?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

As @TheRealAmazonKendra said, this is a deprecated interface, so we shouldn't be adding a new property to this...except, there's a note that says remove @deprecated above in V2. @rix0rrr I'm thinking we should un-deprecate this property, WDYT?

This should not be a string value, it should be an enum. We should not force users to call the .toString() on the enum, they should just pass it directly.

The enum provides type discoverability; if the kernel property is only a string type, there's nothing the IDE can do to tell you that you should really be passing the result of a toString() call. Instead, with the enum, it tells you what type is expected, so the user discovers what they need to pass much more easily.

@mergify mergify bot dismissed comcalvi’s stale review June 18, 2024 02:57

Pull request has been modified.

Comment on lines +100 to +106
/**
* Kernel version used.
* Only supported for Amazon Linux 2.
*
* @default none, uses the recommended kernel version
*/
readonly kernel?: ec2.AmazonLinux2Kernel;
Copy link
Contributor

@comcalvi comcalvi Jun 18, 2024

Choose a reason for hiding this comment

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

Discussed offline, this should not be undeprecated...sorry about that, I was wrong. This entire props should be deprecated and replaced with the linked EcsOptimizedImage instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@comcalvi I replied to your comment here. Can you have a look?

This entire props should be deprecated and replaced with the linked EcsOptimizedImage instead.

EcsOptimizedImage is a class and its private constructor is still using the deprecated EcsOptimizedAmiProps. There are no other Props interfaces for EcsOptimizedImage constructor.

Is it time to remove @deprecated already?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we deprecated the props and decided to create a bunch of factory methods that take an Options instead of props. I think your original solution was actually correct; leave these as deprecated (since they should be marked internal, and if we remove the deprecation we'll never remember to fix this) and just add the new property.

@TheRealAmazonKendra is correct about this, in principle, since a deprecated marker implies that these props have been directly replaced by something else. That is not what is going on here. Instead, these props are supposed to be hidden away behind a set of factory methods. So, even if we had not missed these when we did v2, the optimal would still be what you've done here; add kernel to these props.

Sorry for the churn on this one, please leave the @deprecated and add the new property to those deprecated props.

@mergify mergify bot dismissed comcalvi’s stale review June 18, 2024 23:46

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 043d106
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the BUILD FAILING state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants