-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
aws:lambdaAWS LambdaAWS Lambdaplatform: arm64/aarch64Issues related to Apple SiliconIssues related to Apple Siliconstatus: response requiredWaiting for a response from the reporterWaiting for a response from the reportertype: bugBug reportBug report
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
We're trying to switch from the old lambda implementation to asf. We are developing on Apple M1 chips, so when executing lambda's, localstack pulls the linux/arm64 V8 platform image. When invoking the lambda function, the docker container crashes due to the following issue:
time="2023-02-07T08:39:35Z" level=debug msg="Start runtime" func=go.amzn.com/lambda/rapid.doInit file="/home/runner/work/lambda-runtime-init/lambda-runtime-init/lambda/rapid/start.go:222"
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
We are able to make it work when immediately pulling the linux/amd64 image, right after the linux/arm64 has been pulled by local stack. This way, localstack uses the linux/amd64 image.
Expected Behavior
Either the lambda setup works out of the box on Apple M1 chips or we have a way to specify the platform to local stack when pulling lambda images.
How are you starting LocalStack?
Custom (please describe below)
Steps To Reproduce
- We're using the testcontainers for java wrapper to start local stack:
LocalStackContainer container = new LocalStackContainer(dockerImageName, false)
.withServices(LocalStackContainer.Service.SQS) // Just because testcontainers does not allow empty list here
.withEnv("DEFAULT_REGION", "eu-west-1")
.withEnv("LAMBDA_EXECUTOR", "docker-reuse")
.withEnv("PROVIDER_OVERRIDE_LAMBDA", "asf")
.withEnv("LAMBDA_DOCKER_FLAGS", "--add-host host.containers.internal:host-gateway")
.withCreateContainerCmdModifier(cmd -> cmd.withPlatform("linux/amd64"))
.withNetwork(network);
- We create a lambda function using the java lambda sdk (runtime: provided.al2)
lambdaClient.createFunction(
CreateFunctionRequest.builder()
.functionName(lambdaFunctionName)
.code(
FunctionCode.builder()
.s3Bucket(lambdaCodeBucket.getBucketName())
.s3Key(lambdaFileName)
.build()
)
.timeout(900)
.deadLetterConfig(
DeadLetterConfig.builder()
.targetArn(deadLetterQueue.getQueueArn())
.build()
)
.role("arn:aws:iam::000000000000:role/lambda")
.handler("myfunction.lambda_handler")
.environment(
Environment.builder()
.variables(environmentVariables)
.build()
)
.memorySize(10000)
.runtime(Runtime.PROVIDED_AL2)
.architectures(Architecture.X86_64)
.build()
Environment
- OS: macOS 13.1 (22C65)
- LocalStack: 1.3.0 / latestAnything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
aws:lambdaAWS LambdaAWS Lambdaplatform: arm64/aarch64Issues related to Apple SiliconIssues related to Apple Siliconstatus: response requiredWaiting for a response from the reporterWaiting for a response from the reportertype: bugBug reportBug report