Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

feat: pass docker arch to ecr to lambda #3046

Merged
merged 6 commits into from
Mar 3, 2022
Merged

feat: pass docker arch to ecr to lambda #3046

merged 6 commits into from
Mar 3, 2022

Conversation

thiskevinwang
Copy link
Contributor

@thiskevinwang thiskevinwang commented Feb 27, 2022

Description

This adds docker architecture, and passes it to the ecr component and then lambda component (via the protobufs) for a 0-config option to automatically set a lambda architecture that is compatible with the ECR image architecture.

The HCL value from #3032 takes precedence.

This closes #3026

Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

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

I know this is still in draft, but figured I'd give a lil' review!


// Waypoint 0.6 and earlier supported "img" as a Dockerless builder.
// We removed this in 0.7, hence we prefix this now with "unused". We
// keep the field around so we can detect old clients sending it and
// show an error. Do not set this.
google.protobuf.Empty unused_img = 5;
google.protobuf.Empty unused_img = 6;
Copy link
Member

Choose a reason for hiding this comment

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

if I remember right, these numbers should never be changed. Otherwise old proto clients will use the wrong variables during communication. It's totally fine to make architecture the next number here, no need to bump the other ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah TIL! and that makes sense

Comment on lines 16 to 17
log.Warn("unsupported docker architecture", "arch", src, "defaulting to:", lambda.ArchitectureX8664)
return lambda.ArchitectureX8664
Copy link
Member

Choose a reason for hiding this comment

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

This could just be the default case in the switch

@thiskevinwang thiskevinwang marked this pull request as ready for review March 1, 2022 22:49
Base automatically changed from kw/lambda-arm64 to main March 2, 2022 17:58
Copy link
Contributor

@evanphx evanphx left a comment

Choose a reason for hiding this comment

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

If you change that file so it's not confused as an argmapper mapper, we'll be good to go!

@@ -0,0 +1,19 @@
package lambda
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move this to utils.go instead? Mappers are a specific argmapper concept that are automatically called and have to be registered. This appears to just be a helper function to convert one string to another.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL! Ok, renamed this mapper.go file utils.go

@evanphx evanphx merged commit ff44064 into main Mar 3, 2022
@evanphx evanphx deleted the kw/feat-docker-arch branch March 3, 2022 04:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arm64 function support for aws-lambda deployments
3 participants