Skip to content
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

Add more memory to Fargate tasks and cleanup logging #2541

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions backend/worker/generate_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,4 @@ pe_reports_path="${pe_reports_path%/pe-reports}/pe_reports"
# Copy database.ini to the module's installation directory
cp /app/pe-reports/src/pe_reports/data/database.ini "${pe_reports_path}/data/"

cat /app/pe-reports/src/pe_reports/data/database.ini

exec "$@"
2 changes: 1 addition & 1 deletion backend/worker/pe-worker-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ while true; do
if [ "$IS_LOCAL" = true ]; then
ORG=$(echo "$MESSAGE" | jq -r '.org')
else
ORG=$(echo "$MESSAGE" | jq -r '.Messages[0].Body | capture("org: \"(?<org>[^\"]+)\"") | .org')
ORG=$(echo "$MESSAGE" | jq -r '.Messages[0].Body | fromjson | .org')
fi

if [[ "$SERVICE_TYPE" = *"shodan"* ]]; then
Expand Down
37 changes: 26 additions & 11 deletions infrastructure/pe_worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ resource "aws_ecs_task_definition" "pe_dnstwist_worker" {

# CPU and memory values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

cpu = 256 # .25 vCPU
memory = 512 # 512 MB

cpu = 2048
memory = 16384
tags = {
Project = var.project
Stage = var.stage
Expand All @@ -190,6 +189,9 @@ resource "aws_ecs_service" "dnstwist_service" {
security_groups = [aws_security_group.worker.id]
assign_public_ip = true
}
lifecycle {
ignore_changes = [desired_count]
}
}

# P&E Shodan Task Definition
Expand Down Expand Up @@ -322,8 +324,8 @@ resource "aws_ecs_task_definition" "pe_shodan_worker" {

# CPU and memory values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

cpu = 256 # .25 vCPU
memory = 512 # 512 MB
cpu = 2048
memory = 16384

tags = {
Project = var.project
Expand All @@ -343,6 +345,9 @@ resource "aws_ecs_service" "shodan_service" {
security_groups = [aws_security_group.worker.id]
assign_public_ip = true
}
lifecycle {
ignore_changes = [desired_count]
}
}

# P&E HIBP Task Definition
Expand Down Expand Up @@ -475,8 +480,8 @@ resource "aws_ecs_task_definition" "pe_hibp_worker" {

# CPU and memory values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

cpu = 256 # .25 vCPU
memory = 512 # 512 MB
cpu = 2048
memory = 16384

tags = {
Project = var.project
Expand All @@ -497,6 +502,9 @@ resource "aws_ecs_service" "hibp_service" {
security_groups = [aws_security_group.worker.id]
assign_public_ip = true
}
lifecycle {
ignore_changes = [desired_count]
}
}

# P&E IntelX Task Definition
Expand Down Expand Up @@ -629,8 +637,8 @@ resource "aws_ecs_task_definition" "pe_intelx_worker" {

# CPU and memory values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

cpu = 256 # .25 vCPU
memory = 512 # 512 MB
cpu = 2048
memory = 16384

tags = {
Project = var.project
Expand All @@ -651,6 +659,10 @@ resource "aws_ecs_service" "intelx_service" {
security_groups = [aws_security_group.worker.id]
assign_public_ip = true
}

lifecycle {
ignore_changes = [desired_count]
}
}

# P&E Cybersixgill Task Definition
Expand Down Expand Up @@ -783,8 +795,8 @@ resource "aws_ecs_task_definition" "pe_cybersixgill_worker" {

# CPU and memory values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

cpu = 256 # .25 vCPU
memory = 512 # 512 MB
cpu = 2048
memory = 16384

tags = {
Project = var.project
Expand All @@ -805,6 +817,9 @@ resource "aws_ecs_service" "cybersixgill_service" {
security_groups = [aws_security_group.worker.id]
assign_public_ip = true
}
lifecycle {
ignore_changes = [desired_count]
}
}

# Create the log group
Expand Down
Loading