-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
There was a problem hiding this 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?
@wladyslawczyzewski I think it is unnecessary to create integ test for a chore PR🤨 |
can you add an integration test case |
There was a problem hiding this 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.
Pull request has been modified.
I've added integ test. Could you confirm it? |
const dedicatedHost = new ec2.CfnHost(this, 'MyDedicatedHost', { | ||
availabilityZone: az, | ||
instanceType: instanceType.toString(), | ||
}); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
None
Reason for this change
EC2 instance supports
mac2-m1ultra
instance type butInstanceType
class does not support it.Description of changes
Add
MAC2_M1ULTRA
instance typeDescription 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