-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Hanging or failing command sam build --use-container
creating LambdaLayer when BuildArchitecture is amd64
#7523
Comments
@rstrahan thanks for raising the issue. We will try to reproduce the issue |
@rstrahan a quick check - if you use an arm64 EC2 instance instead, will building "template-arm64.yaml" in your provided example succeed? |
I don't know, @hawflau - I have not tried. Quite possibly it would work, but our customer is using Cloud9 to run their builds, and C9 doesn't support arm64 instances. It has always worked fine on x86 C9 instances, until recently.. and in fact it still does work on some pre-existing older C9 instances (though I cannot trace the issue to specific versions of docker, sam cli, or aws cli.) Hopefully you can repro the problem with the attached example, and see if you can determine the root cause. In the meantime I was able to get unblocked thanks to help on the aws-sam-interest channel - it turns out you can build an arm64 lambda function/layer using an x86 container.. So the workaround was to specify the non-default image using But the essential issue remains that |
Makes sense. And thanks for finding a workaround. I also managed to reproduce the issue. Docker runs an arm64 image in a x86 environment with emulation, which usually incurs some level of performance hit. When using That being said, I don't think there is anything we can do in SAM CLI. |
But this isn't a performance hit.. It's not working at all. Can we find out why? If the issue is with docker, can we repro the issue without sam cli in the loop, and see if docker will support/fix it, or propose a workaround that could be implemented within the sam cli? It also occurs to me that maybe there's a layer of logging available from docker that could be exposed and which might reveal more clues, since right now it seems to be failing silently (i.e. revealing no clues)..
Thanks @hawflau ! |
Description:
Hanging or failing command
sam build --use-container
creating LambdaLayer when BuildArchitecture is amd64Steps to reproduce:
I created a minimal repro (zipfile attached).
sam-build-test.zip
It fails for arm64. It works for x86_64.
To repro simply unzip attached in an EC2 dev instance (eg it can be repro'ed on a new vanilla Cloud 9 - either AL2 or AL2023 - doesn't matter - both fail)
ARM64
In the sam-build-test directory, run
the first time you run it, it might fail rather than hang:
Unfortunately this error reveals no clues to me..
When I repeat the same command again, it hangs - forever:
X86_64
In the sam-build-test directory, run
Works fine.. The only difference in the two templates is the Architecture
So we could probably get past this quickly by changing the Architecture from arm64 to x86_64, but x86_64 has higher runtime cost, and I'd rather get to the root cause for why it's not working now on arm64.
Observed result:
Hangs forever after
Mounting
command:Expected result:
It should not fail or hang, but rather it should succeed - as it does with x86_64
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.112.0Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: