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

[BUG] bb commands run slow, when running under M1 MacOS #61

Closed
FieryCod opened this issue Jul 9, 2021 · 3 comments
Closed

[BUG] bb commands run slow, when running under M1 MacOS #61

FieryCod opened this issue Jul 9, 2021 · 3 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@FieryCod
Copy link
Owner

FieryCod commented Jul 9, 2021

Describe the bug
HL uses docker under the hood to make cross platform development environment. Unfortunately Docker runs slowly on M1, most probably, because GraalVM did not yet released official GraalVM CE Docker images that target arm64.

Example warning from running bb stack:compile:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Upstream issue to track: oracle/graal#2666

Extra information:

  • OS: [e.g. MacOS] Mac OS M1
  • holy-lambda version: irrelevant
  • bb stack:doctor output: irrelevant
@FieryCod FieryCod added the bug Something isn't working label Jul 9, 2021
@FieryCod FieryCod self-assigned this Jul 9, 2021
@FieryCod FieryCod added this to To do in 1.0.0 via automation Jul 9, 2021
@FieryCod
Copy link
Owner Author

FieryCod commented Jul 17, 2021

Making M1 work fine with HL or any other "native" (applies to compiled ones like golang, rust, c++) is hard. That's because AWS Lambda requires Linux amd64 binary. Producing valid binary for compiled languages is done by using Docker with a Linux Amazon Image. The build time of such binary on Docker varies across the different OSes and architectures. For M1, it's painfully slow and very likely that the build process will hang, which is the result of the early stage of Docker amd64 emulation on M1.

While there is an option to make some of the HL commands run fast on M1 by leveraging aarch64 Linux image, it's impossible to run the native-compiled aarch64 binary on AWS Lambda. AWS Lambda will hardly ever support aarch64, and that's why I've asked the question on GraalVM slack whether it's possible to cross-compile on aarch64 to amd64. While certainly, it's possible the GraalVM team may likely not introduce the following change soon.

For now, M1 users should believe that Docker is going to fix the emulation for amd64.

Recommended workarounds for now:

@FieryCod
Copy link
Owner Author

Since 0.6.0 version users with M1 should use ghcr.io/fierycod/holy-lambda-builder:aarch64-java11-21.3.0 or any alternative aarch64 builder available here and target ARM64 Lambda Architecture.

ARM64 is actually much better for Lambda, therefore I recommend it for all the users. See here

@FieryCod
Copy link
Owner Author

FieryCod commented Oct 29, 2021

Fixed in 0.6.0

EDIT: cc @stevebuik

1.0.0 automation moved this from To do to Done Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
1.0.0
  
Done
Development

No branches or pull requests

1 participant