-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[aws-codebuild] Provide the ability to explicitly set BuildEnvironment type #9817
Comments
Hey @jimistry123 , thanks for opening the issue. We had a similar problem recently when CodeBuild introduced a second type of Windows build images. We solved it by adding a new enum that allows you to choose between the two versions - see #9526 for details. Would you consider opening a similar PR for ARM images? Thanks, |
Fixes #18916 Fixes #9817 ### Motivation CDK currently has poor and hidden support for using ARM build images for CodeBuild that do not match what you can do with the Console. Currently, CDK has under LinuxBuildImage two constants not mentioned in the documentation. The constants internally map to a hidden ArmBuildImage class, which provides support for the standard CodeBuild ARM build images. That is the extent of the support, making ARM a second class citizen compared to x86-64 Linux and Windows build images as, for example, you can't use custom aarch64 ECR images. ### Changes This pull request addresses the missing support by: - renaming the previously hidden class ArmBuildImage to LinuxArmBuildImage (in case there are Windows ARM Build Images in the future). - exporting LinuxArmBuildImage so it can be used. - adding the two ARM constants present in LinuxBuildImage also to LinuxArmBuildImage. The constants are also left under LinuxBuildImage to not break backwards compatibility. - adding the method fromEcrRepository() to support custom ARM build images. - making the LinuxArmBuildImage closer to the LinuxBuildImage and WindowsBuildImage (built with props instead of just image name). - updating documentation to show examples of ARM and highlighting the LinuxBuildImage is for x86-64. ### Testing The unit test for ARM image is still valid. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Fixes aws#18916 Fixes aws#9817 ### Motivation CDK currently has poor and hidden support for using ARM build images for CodeBuild that do not match what you can do with the Console. Currently, CDK has under LinuxBuildImage two constants not mentioned in the documentation. The constants internally map to a hidden ArmBuildImage class, which provides support for the standard CodeBuild ARM build images. That is the extent of the support, making ARM a second class citizen compared to x86-64 Linux and Windows build images as, for example, you can't use custom aarch64 ECR images. ### Changes This pull request addresses the missing support by: - renaming the previously hidden class ArmBuildImage to LinuxArmBuildImage (in case there are Windows ARM Build Images in the future). - exporting LinuxArmBuildImage so it can be used. - adding the two ARM constants present in LinuxBuildImage also to LinuxArmBuildImage. The constants are also left under LinuxBuildImage to not break backwards compatibility. - adding the method fromEcrRepository() to support custom ARM build images. - making the LinuxArmBuildImage closer to the LinuxBuildImage and WindowsBuildImage (built with props instead of just image name). - updating documentation to show examples of ARM and highlighting the LinuxBuildImage is for x86-64. ### Testing The unit test for ARM image is still valid. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When building artifacts using ARM architecture, it would be nice to be able to specify the type of the build environment when CodeBuild is not able to directly infer the architecture from the build image. Especially this is the case when using a custom image instead of a default image.
Use Case
I am using a custom Docker image that is built from base ARM image
LinuxBuildImage.AMAZON_LINUX_2_ARM
. And when I create a CodeBuild project using this custom image, it configures theEnvironment.Type
property toLINUX_CONTAINER
instead ofARM_CONTAINER
.Proposed Solution
To workaround this issue, I have to use an escape hatch to modify CloudFormation resource behind
CodeBuildProject
like this:So it would be nice if there was a
type
method in BuildEnvironment.Builder class that allows setting the type toLINUX_CONTAINER
orARM_CONTAINER
.This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: