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(codebuild): update BuildImage classes #29616

Closed
wants to merge 4 commits into from

Conversation

nmussy
Copy link
Contributor

@nmussy nmussy commented Mar 26, 2024

Issue # (if applicable)

None as far as I could tell

Overlaps with #29580

Reason for this change

Align the CodeBuild images listed by the CDK with those offered by the SDK

Description of changes

Description of how you validated changes

Using the codebuild:ListCuratedEnvironmentImages API command, and comparing it to the CDK.

Checklist


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

@nmussy nmussy marked this pull request as draft March 26, 2024 08:35
@nmussy
Copy link
Contributor Author

nmussy commented Mar 26, 2024

Switching to a draft for now, I need to check whether or not WINDOWS_SERVER_2022_CONTAINER is available, the docs aren't super clear about that.

If it is, I'll add an integ test here

@nmussy
Copy link
Contributor Author

nmussy commented Mar 26, 2024

As the Cfn docs assert, WINDOWS_SERVER_2022_CONTAINER is not a valid Environment::Type, sort of.

When attempting to deploy aws/codebuild/windows-base:2022-1.0 with "Type": "WINDOWS_SERVER_2022_CONTAINER", Cfn returns the following error:

Windows Server 2022 not supported for on-demand compute

I've also tried deploying it with the incorrect Type, i.e. WINDOWS_SERVER_2019_CONTAINER:

AWS CodeBuild curated image aws/codebuild/windows-base:2022-1.0 is not supported for projects with environment type WINDOWS_SERVER_2019_CONTAINER and compute type BUILD_GENERAL1_MEDIUM

This matches Working with reserved capacity in AWS CodeBuild:

On-demand fleets do not support Windows Server 2022.

The CDK should be able to be set this up with CfnProject:ProjectFleetProperty, but that's going to be outside the scope of this PR.

I'll open an issue to resolve this later, but in the meantime I'll mark both WindowsBuildImage.WIN_SERVER_CORE_2022_BASE_3_0 and WindowsImageType.SERVER_2022 as @deprecated, explaining the situation. This can easily be updated later on.

@nmussy nmussy mentioned this pull request Mar 26, 2024
2 tasks
@nmussy nmussy marked this pull request as ready for review March 26, 2024 10:23
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@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 Mar 26, 2024
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.

Thanks for adding these. I'm not sure, however, that we should be adding types that we are also immediately marking as deprecated. Can you elaborate on your thinking here?

/**
* The WINDOWS_SERVER_2022_CONTAINER environment type
*
* @deprecated Windows Server 2022 images are not supported for on-demand compute.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should be adding version that we are immediately marking as deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I just want to give the user a warning that they probably won't be able to use the image as is. I thought the @deprecated was a good compromise. I can delete them here and we can add them back with #29617's PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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 Mar 27, 2024
This was referenced Apr 1, 2024
@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED 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.

@nmussy
Copy link
Contributor Author

nmussy commented Apr 18, 2024

Closing in favor of #29754, which will allow an integration test of Windows 2022

@nmussy nmussy closed this Apr 18, 2024
@nmussy nmussy mentioned this pull request Apr 18, 2024
1 task
mergify bot pushed a commit that referenced this pull request Jun 4, 2024
### Issue # (if applicable)

Closes #29617.

### Reason for this change

Implementation of reserved capacity CodeBuild projects 

### Description of changes

* Add Fleet Construct
* Add `EnvironmentType` enum
  * Refactor existing type strings to use the new enum	
* Validate that Windows 2022 build images can only be used in fleet projects

Changes merged from #29616:
* Added missing build images
* Updated JSDoc comments to indicate AL2023 based images, see [docs](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html)
  * It might be a good idea to deprecate and rename `AMAZON_LINUX_2_STANDARD_3_0` to `AMAZON_LINUX_2023_STANDARD_3_0`, despite how the images are named. I'll leave it up to the maintainers
* Added `{@link}` tags where missing

### Description of how you validated changes

Unit and integ tests

The images were retrieved using the [codebuild:ListCuratedEnvironmentImages](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ListCuratedEnvironmentImages.html) API command, and comparing it to the CDK.

### 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*
vdahlberg pushed a commit to vdahlberg/aws-cdk that referenced this pull request Jun 10, 2024
### Issue # (if applicable)

Closes aws#29617.

### Reason for this change

Implementation of reserved capacity CodeBuild projects 

### Description of changes

* Add Fleet Construct
* Add `EnvironmentType` enum
  * Refactor existing type strings to use the new enum	
* Validate that Windows 2022 build images can only be used in fleet projects

Changes merged from aws#29616:
* Added missing build images
* Updated JSDoc comments to indicate AL2023 based images, see [docs](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html)
  * It might be a good idea to deprecate and rename `AMAZON_LINUX_2_STANDARD_3_0` to `AMAZON_LINUX_2023_STANDARD_3_0`, despite how the images are named. I'll leave it up to the maintainers
* Added `{@link}` tags where missing

### Description of how you validated changes

Unit and integ tests

The images were retrieved using the [codebuild:ListCuratedEnvironmentImages](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ListCuratedEnvironmentImages.html) API command, and comparing it to the CDK.

### 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*
Leo10Gama pushed a commit to Leo10Gama/aws-cdk that referenced this pull request Jun 11, 2024
### Issue # (if applicable)

Closes aws#29617.

### Reason for this change

Implementation of reserved capacity CodeBuild projects 

### Description of changes

* Add Fleet Construct
* Add `EnvironmentType` enum
  * Refactor existing type strings to use the new enum	
* Validate that Windows 2022 build images can only be used in fleet projects

Changes merged from aws#29616:
* Added missing build images
* Updated JSDoc comments to indicate AL2023 based images, see [docs](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html)
  * It might be a good idea to deprecate and rename `AMAZON_LINUX_2_STANDARD_3_0` to `AMAZON_LINUX_2023_STANDARD_3_0`, despite how the images are named. I'll leave it up to the maintainers
* Added `{@link}` tags where missing

### Description of how you validated changes

Unit and integ tests

The images were retrieved using the [codebuild:ListCuratedEnvironmentImages](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ListCuratedEnvironmentImages.html) API command, and comparing it to the CDK.

### 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*
mazyu36 pushed a commit to mazyu36/aws-cdk that referenced this pull request Jun 22, 2024
### Issue # (if applicable)

Closes aws#29617.

### Reason for this change

Implementation of reserved capacity CodeBuild projects 

### Description of changes

* Add Fleet Construct
* Add `EnvironmentType` enum
  * Refactor existing type strings to use the new enum	
* Validate that Windows 2022 build images can only be used in fleet projects

Changes merged from aws#29616:
* Added missing build images
* Updated JSDoc comments to indicate AL2023 based images, see [docs](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html)
  * It might be a good idea to deprecate and rename `AMAZON_LINUX_2_STANDARD_3_0` to `AMAZON_LINUX_2023_STANDARD_3_0`, despite how the images are named. I'll leave it up to the maintainers
* Added `{@link}` tags where missing

### Description of how you validated changes

Unit and integ tests

The images were retrieved using the [codebuild:ListCuratedEnvironmentImages](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ListCuratedEnvironmentImages.html) API command, and comparing it to the CDK.

### 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants