feat(lambda): docker platform for architecture#16858
Merged
mergify[bot] merged 8 commits intoaws:masterfrom Oct 11, 2021
Merged
feat(lambda): docker platform for architecture#16858mergify[bot] merged 8 commits intoaws:masterfrom
mergify[bot] merged 8 commits intoaws:masterfrom
Conversation
Add a `dockerPlatform` property in `Architecture` and use it to pass the correct `platform` when bundling in a container in `aws-lambda-nodejs`, `aws-lambda-go` and `aws-lambda-python`.
2 tasks
corymhall
reviewed
Oct 7, 2021
| ...props.buildArgs ?? {}, | ||
| IMAGE: Runtime.GO_1_X.bundlingImage.image, // always use the GO_1_X build image | ||
| }, | ||
| platform: props.architecture.dockerPlatform, |
Contributor
There was a problem hiding this comment.
You probably need to remove the GOARCH environment variable on line 112 above.
jogold
commented
Oct 7, 2021
| CGO_ENABLED: cgoEnabled, | ||
| GO111MODULE: 'on', | ||
| GOARCH: 'amd64', | ||
| GOARCH: props.architecture.dockerPlatform.split('/')[1], |
Contributor
Author
jaresuth
approved these changes
Oct 8, 2021
eladb
reviewed
Oct 10, 2021
| /** | ||
| * Used to specify a custom architecture name. | ||
| * Use this if the architecture name is not yet supported by the CDK. | ||
| * @param name the architecture name as recognized by AWS Lambda. |
| */ | ||
| public readonly dockerPlatform: string; | ||
|
|
||
| private constructor(archName: string, dockerPlatform?: string) { |
Contributor
There was a problem hiding this comment.
For safety, maybe make explicit:
Suggested change
| private constructor(archName: string, dockerPlatform?: string) { | |
| private constructor(archName: string, dockerPlatform: string) { |
eladb
previously approved these changes
Oct 11, 2021
Contributor
Author
eladb
approved these changes
Oct 11, 2021
Contributor
|
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). |
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
|
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). |
TikiTDO
pushed a commit
to TikiTDO/aws-cdk
that referenced
this pull request
Feb 21, 2022
Add a `dockerPlatform` property in `Architecture` and use it to pass the correct `platform` when bundling in a container in `aws-lambda-nodejs`, `aws-lambda-go` and `aws-lambda-python`. Note that the SAM build images (`public.ecr.aws/sam/build-<runtime>`) are now multi-arch. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
4 tasks
mergify bot
pushed a commit
that referenced
this pull request
May 26, 2022
…ker images (#20439) This PR adds support for specifying the desired build platform when building docker images (ie: build an arm64 image on an amd64/x86_64 host). Closes #12472 This PR does NOT touch Lambda builders, only ECR assets. #16770 attempted to implement support for ECR and Lambda but was abandoned. Meanwhile #16858 implemented lambda platform support. This implements the ECR side I have run `yarn integ` ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
dockerPlatformproperty inArchitectureand use it to pass thecorrect
platformwhen bundling in a container inaws-lambda-nodejs,aws-lambda-goandaws-lambda-python.Note that the SAM build images (
public.ecr.aws/sam/build-<runtime>) are nowmulti-arch.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license