This repository was archived by the owner on Aug 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
improve the lambda container images tutorial #628
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-628.surge.sh 🎊 |
joe4dev
approved these changes
May 19, 2023
Member
joe4dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice incremental improvements 👍
The main comment is to sync with LS pro sample + the LocalStack bug, which currently breaks this tutorial 😬
| To invoke the Lambda function, you can use the `invoke` command: | ||
|
|
||
| {{< command >}} | ||
| $ awslocal lambda invoke --function-name localstack-lambda-container-image /tmp/lambda.out |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that something is broken. I'm running into an endless loop, similar to recent user reports here: localstack/localstack#7792
That seems rather a LocalStack issue:
2023-05-19T18:17:38.717 DEBUG --- [Executor-1_0] l.u.c.docker_sdk_client : Pulling Docker image: localstack-lambda-container-image
2023-05-19T18:17:38.726 INFO --- [ asgi_gw_1] localstack.request.aws : AWS sts.AssumeRole => 200
2023-05-19T18:17:40.603 DEBUG --- [Executor-1_0] l.s.a.i.docker_runtime_exe : Unable to pull image ImageCode(image_uri='localstack-lambda-container-image', repository_type='ECR', code_sha256='b338b9a64859ad81339747514419d1afba61e58baccc5421c9be6aa48381fd3a') for executor preparation. Maybe image is only available locally?
2023-05-19T18:17:40.606 DEBUG --- [Executor-1_0] l.s.a.i.version_manager : Changing Lambda 'arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST' (id b31a9e05) to active
2023-05-19T18:17:46.742 INFO --- [ asgi_gw_1] localstack.request.aws : AWS lambda.GetFunction => 200
2023-05-19T18:18:12.628 DEBUG --- [functhread71] l.s.a.i.version_manager : Got invocation event 90819e11-78a6-4244-a140-e756b1958e2e in loop
2023-05-19T18:18:12.629 DEBUG --- [functhread71] l.s.a.i.version_manager : Starting new environment
2023-05-19T18:18:12.630 DEBUG --- [functhread71] l.s.a.i.docker_runtime_exe : Creating service endpoint for function arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST executor 8deec8caaff7ff4728f572dfa534a3dd
2023-05-19T18:18:12.630 DEBUG --- [functhread71] l.s.a.i.docker_runtime_exe : Finished creating service endpoint for function arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST executor 8deec8caaff7ff4728f572dfa534a3dd
2023-05-19T18:18:12.630 DEBUG --- [functhread71] l.s.a.i.docker_runtime_exe : Assigning container name of localstack-main-lambda-localstack-lambda-container-image-8deec8caaff7ff4728f572dfa534a3dd to executor 8deec8caaff7ff4728f572dfa534a3dd
2023-05-19T18:18:12.664 INFO --- [ asgi_gw_0] localstack.request.aws : AWS sts.AssumeRole => 200
2023-05-19T18:18:12.669 DEBUG --- [ge:$LATEST_0] l.u.c.container_client : Getting networks for container: localstack_main
2023-05-19T18:18:12.685 INFO --- [ge:$LATEST_0] l.u.container_networking : Determined main container network: lambda-container-image_default
2023-05-19T18:18:12.685 DEBUG --- [ge:$LATEST_0] l.u.c.container_client : Getting ipv4 address for container localstack_main in network lambda-container-image_default.
2023-05-19T18:18:12.711 INFO --- [ge:$LATEST_0] l.u.container_networking : Determined main container target IP: 172.24.0.2
2023-05-19T18:18:12.717 DEBUG --- [ge:$LATEST_0] l.s.a.i.docker_runtime_exe : Executing start docker executor pro-hook for function arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST
2023-05-19T18:18:12.723 DEBUG --- [ge:$LATEST_0] l.u.c.docker_sdk_client : Creating container with attributes: {'mount_volumes': None, 'ports': None, 'cap_add': None, 'cap_drop': None, 'security_opt': None, 'dns': None, 'additional_flags': '', 'workdir': None, 'privileged': None, 'labels': None, 'ulimits': None, 'command': ['/lambda-entrypoint.sh', 'handler.handler'], 'detach': None, 'entrypoint': '/var/rapid/init', 'env_vars': {'AWS_DEFAULT_REGION': 'us-east-1', 'AWS_REGION': 'us-east-1', 'AWS_LAMBDA_FUNCTION_NAME': 'localstack-lambda-container-image', 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE': 128, 'AWS_LAMBDA_FUNCTION_VERSION': '$LATEST', 'AWS_LAMBDA_INITIALIZATION_TYPE': 'on-demand', 'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/localstack-lambda-container-image', 'AWS_LAMBDA_LOG_STREAM_NAME': '2023/05/19/[$LATEST]8deec8caaff7ff4728f572dfa534a3dd', 'AWS_ACCESS_KEY_ID': 'ASIAQAAAAAAAL6QCTGCI', 'AWS_SECRET_ACCESS_KEY': '5fyQlIrk3DGWd/v7N2fQaD9eQ9u2vKJfvImoMWWo', 'AWS_SESSION_TOKEN': 'FQoGZXIvYXdzEBYaDlMgKQAWM9XSRml9ZybtdOGyDc1lM+tyzq4aZ11C+VDFhlHkUHwdHobMR5ycpVKjiaj8zDRHSy71P30U8tC38wpFPOhQ8BJtL3M8qFpUDhXvwK4cLG8j4wkH3UwswrdVBnV+muL71DUA/8siQGZkPnmDfjCCX3iL8YvHVUUU9xIIwSo6Ki0cChtEimyO5itPLIEE8MWm7//N5o2fuweqQ8XFYY5Sp/80LT2U6niGqbHul2Kbw/bOGWNIghI4ctI+BZ8Sk0+7uo9wRr4StJO+b3QRcdPhMtHj5n0JQCel97C4s0RzTpanKKbdmhhxaANnaCnyAJJwKWSQxu0wtiI=', 'LAMBDA_TASK_ROOT': '/var/task', 'LAMBDA_RUNTIME_DIR': '/var/runtime', 'AWS_XRAY_CONTEXT_MISSING': 'LOG_ERROR', 'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000', '_AWS_XRAY_DAEMON_PORT': '2000', '_AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1', 'TZ': ':UTC', 'AWS_LAMBDA_FUNCTION_TIMEOUT': 3, 'LOCALSTACK_HOSTNAME': '172.24.0.2', 'EDGE_PORT': '443', 'AWS_ENDPOINT_URL': 'http://172.24.0.2:443', 'LOCALSTACK_RUNTIME_ID': '8deec8caaff7ff4728f572dfa534a3dd', 'LOCALSTACK_RUNTIME_ENDPOINT': 'http://172.24.0.2:443/_localstack_lambda/8deec8caaff7ff4728f572dfa534a3dd', '_HANDLER': 'handler.handler', 'LOCALSTACK_INIT_LOG_LEVEL': 'debug'}, 'image_name': 'localstack-lambda-container-image', 'interactive': None, 'name': 'localstack-main-lambda-localstack-lambda-container-image-8deec8caaff7ff4728f572dfa534a3dd', 'network': 'lambda-container-image_default', 'platform': 'linux/amd64', 'remove': None, 'self': <localstack.utils.container_utils.docker_sdk_client.SdkDockerClient object at 0xffffaa0d5d50>, 'tty': None, 'user': None}
2023-05-19T18:18:12.742 DEBUG --- [ge:$LATEST_0] l.u.c.docker_sdk_client : Pulling Docker image: localstack-lambda-container-image
2023-05-19T18:18:14.644 DEBUG --- [ge:$LATEST_0] l.u.c.docker_sdk_client : Stopping container: localstack-main-lambda-localstack-lambda-container-image-8deec8caaff7ff4728f572dfa534a3dd
2023-05-19T18:18:14.654 DEBUG --- [ge:$LATEST_0] l.s.a.i.runtime_environmen : Unable to shutdown runtime handler '8deec8caaff7ff4728f572dfa534a3dd'
2023-05-19T18:18:15.643 DEBUG --- [functhread71] l.s.a.i.version_manager : Detected no active environments for version arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST. Starting one...
2023-05-19T18:18:15.644 DEBUG --- [functhread71] l.s.a.i.version_manager : Starting new environment
2023-05-19T18:18:15.645 DEBUG --- [functhread71] l.s.a.i.docker_runtime_exe : Creating service endpoint for function arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST executor 6a683e5a634efeb345f3e2f2ab29c386
2023-05-19T18:18:15.645 DEBUG --- [functhread71] l.s.a.i.docker_runtime_exe : Finished creating service endpoint for function arn:aws:lambda:us-east-1:000000000000:function:localstack-lambda-container-image:$LATEST executor 6a683e5a634efeb345f3e2f2ab29c386
2023-05-19T18:18:15.645 DEBUG --- [functhread71] l.s.a.i.docker_runtime_exe : Assigning container name of localstack-main-lambda-localstack-lambda-container-image-6a683e5a634efeb345f3e2f2ab29c386 to executor 6a683e5a634efeb345f3e2f2ab29c386
2023-05-19T18:18:15.670 INFO --- [ asgi_gw_0] localstack.request.aws : AWS sts.AssumeRole => 200
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.