Reduce devnet ECS cpu and memory to save cost & fix a bug in travis where aws is not installed

This commit is contained in:
Jianrong 2022-10-23 11:01:39 +11:00
parent 772a620a61
commit fc3f011d58
2 changed files with 8 additions and 4 deletions

View file

@ -125,8 +125,6 @@ jobs:
- docker --version # document the version travis is using
- docker build -t xdc-devnet -f cicd/devnet/Dockerfile .
script:
- pip install --user awscli # install aws cli w/o sudo
- export PATH=$PATH:$HOME/.local/bin # put aws in the path
- docker tag xdc-devnet:latest xinfinorg/devnet:latest # Always push to the latest
- docker push xinfinorg/devnet:latest
@ -140,6 +138,8 @@ jobs:
- unzip terraform_"$tf_version"_linux_amd64.zip
- sudo mv terraform /usr/local/bin/
- rm terraform_"$tf_version"_linux_amd64.zip
- pip install --user awscli # install aws cli w/o sudo
- export PATH=$PATH:$HOME/.local/bin # put aws in the path
script:
- echo "Merge detected, executing changes(Devnet)"
- cd cicd/devnet/terraform

View file

@ -21,8 +21,12 @@ resource "aws_ecs_task_definition" "devnet_task_definition_group" {
execution_role_arn = aws_iam_role.devnet_xdc_ecs_tasks_execution_role.arn
task_role_arn = aws_iam_role.devnet_xdc_ecs_tasks_execution_role.arn
cpu = 1024
memory = 2048
# New nodes will consume a lot more CPU usage than existing nodes.
# This is due to sync is resource heavy. Recommending set to below if doing sync:
# CPU = 2048, Memory = 4096
# Please set it back to cpu 512 and memory of 1024 after sync is done to save the cost
cpu = 512
memory = 1024
volume {
name = "efs"