From ed8cbac431dd3b3234d892a7ebbbb9b21d44a206 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 21 Oct 2024 15:53:49 +0100 Subject: [PATCH] creating new requirements file --- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- backend/docker/Dockerfile | 17 ++++++----------- backend/docker/lambda.Dockerfile | 8 ++++++-- backend/requirements/base.txt | 3 ++- backend/requirements/requirements.txt | 10 ++++++++++ 6 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 backend/requirements/requirements.txt diff --git a/.idea/Model.iml b/.idea/Model.iml index b0f9c00d..cfc6ba61 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -7,7 +7,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 78660f34..4caca8d5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,7 +3,7 @@ - + diff --git a/backend/docker/Dockerfile b/backend/docker/Dockerfile index fd498cdb..122f07ff 100644 --- a/backend/docker/Dockerfile +++ b/backend/docker/Dockerfile @@ -12,10 +12,10 @@ WORKDIR var/task/Model RUN #apt-get update && apt-get install -y netcat-openbsd # Install python dependencies -COPY ./backend/requirements/base.txt ./backend/requirements/base.txt +COPY ./backend/requirements/requirements.txt ./backend/requirements/requirements.txt RUN pip install --upgrade pip # Install and clean up temp caches -RUN pip install -r backend/requirements/base.txt && rm -rf /root/.cache +RUN pip install -r backend/requirements/requirements.txt && rm -rf /root/.cache # Since we are not using a base AWS image, there is some additional setup required. We need to set up the runtime # interface client @@ -35,16 +35,11 @@ COPY --from=build-image /usr/local/lib/python3.10/site-packages/ /usr/local/lib/ # Copy project files COPY ./backend/ ./backend COPY ./recommendations/ ./recommendations -COPY ./model_data/BaseUtility.py ./model_data/BaseUtility.py -COPY ./model_data/config.py ./model_data/config.py -COPY ./model_data/optimiser/ ./model_data/optimiser/ -COPY ./model_data/__init__.py ./model_data/__init__.py -COPY ./model_data/EpcClean.py ./model_data/EpcClean.py -COPT ./model_data/simulation_system/core/ ./model_data/simulation_system/core/ -COPY ./model_data/utils.py ./model_data/utils.py -COPY ./model_data/epc_attributes/ ./model_data/epc_attributes/ -COPY ./datatypes/ ./datatypes/ COPY ./utils/ ./utils/ +COPY ./etl/epc/ ./etl/epc/ +COPY ./etl/epc_clean/ ./etl/epc_clean/ +COPY ./etl/bill_savings/ ./etl/bill_savings/ +COPY ./etl/spatial/ ./etl/spatial/ # Set the ENTRYPOINT to the AWS Lambda RIC and CMD to your function handler ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ] diff --git a/backend/docker/lambda.Dockerfile b/backend/docker/lambda.Dockerfile index 50773fd5..e6f5ea63 100644 --- a/backend/docker/lambda.Dockerfile +++ b/backend/docker/lambda.Dockerfile @@ -12,10 +12,10 @@ WORKDIR var/task/Model #RUN apt-get update && apt-get install -y netcat-openbsd # Install python dependencies -COPY ./backend/requirements/base.txt ./backend/requirements/base.txt +COPY ./backend/requirements/requirements.txt ./backend/requirements/requirements.txt # Install and clean up temp caches RUN pip install --upgrade pip \ - && pip install -r backend/requirements/base.txt && rm -rf /root/.cache + && pip install -r backend/requirements/requirements.txt && rm -rf /root/.cache # Since we are not using a base AWS image, there is some additional setup required. We need to set up the runtime # interface client @@ -26,6 +26,9 @@ RUN pip install awslambdaric # Second stage: "runtime-image" FROM python:3.10.12-slim-buster +# Create the extensions directory to avoid warnings with RIE +RUN mkdir -p /opt/extensions + # Set work directory to the root of your project WORKDIR /var/task/Model @@ -40,6 +43,7 @@ COPY ./etl/epc/ ./etl/epc/ COPY ./etl/epc_clean/ ./etl/epc_clean/ COPY ./etl/bill_savings/ ./etl/bill_savings/ COPY ./etl/spatial/ ./etl/spatial/ +COPY ./BaseUtility.py ./BaseUtility.py # Set the ENTRYPOINT to the AWS Lambda RIC and CMD to your function handler diff --git a/backend/requirements/base.txt b/backend/requirements/base.txt index c4e7367c..c2b4ab71 100644 --- a/backend/requirements/base.txt +++ b/backend/requirements/base.txt @@ -33,7 +33,8 @@ psycopg2-binary pytz==2023.3 mip==1.15.0 boto3==1.28.3 -pandas==1.5.3 +pandas==2.2.3 +numpy==1.24.4 pyarrow==12.0.1 textblob usaddress==0.5.10 diff --git a/backend/requirements/requirements.txt b/backend/requirements/requirements.txt new file mode 100644 index 00000000..f1fa45cb --- /dev/null +++ b/backend/requirements/requirements.txt @@ -0,0 +1,10 @@ +# Pandas and numpy +numpy==2.1.2 +pandas==2.2.3 +pytz==2024.2 +six==1.16.0 +# tqdm +tqdm==4.66.5 +# fastapi +fastapi==0.115.2 +sqlalchemy==2.0.36