-
Notifications
You must be signed in to change notification settings - Fork 2
NotifAI Performance Improvements #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
37dd81b
0961f90
5e63b2c
aae4b06
30825d3
2fd9889
31409c9
d763608
e59d873
c87b8ef
e942808
5a6bedc
7b3dd0e
f195466
35866ef
42a43e0
4729bdc
e26288b
baff263
01de1cf
ea58e17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| x-aws-environment: &aws-environment | ||
| AWS_DEFAULT_REGION: eu-west-2 | ||
| AWS_REGION: eu-west-2 | ||
| AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} | ||
| AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} | ||
| AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN} | ||
|
|
||
| services: | ||
| frontend: | ||
| build: | ||
| context: src/frontend/notifai-uploader | ||
| ports: | ||
| - "3000:80" | ||
| depends_on: | ||
| - backend | ||
| - bedrock-prompt-messager | ||
| environment: | ||
| <<: *aws-environment | ||
| REACT_APP_BACKEND_API_BASE_URL: ${REACT_APP_BACKEND_API_BASE_URL} | ||
| REACT_APP_COGNITO_ID: ${COGNITO_APP_CLIENT_ID} | ||
| REACT_APP_COGNITO_USER_POOL_ID: ${COGNITO_USER_POOL_ID} | ||
| REACT_APP_API_GATEWAY: ${REACT_APP_API_GATEWAY} | ||
| healthcheck: | ||
| test: ["CMD", "curl", "http://localhost:80/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 30s | ||
|
|
||
| backend: | ||
| build: | ||
| context: src/backend/app | ||
| ports: | ||
| - "8080:8080" | ||
| entrypoint: | ||
| [ | ||
| "fastapi", | ||
| "dev", | ||
| "/app/main.py", | ||
| "--port", | ||
| "8080", | ||
| "--host", | ||
| "0.0.0.0", | ||
| "--reload", | ||
| ] | ||
| volumes: | ||
| - "${PWD}/src/backend/app:/app" | ||
| environment: | ||
| <<: *aws-environment | ||
| COGNITO_REGION: ${AWS_REGION} | ||
| COGNITO_USER_POOL_ID: ${COGNITO_USER_POOL_ID} | ||
| COGNITO_APP_CLIENT_ID: COGNITO_APP_CLIENT_ID | ||
| S3_LLM_LOGS_BUCKET: ${S3_LLM_LOGS_BUCKET} | ||
| S3_LLM_LOGS_DIRECTORY: ${S3_LLM_LOGS_DIRECTORY} | ||
| S3_LLM_LOGS_BUCKET_ACCOUNT_ID: ${S3_LLM_LOGS_BUCKET_ACCOUNT_ID} | ||
| healthcheck: | ||
| test: | ||
| [ | ||
| "CMD", | ||
| "python3", | ||
| "-c", | ||
| "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')", | ||
| ] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 30s | ||
|
|
||
| bedrock-prompt-messager: | ||
| build: | ||
| context: src/backend/bedrock-prompt-messager | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8081:8080" | ||
| volumes: | ||
| - "${PWD}/src/backend/bedrock-prompt-messager:/var/task" | ||
| environment: | ||
| <<: *aws-environment | ||
| env_model_id: "amazon.nova-lite-v1:0" | ||
| env_temperature: "0.1" | ||
| env_max_tokens: "10000" | ||
| env_top_p: "0.5" | ||
| env_logging_s3_bucket: ${S3_LLM_LOGS_BUCKET} | ||
| env_logging_s3_key_prefix: ${S3_LLM_LOGS_DIRECTORY} | ||
| env_guardrail_arn: ${GUARDRAIL_ARN} | ||
| env_guardrail_version: ${GUARDRAIL_VERSION} | ||
| env_logging_s3_account_id: ${S3_LLM_LOGS_BUCKET_ACCOUNT_ID} | ||
| # FEAT_EXTENDED_ADVICE: true | ||
| healthcheck: | ||
| test: ["CMD", "curl", "http://localhost:8080/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 30s | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ module "eventbridge" { | |
| arn = aws_lambda_function.bedrock_evaluations.arn | ||
| input = jsonencode({ "job" : "cron-by-rate" }) | ||
| role_arn = aws_iam_role.eventbridge_scheduler_role.arn | ||
|
|
||
| end_date = "2025-12-16T00:00:00Z" | ||
| } | ||
|
Comment on lines
14
to
17
|
||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,7 @@ data "aws_iam_policy_document" "bedrock_access" { | |||||
| "${aws_s3_bucket.lambda_prompt_logging_s3_bucket.arn}/${local.s3_lambda_logging_key}*", | ||||||
| "arn:aws:bedrock:${var.region}:${var.aws_account_id}:guardrail/*", | ||||||
| "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-pro-v1:*", | ||||||
|
||||||
| "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-pro-v1:*", | |
| "arn:aws:bedrock:${var.region}:${var.aws_account_id}:inference-profile/eu.amazon.nova-lite-v1:*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend is started with
fastapi dev /app/main.py, butmain.pyimports modules asfrom app.... In this container layout, that typically requiresPYTHONPATHto include the parent directory of theapppackage (mirroringpytest.ini: pythonpath = src/backend). Without settingPYTHONPATH(or switching to module-style startup likefastapi dev app.main:app), the backend may fail to start withModuleNotFoundError: No module named 'app'.