Skip to content

[#453] Update the Fast API run script examples to include LAMBDA_RUNTIME_DIR in search path.#454

Merged
bnusunny merged 2 commits intoaws:mainfrom
renjiexu-amzn:main
Apr 27, 2024
Merged

[#453] Update the Fast API run script examples to include LAMBDA_RUNTIME_DIR in search path.#454
bnusunny merged 2 commits intoaws:mainfrom
renjiexu-amzn:main

Conversation

@renjiexu-amzn
Copy link
Copy Markdown
Contributor

@renjiexu-amzn renjiexu-amzn commented Apr 26, 2024

Issue #, if available: #453

Description of changes: Update the Fast API run script examples

After the change, the search path has been verified to be ['', '/var/task', '/var/runtime', '/var/lang/lib/python38.zip', '/var/lang/lib/python3.8', '/var/lang/lib/python3.8/lib-dynload', '/var/lang/lib/python3.8/site-packages'], where /var/runtime is the value of $LAMBDA_RUNTIME_DIR and the code could work even user didn't bundle boto3 in the zip archive.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bnusunny
Copy link
Copy Markdown
Contributor

The correct order should be PYTHONPATH=/opt/python:$LAMBDA_RUNTIME_DIR. The layers have precedence over the runtime.

…UNTIME_DIR in search path and fix the order in PYTHONPATH.
@renjiexu-amzn
Copy link
Copy Markdown
Contributor Author

Thanks for the comment. I added one more commit to address the order.

@bnusunny bnusunny merged commit 7709bb4 into aws:main Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants