diff --git a/app/Dockerfile b/app/Dockerfile index 8400b98..b8e36ea 100755 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,9 +1,13 @@ -# Base image that bundles AWS Lambda Python 3.8 image with some middleware functions -# FROM base-eval-tmp -FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.8 +# Base image that bundles the AWS Lambda Python image with the lambda-feedback middleware (app.handler) +FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.12 + +# The 3.12 image is Amazon Linux 2023, which doesn't ship `find` (used below) +RUN dnf install -y findutils && dnf clean all WORKDIR /app +ENV PYTHONPATH=/app + # Copy and install any packages/modules needed for your evaluation script. COPY requirements.txt . RUN pip3 install -r requirements.txt @@ -32,7 +36,7 @@ COPY prompts/PreventionClassificationWithoutContextOfOtherInputs.py ./app/prompt COPY prompts/MitigationClassificationWithoutContextOfOtherInputs.py ./app/prompts/ COPY prompts/NoInformationProvided.py ./app/prompts/ COPY prompts/SummarizeControlMeasureFeedback.py ./app/prompts/ -COPY data/RiskAssessment.py ./app/ +COPY data/RiskAssessment.py ./app/data/ COPY utils/LLMCaller.py ./app/utils/ COPY utils/RegexPatternMatcher.py ./app/utils/ @@ -44,5 +48,6 @@ COPY docs/user.md ./app/docs/user.md RUN chmod 644 $(find . -type f) RUN chmod 755 $(find . -type d) -# The entrypoint for AWS is to invoke the handler function within the app package -CMD [ "/app/app.handler" ] +# The entrypoint for AWS is to invoke the handler function within the app package. +# Python 3.12's Lambda runtime imports this as a module name, so it can't be a path. +CMD [ "app.handler" ] diff --git a/app/requirements.txt b/app/requirements.txt index db4d68b..caa2116 100755 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,9 +1,6 @@ openai==0.28.0 python-dotenv==0.21.1 -typing==3.7.4.3 -numpy==1.24.2 -langchain==0.0.335 -streamlit==1.20.0 +numpy>=1.26 anthropic==0.18.1 mistralai==0.0.11 tabulate==0.9.0