mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Merge pull request #199 from Hestia-Homes/main
working on dockerfile and handler and added new s3 bucket
This commit is contained in:
commit
a815e6314c
4 changed files with 25 additions and 9 deletions
|
|
@ -108,6 +108,12 @@ module "retrofit_sap_predictions" {
|
||||||
allowed_origins = var.allowed_origins
|
allowed_origins = var.allowed_origins
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "retrofit_sap_data" {
|
||||||
|
source = "./modules/s3"
|
||||||
|
bucketname = "retrofit-data-${var.stage}"
|
||||||
|
allowed_origins = var.allowed_origins
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Set up the route53 record for the API
|
# Set up the route53 record for the API
|
||||||
module "route53" {
|
module "route53" {
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,22 @@
|
||||||
FROM public.ecr.aws/lambda/python:3.10
|
FROM public.ecr.aws/lambda/python:3.10
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR ${LAMBDA_TASK_ROOT}
|
WORKDIR ${LAMBDA_TASK_ROOT}/simulation_system
|
||||||
|
|
||||||
# Install necessary build tools - required to test locally
|
# Install necessary build tools - required to test locally
|
||||||
# RUN yum install -y gcc python3-devel
|
RUN yum install -y gcc python3-devel
|
||||||
|
|
||||||
# Install python packages
|
# Install python packages
|
||||||
COPY requirements/predictions/predictions.txt ./simulation_system/requirements.txt
|
COPY requirements/predictions/predictions.txt ./simulation_system/requirements.txt
|
||||||
|
COPY requirements/predictions/predictions-dev.txt ./simulation_system/requirements.txt
|
||||||
RUN pip install --no-cache-dir -r ./simulation_system/requirements.txt
|
RUN pip install --no-cache-dir -r ./simulation_system/requirements.txt
|
||||||
|
|
||||||
# Copy the project code to the working directory
|
# Copy the project code to the working directory
|
||||||
COPY ./core ./simulation_system/core
|
COPY ./core ./core
|
||||||
COPY ./MLModel ./simulation_system/MLModel
|
COPY ./MLModel ./MLModel
|
||||||
COPY ./predictions.py ./simulation_system/predictions.py
|
COPY ./predictions.py ./predictions.py
|
||||||
COPY ./handlers/predictions_app.py ./simulation_system/predictions_app.py
|
COPY ./handlers/predictions_app.py ./predictions_app.py
|
||||||
|
COPY ./__init__.py ./__init__.py
|
||||||
|
|
||||||
# Run off a lambda trigger
|
# Run off a lambda trigger
|
||||||
CMD [ "simulation_system.predictions_app.handler" ]
|
CMD [ "predictions_app.handler" ]
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import os
|
import os
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from ..predictions import prediction
|
from predictions import prediction
|
||||||
|
|
||||||
RUNTIME_ENVIRONMENT = os.environ.get("RUNTIME_ENVIRONMENT", "dev")
|
RUNTIME_ENVIRONMENT = os.environ.get("RUNTIME_ENVIRONMENT", "dev")
|
||||||
|
|
||||||
|
|
||||||
def handler(event, context):
|
def handler():
|
||||||
"""
|
"""
|
||||||
Take in event and trigger the prediction pipeline
|
Take in event and trigger the prediction pipeline
|
||||||
"""
|
"""
|
||||||
|
print("HIHIHI")
|
||||||
|
event = {}
|
||||||
|
|
||||||
# Assuming a file in a bucket landing for now?
|
# Assuming a file in a bucket landing for now?
|
||||||
# Assuming we have a model to use
|
# Assuming we have a model to use
|
||||||
|
|
@ -43,3 +45,7 @@ def handler(event, context):
|
||||||
|
|
||||||
except (Exception, KeyError, ValueError):
|
except (Exception, KeyError, ValueError):
|
||||||
print("Prediction failed")
|
print("Prediction failed")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
handler()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
autogluon==0.8.2
|
autogluon==0.8.2
|
||||||
pandas==1.5.3
|
pandas==1.5.3
|
||||||
s3fs==2023.6.0
|
s3fs==2023.6.0
|
||||||
|
seaborn==0.12.2
|
||||||
|
matplotlib==3.7.2
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue