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

codebuild: ARM images supports all compute types, incorrect validation #30869

Closed
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild bug This issue is a bug. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@Samrose-Ahmed
Copy link
Contributor

Describe the bug

Theres is an incorrect validation here:

ret.push(`ARM images only support ComputeTypes '${ComputeType.SMALL}' and '${ComputeType.LARGE}' - ` +
that results in error like ARM images only support ComputeTypes 'BUILD_GENERAL1_SMALL' and 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_XLARGE' was given at PipelineProject.renderEnvironment.

ARM images support all compute types, this is probably outdated.

Expected Behavior

Should support all compute types.

Current Behavior

Only supports small and large.

Reproduction Steps

create codebuild arm project with compute type XLARGE

Possible Solution

Just remove this code:

if (buildEnvironment.computeType &&
buildEnvironment.computeType !== ComputeType.SMALL &&
buildEnvironment.computeType !== ComputeType.LARGE) {
ret.push(`ARM images only support ComputeTypes '${ComputeType.SMALL}' and '${ComputeType.LARGE}' - ` +
`'${buildEnvironment.computeType}' was given`);

Additional Information/Context

No response

CDK CLI Version

2.149.0 (build c8e5924)

Framework Version

No response

Node.js Version

18

OS

macos

Language

TypeScript

Language Version

No response

Other information

No response

@Samrose-Ahmed Samrose-Ahmed added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 16, 2024
@github-actions github-actions bot added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Jul 16, 2024
@scanlonp
Copy link
Contributor

Looks like as of last week ARM expanded to medium Xlarge and 2Xlarge compute types! See the table here.

We should remove the validation, thanks for the call out @Samrose-Ahmed!

Side note: it looks like reserved capacity fleets still have ARM compute types limited to small and large. Best to remove this validation to enable use, but something to keep in mind.

@scanlonp scanlonp added good first issue Related to contributions. See CONTRIBUTING.md p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jul 16, 2024
@PeterEckIII
Copy link

I'd like to work on this issue.

I've removed the code from the "Possible Solution" step. I've also removed the comment above it, suggesting the computeType must be ComputeType.SMALL or ComputeType.LARGE.

How should I be handling the TS warning now that the buildEnvironment variable is no longer being utilized in the validate method?

@scanlonp
Copy link
Contributor

@PeterEckIII, looks like that validate function is specific to ARM build images. Since there are now no restrictions on ARM compute types, the validation may not be necessary at all.

@PeterEckIII
Copy link

Thanks @scanlonp, just created #30879 for this. Please let me know of any feedback.

@PeterEckIII
Copy link

@scanlonp, I amended my commit with some changes to test files, but it's still denying my PR due to no integration files being changed. I'm looking for any potentially affected files but am slow moving at the moment. If you know any integration files off the top of your head that I can adjust I will make that change. Otherwise, I'll keep digging. Thanks

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.

1 similar comment
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 29, 2024
xazhao pushed a commit to xazhao/aws-cdk that referenced this issue Sep 12, 2024
…ge and 2X-Large (aws#31214)

### Issue # (if applicable)

Closes aws#30869.

### Reason for this change
Because three new arm-based compute types have become supported due to an update.

Announcement: [AWS CodeBuild now supports three new Arm-based compute types
](https://aws.amazon.com/about-aws/whats-new/2024/08/aws-codebuild-three-arm-based-compute-types/)

### Description of changes
Modify the validate method to allow Medium, X-Large, and 2X-Large as Arm-based compute types.



### Description of how you validated changes
Modify unit tests and integ tests.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.