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

AWS Lambda: Support 64-bit ARM architecture #10049

Merged
merged 9 commits into from Oct 4, 2021
Merged

Conversation

medikoo
Copy link
Contributor

@medikoo medikoo commented Oct 4, 2021

Closes: #10025

Additionally cleaned up lambda based fixtures, to create better room for the testing general lambda related enhancements

@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #10049 (589217e) into master (f8ad7bc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10049   +/-   ##
=======================================
  Coverage   85.75%   85.75%           
=======================================
  Files         333      333           
  Lines       13435    13439    +4     
=======================================
+ Hits        11521    11525    +4     
  Misses       1914     1914           
Impacted Files Coverage Δ
lib/plugins/aws/provider.js 93.71% <ø> (ø)
lib/plugins/aws/package/compile/functions.js 94.38% <100.00%> (+0.03%) ⬆️
lib/plugins/aws/package/compile/layers.js 84.94% <100.00%> (+0.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8ad7bc...589217e. Read the comment docs.

docs/providers/aws/guide/functions.md Outdated Show resolved Hide resolved
```yml
provider:
...
arch: arm64
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
arch: arm64
architecture: arm64

The word isn't really long so we might as well be explicit for clarity? Additionally the CloudFormation setting is Architectures, not Arch/Archs so we gain a bit in consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually followed the spec from the issue, which was confirmed as accepted.

Anyway I also thought about that, and I agree that using architecture is probably better

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 ok I understand better, I thought the original post (top comment of the issue) was just a suggestion. So I'm guessing for anything discussed on GitHub the practice is to discuss and update the top comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, issue serves as specification then

@medikoo medikoo force-pushed the 1004-lambda-arch branch 2 times, most recently from 662f26f to 44c9174 Compare October 4, 2021 14:14
mnapoli
mnapoli previously approved these changes Oct 4, 2021
Copy link
Contributor

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

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

(only reviewed the docs)

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

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

As discussed, let's also add property to layers


By default, Lambda functions are run by 64-bit x86 architecture CPUs. However, using arm64 architecture (AWS Graviton2 processor) may result in better pricing and performance.

To switch all lambdas to AWS Graviton2 processor, configure `arch` at `provider` level as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe let's write all functions instead of all lambdas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 changed

@medikoo
Copy link
Contributor Author

medikoo commented Oct 4, 2021

As discussed, let's also add property to layers

@pgrzesik very good point, added

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

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

Looks great overall, I only have one small suggestion related to docs

@@ -597,6 +599,9 @@ layers:
description: Description of what the lambda layer does # optional, Description to publish to AWS
compatibleRuntimes: # optional, a list of runtimes this layer is compatible with
- python3.8
compatibleArchitectures: # optional, a list of architectures this layer is compatible with
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to add a reference to this setting in layers.md documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point @pgrzesik Added

Copy link
Contributor

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

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

Great job 👏

@medikoo medikoo merged commit fe655d4 into master Oct 4, 2021
@medikoo medikoo deleted the 1004-lambda-arch branch October 4, 2021 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support creating Graviton-based arm64 Lambda Functions
3 participants