Skip to content

Commit 01532d1

Browse files
committed
feat: reserve cpu for formsg app
1 parent 99a9511 commit 01532d1

File tree

8 files changed

+12
-0
lines changed

8 files changed

+12
-0
lines changed

.github/workflows/deploy-ecs-prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ecr-repository: 'formsg'
2727
# ECS configuration
2828
ecs-cpu: 1024
29+
formsg-app-reserved-cpu: 896
2930
ecs-memory: 4096
3031
ecs-cluster-name: 'formsg-prod-ecs'
3132
ecs-service-name: 'formsg-prod-ecs-service'

.github/workflows/deploy-ecs-stg-alt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ecr-repository: 'formsg'
2727
# ECS configuration
2828
ecs-cpu: 1024
29+
formsg-app-reserved-cpu: 896
2930
ecs-memory: 2048
3031
ecs-cluster-name: 'formsg-stg-alt-ecs'
3132
ecs-service-name: 'formsg-stg-alt-ecs-service'

.github/workflows/deploy-ecs-stg-alt2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ecr-repository: 'formsg'
2727
# ECS configuration
2828
ecs-cpu: 1024
29+
formsg-app-reserved-cpu: 896
2930
ecs-memory: 2048
3031
ecs-cluster-name: 'formsg-stg-alt2-ecs'
3132
ecs-service-name: 'formsg-stg-alt2-ecs-service'

.github/workflows/deploy-ecs-stg-alt3.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ecr-repository: 'formsg'
2727
# ECS configuration
2828
ecs-cpu: 1024
29+
formsg-app-reserved-cpu: 896
2930
ecs-memory: 2048
3031
ecs-cluster-name: 'formsg-stg-alt3-ecs'
3132
ecs-service-name: 'formsg-stg-alt3-ecs-service'

.github/workflows/deploy-ecs-stg.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ecr-repository: 'formsg'
2727
# ECS configuration
2828
ecs-cpu: 1024
29+
formsg-app-reserved-cpu: 896
2930
ecs-memory: 2048
3031
ecs-cluster-name: 'formsg-stg-ecs'
3132
ecs-service-name: 'formsg-stg-ecs-service'

.github/workflows/deploy-ecs-uat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
ecr-repository: 'formsg'
2727
# ECS configuration
2828
ecs-cpu: 1024
29+
formsg-app-reserved-cpu: 896
2930
ecs-memory: 2048
3031
ecs-cluster-name: 'formsg-uat-ecs'
3132
ecs-service-name: 'formsg-uat-ecs-service'

.github/workflows/deploy-ecs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ on:
7171
description: 'FormSG SDK mode'
7272
required: true
7373
type: string
74+
formsg-app-reserved-cpu:
75+
description: 'FormSG app reserved CPU units'
76+
required: true
77+
type: number
7478
dd-env:
7579
description: 'Datadog environment'
7680
required: true
@@ -184,6 +188,7 @@ jobs:
184188
run: |
185189
sed -i "s/<AWS_ACCOUNT_ID>/${{ secrets.aws-account-id }}/g" ${{ inputs.ecs-task-definition-path }}
186190
sed -i 's/<DD_ENV>/${{ inputs.dd-env }}/g' ${{ inputs.ecs-task-definition-path }}
191+
sed -i 's/<FORMSG_APP_RESERVED_CPU>/${{ inputs.formsg-app-reserved-cpu }}/g' ${{ inputs.ecs-task-definition-path }}
187192
sed -i 's/<CPU>/${{ inputs.ecs-cpu }}/g' ${{ inputs.ecs-task-definition-path }}
188193
sed -i 's/<MEMORY>/${{ inputs.ecs-memory }}/g' ${{ inputs.ecs-task-definition-path }}
189194
sed -i 's/<ENVIRONMENT_SITE_NAME>/${{ inputs.environment-site-name }}/g' ${{ inputs.ecs-task-definition-path }}

deploy/ecs-task-definition.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"portMappings": [
77
{ "containerPort": 4545, "hostPort": 4545, "protocol": "tcp" }
88
],
9+
"cpu": "<FORMSG_APP_RESERVED_CPU>",
910
"environment": [
1011
{ "name": "DD_SERVICE", "value": "formsg" },
1112
{ "name": "DD_ENV", "value": "<DD_ENV>" }

0 commit comments

Comments
 (0)