-
Notifications
You must be signed in to change notification settings - Fork 38
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
Apple Silicon and basic cross compiling support #26
Conversation
@hoffa Could you review/test this please? |
Hi @brainstorm! Thanks for this PR. We've published ARM images for a number of runtimes (in line with what's supported for Lambda). Does that help with your use case? Recent ARM-related changes to |
It does! 🎉 Thanks a ton @hoffa for this invaluable pointer! Now umccr/s3-rust-noodles-bam@81a8f0f...6bb853e solves a longstanding issue for me, much appreciated! Now I can deploy those lambdas on ARM64 and ship Unfortunately the |
The exec format error is specially confusing because I'm building everything as arm64/aarch64 now, no x86_64 or similar:
What am I doing wrong? :-S |
Also, as a side note, the local building performance is quite disappointing since I guess it doesn't leverage the local machine's
This is a perfect example of one more paper cut when it comes to DX, see: aws-samples/serverless-rust-demo#4 |
@hoffa Here's another weird one... would you like me to open separate issues for these last three findings?:
|
@hoffa, nevermind the last three messages, I managed to have it running on umccr/s3-rust-noodles-bam@5d2ce7a ;) Even the Although I now I have figure out if I should define a dummy credential provider chain for S3, otherwise I'm getting:
I guess that there are two problems here:
From I guess that for now the only workaround possible to address local debugging with auth'd resources from my org is using the following with
|
@hoffa Credentials issue mentioned in the last message was trivial to solve via DefaultChainProvider (my bad, I didn't remember that the lambda has all required AWS env vars defined and ready to use already, so no SSO required). What I don't know how to address properly (yet), and it's quite a DX nuisance, is the aforementioned build times on Apple Silicon of 6 minutes via my own
The step in the middle takes too long for a normal developer iteration loop... @nmoutschen is trying to use the rust-embedded Alternatively, if somebody finds a way to cross-compile IMHO, I very much prefer the latter option to have an acceptable local build time, but it doesn't look straightforward to solve ATM, at least, to me and my limited time to dedicate to AWS tooling :-S |
Followup from aws/aws-sam-cli#3132, refer to that issue and @jfuss for context.
This PR adds the possibility to build the docker images on Apple Silicon, by activating the environment variable:
$ export SAM_CLI_CROSS_BUILD=1
Otherwise none of the containers in
build-image-src/build_all_images.sh
will successfully build on an Apple M1 machine (Darwin/arm64). Some of the errors of not includingbuildx
in the docker image building process include the following, predictably: