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

chore(ec2): add mac2-m1ultra instance type #30817

Merged
merged 13 commits into from
Aug 14, 2024
Merged

Conversation

badmintoncryer
Copy link
Contributor

Issue # (if applicable)

None

Reason for this change

EC2 instance supports mac2-m1ultra instance type but InstanceType class does not support it.

Description of changes

Add MAC2_M1ULTRA instance type

Description of how you validated changes

None

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 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 labels Jul 10, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team July 10, 2024 10:42
@badmintoncryer badmintoncryer marked this pull request as ready for review July 10, 2024 10:43
@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 Jul 10, 2024
Copy link

@wladyslawczyzewski wladyslawczyzewski left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Am I right to think, that there's no integration tests because of minimum 24h allocation of Mac instance?

@badmintoncryer
Copy link
Contributor Author

@wladyslawczyzewski I think it is unnecessary to create integ test for a chore PR🤨

@moelasmar
Copy link
Contributor

can you add an integration test case

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Putting this into changes requested per @moelasmar's comments.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 31, 2024
@mergify mergify bot dismissed TheRealAmazonKendra’s stale review August 3, 2024 12:29

Pull request has been modified.

@badmintoncryer
Copy link
Contributor Author

@moelasmar

can you add an integration test case

I've added integ test. Could you confirm it?

@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 Aug 5, 2024
packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts Outdated Show resolved Hide resolved
const dedicatedHost = new ec2.CfnHost(this, 'MyDedicatedHost', {
availabilityZone: az,
instanceType: instanceType.toString(),
});
Copy link
Contributor

@tmokmss tmokmss Aug 13, 2024

Choose a reason for hiding this comment

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

Does this integ-test even work? An EC2 Mac dedicated host cannot be deleted until 24 hours after the creation, so I guess integ-runner will fail when it tries to delete the stack.

Mac instances are available only as bare metal instances on Dedicated Hosts, with a minimum allocation period of 24 hours before you can release the Dedicated Host. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-mac-instances.html

Given this restriction, I don't think it's a good idea to add an integration test for EC2 Mac. Even if we set the host's removalPolicy to retain, we have to manually remove the host 24 hours later, which is easily forgotten and not ideal. Also, it costs at least 120USD (5USD/h * 24h for mac2-m1ultra) every time we update the snapshot.

Since CDK currently only provides the enum for EC2 Mac instance type, I think there's little benefit to testing it with the expensive integ test. Any thoughts? @moelasmar @badmintoncryer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tmokmss Thank you for your comment. I completely agree with your opinion. I also feel that the benefits of conducting an integration test in this case are minimal.

Separately, as you mentioned, the integration test is failing. However, since the deployment was successful and the snapshot was generated, I was considering including it in the PR as it is.

I have encountered a similar situation before where a test failed due to resource deletion issues, but it’s good to know that this can be avoided by setting the RemovalPolicy. This is very helpful information.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks @tmokmss, it is a good point. I was thinking that even it is some new enum value, but some how we need a testing coverage, so incase if it got removed by mistake some how, we still have some testing to cover us. So, I think some unit testing is enough. we can add a unit test case for it, and it will be enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Yes I agree that unit test will suffice for that purpose.

Copy link
Contributor

mergify bot commented Aug 14, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Aug 14, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: b0c9a66
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit 537d3b2 into aws:main Aug 14, 2024
12 checks passed
Copy link
Contributor

mergify bot commented Aug 14, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants