From 547172a6e81c770ee432b26630ae322796627532 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 12 Sep 2023 18:07:07 +0100 Subject: [PATCH] copying over simulation system DataProcessor to backend dockerfile and adding 120 second timeout --- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- backend/docker/lambda.Dockerfile | 1 + model_data/cleaner_app.py | 10 +++++----- serverless.yml | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.idea/Model.iml b/.idea/Model.iml index 05b9012b..b03b31b1 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 3b05c6ac..ca0e1cd9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/backend/docker/lambda.Dockerfile b/backend/docker/lambda.Dockerfile index 168f94f6..d4588cab 100644 --- a/backend/docker/lambda.Dockerfile +++ b/backend/docker/lambda.Dockerfile @@ -42,6 +42,7 @@ COPY ./model_data/__init__.py ./model_data/__init__.py COPY ./model_data/EpcClean.py ./model_data/EpcClean.py COPY ./model_data/utils.py ./model_data/utils.py COPY ./model_data/epc_attributes/ ./model_data/epc_attributes/ +COPY ./model_data/simulation_system/core/DataProcessor.py ./model_data/simulation_system/core/DataProcessor.py COPY ./datatypes/ ./datatypes/ COPY ./utils/ ./utils/ diff --git a/model_data/cleaner_app.py b/model_data/cleaner_app.py index 9b3314b4..d53f7d5f 100644 --- a/model_data/cleaner_app.py +++ b/model_data/cleaner_app.py @@ -82,14 +82,14 @@ def app(): # where component is one of the keys of cleaned_data. If we store it against the original data, this # data being read in will be extremely small, meaning quicker load times. We'll begin by storing as a single # file and monitor usage patterns to see if it makes sense to split the data up - save_data_to_s3( - data=msgpack.packb(cleaned_data, use_bin_type=True), - s3_file_name="cleaned_epc_data/cleaned.bson", - bucket_name=f"retrofit-data-{ENVIRONMENT}" - ) save_data_to_s3( data=msgpack.packb(cleaned_data, use_bin_type=True), s3_file_name="cleaned_epc_data/cleaned.bson", bucket_name=f"retrofit-data-{ENVIRONMENT}" ) + + +if __name__ == "__main__": + print("Initialising cleaner app run") + app() diff --git a/serverless.yml b/serverless.yml index 1c2a5f73..d69e8344 100644 --- a/serverless.yml +++ b/serverless.yml @@ -49,4 +49,5 @@ functions: events: - http: path: /{proxy+} - method: ANY \ No newline at end of file + method: ANY + timeout: 120 \ No newline at end of file