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] Handle CodeBuild "WINDOWS_SERVER_2019_CONTAINER" environment type for Windows Server 2019 Docker images #9484

Closed
1 of 2 tasks
ermanno opened this issue Aug 6, 2020 · 1 comment · Fixed by #9526
Assignees
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1

Comments

@ermanno
Copy link
Contributor

ermanno commented Aug 6, 2020

The CodeBuild documentation indicates that when using a Windows Server 2019 based Docker image the environment type should be WINDOWS_SERVER_2019_CONTAINER, otherwise when building there will be an error like:

BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: a Windows version 10.0.17763-based image is incompatible with a 10.0.14393 host

Currently BuildEnvironment doesn't support specifying the environment type, and IBuildImage supports only retrieving the environment type, not setting it.

Use Case

CDK users that have Windows Server 2019 based custom images which they retrieve with methods such as WindowsBuildImage.fromDockerRegistry() would end up with CodeBuild failures like the one indicated above, since the environment type would be set to WINDOWS_CONTAINER rather than to WINDOWS_SERVER_2019_CONTAINER.

This is similar to some other issues such as:

  1. LINUX_GPU_CONTAINER environment type: CodeBuild "LINUX_GPU_CONTAINER" environment type #8408
  2. ARM_CONTAINER environment type: fix(codebuild): ARM images have the wrong type and compute kind #5541

Proposed Solution

As in the issues above we could create a new class of IBuildImage.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@ermanno ermanno added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 6, 2020
@ermanno ermanno changed the title Handle CodeBuild "WINDOWS_SERVER_2019_CONTAINER" environment type for Windows Server 2019 Docker images feat(codebuild): Handle CodeBuild "WINDOWS_SERVER_2019_CONTAINER" environment type for Windows Server 2019 Docker images Aug 6, 2020
@SomayaB SomayaB changed the title feat(codebuild): Handle CodeBuild "WINDOWS_SERVER_2019_CONTAINER" environment type for Windows Server 2019 Docker images [codebuild] Handle CodeBuild "WINDOWS_SERVER_2019_CONTAINER" environment type for Windows Server 2019 Docker images Aug 6, 2020
@github-actions github-actions bot added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Aug 6, 2020
@skinny85
Copy link
Contributor

skinny85 commented Aug 6, 2020

@skinny85 skinny85 added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Aug 6, 2020
@mergify mergify bot closed this as completed in #9526 Aug 18, 2020
mergify bot pushed a commit that referenced this issue Aug 18, 2020
…vironment type (#9526)

Windows Server 2019 based images should have environment type
WINDOWS_SERVER_2019_CONTAINER. WindowsBuildImage uses the
WINDOWS_CONTAINER environment type. This patch solves this by adding a
WindowsImageType enum to the options passed the WindowsBuildImage
constructor that is used to correctly populate the type field.

fixes #9484

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
misterjoshua pushed a commit to misterjoshua/aws-cdk that referenced this issue Aug 19, 2020
…vironment type (aws#9526)

Windows Server 2019 based images should have environment type
WINDOWS_SERVER_2019_CONTAINER. WindowsBuildImage uses the
WINDOWS_CONTAINER environment type. This patch solves this by adding a
WindowsImageType enum to the options passed the WindowsBuildImage
constructor that is used to correctly populate the type field.

fixes aws#9484

----

*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
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants