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

fix(codebuild): ARM images have the wrong type and compute kind #5541

Merged
merged 2 commits into from
Dec 31, 2019

Conversation

skinny85
Copy link
Contributor

As it turns out, ARM images require specifying a different type than Linux images. They also only work with ComputeType.LARGE. Add a new, module-private, class of IBuildImage, ArmImage,
that implements that behavior and validation, and change LinuxBuildImage.AMAZON_LINUX_2_ARM to use the new class.

Fixes #5517


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

As it turns out, ARM images require specifying a different type than Linux images.
They also only work with ComputeType.LARGE.
Add a new, module-private, class of IBuildImage, ArmImage,
that implements that behavior and validation,
and change LinuxBuildImage.AMAZON_LINUX_2_ARM to use the new class.

Fixes aws#5517
@skinny85 skinny85 requested a review from rix0rrr December 24, 2019 00:14
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 24, 2019
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

public static readonly AMAZON_LINUX_2 = LinuxBuildImage.codeBuildImage('aws/codebuild/amazonlinux2-x86_64-standard:1.0');
public static readonly AMAZON_LINUX_2_2 = LinuxBuildImage.codeBuildImage('aws/codebuild/amazonlinux2-x86_64-standard:2.0');
public static readonly AMAZON_LINUX_2_ARM = LinuxBuildImage.codeBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:1.0');

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the usage of LinuxBuildImage and ArmBuildImage different? One uses a static method and one uses a constructor... lets normalize.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because we don't want to expose the fact that LinuxBuildImage is the implementation used for methods like LinuxBuildImage.codeBuildImage(), LinuxBuildImage. fromDockerRegistry(), etc. - that's why the constructor of LinuxBuildImage is private. We don't need to do the same for ArmBuildImage, as that entire class is module-private already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good

@skinny85 skinny85 self-assigned this Dec 26, 2019
@mergify
Copy link
Contributor

mergify bot commented Dec 31, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Dec 31, 2019

Thank you for contributing! Your pull request is now being automatically merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't Override BuildEnvironment.type to "ARM_CONTAINER"
3 participants