-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate email sending mechanism from AWS Lambda to Celery task queue (#…
…500) * Configure Celery workers on local machine * Move email rendering from AWS Lambda to Celery * Build emails before building backend and cleanup workers directory * Pass necessary env variables to email renderer script * Refactor backend and migraitons stack by extracting common resources to re-usable functions * Implement a Celery workers CDK stack * Rename Task class to LambdaTask in backend. Cleanup workers dir * Add flower service to ECS * Write documentation for introduced changes * Add spot capacity provider to flower service * Remove esbuild from workers and ignore infra+scripts from sonar * Add a simple test for the send_email celery task * Add missing env vars to backend tests * Add more missing envs
- Loading branch information
1 parent
a084d2e
commit c017ee5
Showing
91 changed files
with
1,175 additions
and
939 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
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 |
---|---|---|
|
@@ -11,8 +11,8 @@ ENVIRONMENT_NAME=local | |
[email protected] | ||
ADMIN_DEFAULT_PASSWORD=password | ||
|
||
TASKS_LOCAL_URL=http://workers:3005 | ||
TASKS_BASE_HANDLER=common.tasks.TaskLocalInvoke | ||
LAMBDA_TASKS_LOCAL_URL=http://workers:3005 | ||
LAMBDA_TASKS_BASE_HANDLER=common.tasks.LambdaTaskLocalInvoke | ||
|
||
DB_CONNECTION={"dbname":"backend","username":"backend","password":"backend","host":"db","port":5432} | ||
REDIS_CONNECTION=redis://redis:6379 | ||
|
@@ -43,4 +43,13 @@ AWS_XRAY_SDK_ENABLED=False | |
|
||
OTP_AUTH_ISSUER_NAME=example.com | ||
|
||
OPENAI_API_KEY=<CHANGE_ME> | ||
OPENAI_API_KEY=<CHANGE_ME> | ||
|
||
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend | ||
EMAIL_HOST=mailcatcher | ||
EMAIL_PORT=1025 | ||
[email protected] | ||
[email protected] | ||
|
||
VITE_EMAIL_ASSETS_URL=http://localhost:3000/email-assets | ||
VITE_WEB_APP_URL=http://localhost:3000 |
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 |
---|---|---|
|
@@ -10,4 +10,6 @@ docs/ | |
|
||
# Coverage | ||
.coverage | ||
coverage.xml | ||
coverage.xml | ||
|
||
scripts/runtime/email/renderer/* |
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ REDIS_CONNECTION=redis://redis:6379 | |
|
||
WORKERS_EVENT_BUS_NAME=local-workers | ||
|
||
TASKS_BASE_HANDLER=common.tasks.Task | ||
LAMBDA_TASKS_BASE_HANDLER=common.tasks.LambdaTask | ||
|
||
AWS_DEFAULT_REGION=eu-west-1 | ||
PARENT_HOST=example.org | ||
|
@@ -31,4 +31,10 @@ AWS_ENDPOINT_URL= | |
|
||
OTP_AUTH_ISSUER_NAME=example.com | ||
|
||
OPENAI_API_KEY=sk-example | ||
OPENAI_API_KEY=sk-example | ||
|
||
EMAIL_BACKEND=django.core.mail.backends.locmem.EmailBackend | ||
EMAIL_FROM_ADDRESS=[email protected] | ||
EMAIL_REPLY_ADDRESS=[email protected] | ||
VITE_EMAIL_ASSETS_URL=http://localhost:3000/email-assets | ||
VITE_WEB_APP_URL=http://localhost:3000 |
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
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
Oops, something went wrong.