Skip to content

fix(codebuild): add build image AMAZON_LINUX_2_ARM_2#16931

Merged
mergify[bot] merged 1 commit intoaws:masterfrom
polothy:codebuild-image-arm-fix
Oct 12, 2021
Merged

fix(codebuild): add build image AMAZON_LINUX_2_ARM_2#16931
mergify[bot] merged 1 commit intoaws:masterfrom
polothy:codebuild-image-arm-fix

Conversation

@polothy
Copy link
Copy Markdown
Contributor

@polothy polothy commented Oct 12, 2021

Fixes #16930


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

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Oct 12, 2021

@polothy polothy marked this pull request as draft October 12, 2021 21:18
@polothy
Copy link
Copy Markdown
Contributor Author

polothy commented Oct 12, 2021

I couldn't get very far with this PR because I couldn't get buildup to work:

❯ ../../../scripts/buildup --resume
************************************************************
 buildup usage:
 - execute 'buildup --resume' to resume after failure
 - execute 'buildup' to restart the build from the start

test/test.build.d.ts(1,22): error TS2307: Cannot find module 'nodeunit' or its corresponding type declarations.
test/test.scrutiny.d.ts(1,22): error TS2307: Cannot find module 'nodeunit' or its corresponding type declarations.
Error: /Path/to/aws-cdk/node_modules/typescript/bin/tsc --build exited with error code 1
Build failed.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error: last command failed. fix problem and resume by executing: /Path/to/aws-cdk/scripts/foreach.sh
directory:    /Path/to/aws-cdk/packages/@aws-cdk/cfnspec

So, didn't look at tests (though I'm not seeing anything for these constants) and I was sort of hoping to implement something like LinuxBuildImage.fromCodeBuildImageId but for ARM containers. I'm not sure the best way to do this though, so advice would be welcomed.

Lastly - if it is easier if I just move over and someone else takes over, that is totally OK! Just trying to help out.

@polothy
Copy link
Copy Markdown
Contributor Author

polothy commented Oct 12, 2021

I was sort of hoping to implement something like LinuxBuildImage.fromCodeBuildImageId but for ARM containers. I'm not sure the best way to do this though, so advice would be welcomed.

This can also be in a separate PR so we don't block this. It would be nice to make this available to our developers who are taking advantage of the new ARM support in Lambda and want to build their code using ARM in their pipelines.

Copy link
Copy Markdown
Contributor

@skinny85 skinny85 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 the contribution @polothy! A simple change is needed to make it pass.

public static readonly AMAZON_LINUX_2_3 = LinuxBuildImage.codeBuildImage('aws/codebuild/amazonlinux2-x86_64-standard:3.0');

public static readonly AMAZON_LINUX_2_ARM: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:1.0');
public static readonly AMAZON_LINUX_2_ARM_1: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:1.0');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's get rid of this one, and just keep AMAZON_LINUX_2_ARM.


public static readonly AMAZON_LINUX_2_ARM: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:1.0');
public static readonly AMAZON_LINUX_2_ARM_1: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:1.0');
public static readonly AMAZON_LINUX_2_ARM_2: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:2.0');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You need a comment for this element:

Suggested change
public static readonly AMAZON_LINUX_2_ARM_2: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:2.0');
/** Image "aws/codebuild/amazonlinux2-aarch64-standard:2.0". */
public static readonly AMAZON_LINUX_2_ARM_2: IBuildImage = new ArmBuildImage('aws/codebuild/amazonlinux2-aarch64-standard:2.0');

@skinny85
Copy link
Copy Markdown
Contributor

I couldn't get very far with this PR because I couldn't get buildup to work:

❯ ../../../scripts/buildup --resume
************************************************************
 buildup usage:
 - execute 'buildup --resume' to resume after failure
 - execute 'buildup' to restart the build from the start

test/test.build.d.ts(1,22): error TS2307: Cannot find module 'nodeunit' or its corresponding type declarations.
test/test.scrutiny.d.ts(1,22): error TS2307: Cannot find module 'nodeunit' or its corresponding type declarations.
Error: /Path/to/aws-cdk/node_modules/typescript/bin/tsc --build exited with error code 1
Build failed.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error: last command failed. fix problem and resume by executing: /Path/to/aws-cdk/scripts/foreach.sh
directory:    /Path/to/aws-cdk/packages/@aws-cdk/cfnspec

So, didn't look at tests (though I'm not seeing anything for these constants) and I was sort of hoping to implement something like LinuxBuildImage.fromCodeBuildImageId but for ARM containers. I'm not sure the best way to do this though, so advice would be welcomed.

Lastly - if it is easier if I just move over and someone else takes over, that is totally OK! Just trying to help out.

You probably have some old .js files laying around from our recent test migration away from NodeUnit. Make sure to clean the repo from untracked files (git clean -dfx), and build again.

@skinny85 skinny85 added the pr-linter/exempt-test The PR linter will not require test changes label Oct 12, 2021
@polothy
Copy link
Copy Markdown
Contributor Author

polothy commented Oct 12, 2021

Thanks, making the requested changes!

@polothy polothy force-pushed the codebuild-image-arm-fix branch from dbd03d1 to 63dc4cc Compare October 12, 2021 22:39
@mergify mergify bot dismissed skinny85’s stale review October 12, 2021 22:39

Pull request has been modified.

@polothy polothy marked this pull request as ready for review October 12, 2021 22:40
@polothy
Copy link
Copy Markdown
Contributor Author

polothy commented Oct 12, 2021

You probably have some old .js files laying around from our recent test migration away from NodeUnit. Make sure to clean the repo from untracked files (git clean -dfx), and build again.

Yuuuup, nailed it, thanks!

@polothy
Copy link
Copy Markdown
Contributor Author

polothy commented Oct 12, 2021

OK, got these to run and pass locally:

../../../scripts/buildup
yarn build && yarn test

Copy link
Copy Markdown
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

👍

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 63dc4cc
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit 370cb31 into aws:master Oct 12, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 12, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@polothy polothy deleted the codebuild-image-arm-fix branch October 13, 2021 15:05
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
Fixes aws#16930

----

*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

pr-linter/exempt-test The PR linter will not require test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(codebuild): missing AMAZON_LINUX_2_ARM v2.0

3 participants