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

ARM64 support #61

Open
lichray opened this issue Jan 31, 2023 · 1 comment
Open

ARM64 support #61

lichray opened this issue Jan 31, 2023 · 1 comment

Comments

@lichray
Copy link

lichray commented Jan 31, 2023

An ARM-native Linux machine/WSL2 should also benefit from ARM64 lambda in AWS.

llama installs and runs fine on my machine. However, the rest are probably not prepared for ARM64. For example, I cannot tell how to build an ARM64 function runtime similar to https://github.com/users/nelhage/packages/container/package/llama.

Assuming we can do that, I don't know what else is missing, if any, such as a code change in Go.

Thank you for helping!

@zhihaoy
Copy link
Contributor

zhihaoy commented Feb 16, 2023

I made some progress:

diff --git a/cmd/llama/internal/function/lambda.go b/cmd/llama/internal/function/lambda.go
index 32b1015..30ec2d6 100644
--- a/cmd/llama/internal/function/lambda.go
+++ b/cmd/llama/internal/function/lambda.go
@@ -52,6 +52,9 @@ func createOrUpdateFunction(ctx context.Context, g *cli.GlobalState, cfg *functi
                        ImageUri: aws.String(cfg.tag),
                },
                PackageType: aws.String(lambda.PackageTypeImage),
+               Architectures: []*string{
+                       aws.String("arm64"),
+               },
        }
        if cfg.memory != 0 {
                args.MemorySize = &cfg.memory

After creating the lambda function this way, it successfully launches ARM64 containers.

  1. Requires a newer version of aws-lambda-go
  2. Currently, there is no Go API to "update" an existing lambda function to use a different architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants