From 7709bb4cf7f215a087fbeeac7b8f611a868352e7 Mon Sep 17 00:00:00 2001 From: renjiexu-amzn <168146879+renjiexu-amzn@users.noreply.github.com> Date: Sat, 27 Apr 2024 04:12:01 -0700 Subject: [PATCH] [#453] Update the Fast API run script examples to include LAMBDA_RUNTIME_DIR in search path. (#454) --- examples/bedrock-agent-fastapi-zip/app/run.sh | 2 +- examples/fastapi-response-streaming-zip/app/run.sh | 2 +- examples/fastapi-zip/app/run.sh | 2 +- examples/flask-zip/app/run.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bedrock-agent-fastapi-zip/app/run.sh b/examples/bedrock-agent-fastapi-zip/app/run.sh index 826b7dd..7dc74ef 100755 --- a/examples/bedrock-agent-fastapi-zip/app/run.sh +++ b/examples/bedrock-agent-fastapi-zip/app/run.sh @@ -1,3 +1,3 @@ #!/bin/bash -PATH=$PATH:$LAMBDA_TASK_ROOT/bin:/opt/bin PYTHONPATH=$LAMBDA_TASK_ROOT:/opt/python exec python -m uvicorn --port=$PORT main:app +PATH=$PATH:$LAMBDA_TASK_ROOT/bin:/opt/bin PYTHONPATH=/opt/python:$LAMBDA_RUNTIME_DIR exec python -m uvicorn --port=$PORT main:app diff --git a/examples/fastapi-response-streaming-zip/app/run.sh b/examples/fastapi-response-streaming-zip/app/run.sh index 53e303a..a630f44 100755 --- a/examples/fastapi-response-streaming-zip/app/run.sh +++ b/examples/fastapi-response-streaming-zip/app/run.sh @@ -1,5 +1,5 @@ #!/bin/bash PATH=$PATH:$LAMBDA_TASK_ROOT/bin \ - PYTHONPATH=$LAMBDA_TASK_ROOT:$PYTHONPATH:/opt/python \ + PYTHONPATH=$PYTHONPATH:/opt/python:$LAMBDA_RUNTIME_DIR \ exec python -m uvicorn --port=$PORT main:app diff --git a/examples/fastapi-zip/app/run.sh b/examples/fastapi-zip/app/run.sh index 53e303a..a630f44 100755 --- a/examples/fastapi-zip/app/run.sh +++ b/examples/fastapi-zip/app/run.sh @@ -1,5 +1,5 @@ #!/bin/bash PATH=$PATH:$LAMBDA_TASK_ROOT/bin \ - PYTHONPATH=$LAMBDA_TASK_ROOT:$PYTHONPATH:/opt/python \ + PYTHONPATH=$PYTHONPATH:/opt/python:$LAMBDA_RUNTIME_DIR \ exec python -m uvicorn --port=$PORT main:app diff --git a/examples/flask-zip/app/run.sh b/examples/flask-zip/app/run.sh index 1601e69..3557d16 100755 --- a/examples/flask-zip/app/run.sh +++ b/examples/flask-zip/app/run.sh @@ -1,5 +1,5 @@ #!/bin/bash PATH=$PATH:$LAMBDA_TASK_ROOT/bin \ - PYTHONPATH=$LAMBDA_TASK_ROOT:$PYTHONPATH:/opt/python \ + PYTHONPATH=$PYTHONPATH:/opt/python:$LAMBDA_RUNTIME_DIR \ exec python -m gunicorn -b=:$PORT -w=1 app:app