diff --git a/backend/README.md b/backend/README.md index 1d87774d..4d5a68ef 100644 --- a/backend/README.md +++ b/backend/README.md @@ -102,6 +102,28 @@ run the following command with your aws access token exported into your environm docker run -p 8000:8000 -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION fastapi-local-image:latest ``` +## Emulating the lambda locally + +I have set up a script called `run_local_lambda.sh` which will allow you to emulate the lambda locally. +You need to have a .env file with the necessary environment variables at backend/env and also +and aws credentials file at ~/.aws/credentials, locally. + +To run this, firstly run: + +```bash +chmod +x run_local_lambda.sh +``` + +Now you can run the script with + +``` +./run_lambda_local.sh +``` + +Then run the script with the following command: + +```commandline + ## Testing To run tests, run the following command from the root of the project directory: diff --git a/backend/docker/lambda.Dockerfile b/backend/docker/lambda.Dockerfile index 41b7db34..35c62260 100644 --- a/backend/docker/lambda.Dockerfile +++ b/backend/docker/lambda.Dockerfile @@ -14,7 +14,7 @@ WORKDIR /var/task/Model # Install system dependencies RUN apt-get update && apt-get install -y make gcc g++ gfortran libgfortran-9-dev liblapack-dev libamd2 libcholmod3 \ - libmetis-dev libsuitesparse-dev libnauty2-dev git wget + libmetis-dev libsuitesparse-dev libnauty2-dev git wget pkgconf # Compile CBC for arm64 RUN mkdir -p ~/build && cd ~/build \ diff --git a/run_lambda_local.sh b/run_lambda_local.sh old mode 100644 new mode 100755