-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from NYPL/use-ecs
Refactor code to run in ECS cluster
- Loading branch information
Showing
8 changed files
with
72 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
FROM public.ecr.aws/lambda/python:3.12 | ||
FROM python:3.12 | ||
|
||
RUN dnf install -y atk cups-libs gtk3 libXcomposite alsa-lib \ | ||
libXcursor libXdamage libXext libXi libXrandr libXScrnSaver \ | ||
libXtst pango at-spi2-atk libXt xorg-x11-server-Xvfb \ | ||
xorg-x11-xauth dbus-glib dbus-glib-devel nss mesa-libgbm jq unzip | ||
RUN apt-get update && \ | ||
apt-get install -y chromium | ||
RUN apt-get install dumb-init | ||
|
||
COPY ./chrome_installer.sh ./chrome_installer.sh | ||
RUN ./chrome_installer.sh | ||
RUN rm ./chrome_installer.sh | ||
ADD . /src | ||
WORKDIR /src | ||
|
||
COPY requirements.txt ${LAMBDA_TASK_ROOT} | ||
COPY requirements.txt ./ | ||
RUN pip install --upgrade pip && \ | ||
pip install -r requirements.txt | ||
|
||
COPY lambda_function.py ${LAMBDA_TASK_ROOT} | ||
COPY alarm_controller.py ${LAMBDA_TASK_ROOT} | ||
COPY alarms ${LAMBDA_TASK_ROOT}/alarms | ||
COPY helpers ${LAMBDA_TASK_ROOT}/helpers | ||
|
||
CMD [ "lambda_function.lambda_handler" ] | ||
COPY . . | ||
ENTRYPOINT ["/usr/bin/dumb-init", "--"] | ||
CMD [ "python3", "./main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
PLAINTEXT_VARIABLES: | ||
ENVIRONMENT: production | ||
AWS_REGION: us-east-1 | ||
SIERRA_DB_PORT: 1032 | ||
SIERRA_DB_NAME: iii | ||
ENVISIONWARE_DB_PORT: 3306 | ||
ENVISIONWARE_DB_NAME: lasttwodays | ||
REDSHIFT_DB_NAME: production | ||
LOG_LEVEL: info | ||
SIERRA_DB_HOST: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGwwagYJKoZIhvcNAQcGoF0wWwIBADBWBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDFrV5IoeP0tL98V0zgIBEIApBnZ9IWKJ/s6F++zu0rOeWwfB+Kkwh4aFt68vD7jv4LaO0zOppTOPycA= | ||
SIERRA_DB_USER: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGcwZQYJKoZIhvcNAQcGoFgwVgIBADBRBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDBMTB2dgzYV4nlEtwwIBEIAky8apvCdg3fDGqaXd06Vq9U59XxG8qlcShPfW9Jp/JiaURhIH | ||
SIERRA_DB_PASSWORD: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGcwZQYJKoZIhvcNAQcGoFgwVgIBADBRBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHcUCu4t+qDgznAz5gIBEIAkL3hNCgiyGOJCAV9meNBRdDfiyfUjaejDGaDWxQsX/DUN6w6Q | ||
ENVISIONWARE_DB_HOST: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGwwagYJKoZIhvcNAQcGoF0wWwIBADBWBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDAuBv/B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yZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHIwcAYJKoZIhvcNAQcGoGMwYQIBADBcBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDFZ9YGTpQHPszq0t1wIBEIAvLZIm3PxGt/z5q1EbArDtz+XOZ0+1seLAL3j4SejbvxFbCnEaJc/WL42V0fUwcAs= | ||
OVERDRIVE_USERNAME: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHAwbgYJKoZIhvcNAQcGoGEwXwIBADBaBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDJ4m/+sM1h1VKWLgNwIBEIAtND4XCBaP9+mnOEWceJuKC3ySzc+fZ0cObPm0Aqww3ie1ZSHFRM491Q7JTlly | ||
OVERDRIVE_PASSWORD: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGowaAYJKoZIhvcNAQcGoFswWQIBADBUBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDMKCbi5y+ipM9MFnOwIBEIAnQKpRBDWG3Mnb3O8FXrx8PCYKYFAqdYMZ75qgY+R9nvooG7VXq1AC | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
PLAINTEXT_VARIABLES: | ||
ENVIRONMENT: qa | ||
AWS_REGION: us-east-1 | ||
SIERRA_DB_PORT: 1032 | ||
SIERRA_DB_NAME: iii | ||
ENVISIONWARE_DB_PORT: 3306 | ||
ENVISIONWARE_DB_NAME: lasttwodays | ||
REDSHIFT_DB_NAME: qa | ||
LOG_LEVEL: info | ||
SIERRA_DB_HOST: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGwwagYJKoZIhvcNAQcGoF0wWw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ND4XCBaP9+mnOEWceJuKC3ySzc+fZ0cObPm0Aqww3ie1ZSHFRM491Q7JTlly | ||
OVERDRIVE_PASSWORD: AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGowaAYJKoZIhvcNAQcGoFswWQIBADBUBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDMKCbi5y+ipM9MFnOwIBEIAnQKpRBDWG3Mnb3O8FXrx8PCYKYFAqdYMZ75qgY+R9nvooG7VXq1AC | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
black | ||
freezegun | ||
nypl-py-utils[mysql-client,postgresql-client,redshift-client,config-helper]==1.1.5 | ||
pytest | ||
pytest-mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
nypl-py-utils[mysql-client,postgresql-client,redshift-client,config-helper]==1.1.5 | ||
nypl-py-utils[mysql-client,postgresql-client,redshift-client,config-helper]==1.3.2 | ||
selenium>=4.10.0 |
This file was deleted.
Oops, something went wrong.