From fc3f011d588b59d97df6478d5eb0b3bb3076ff31 Mon Sep 17 00:00:00 2001 From: Jianrong Date: Sun, 23 Oct 2022 11:01:39 +1100 Subject: [PATCH] Reduce devnet ECS cpu and memory to save cost & fix a bug in travis where aws is not installed --- .travis.yml | 4 ++-- cicd/devnet/terraform/ecs.tf | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e46167bfa..75810cd898 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/cicd/devnet/terraform/ecs.tf b/cicd/devnet/terraform/ecs.tf index 65f69bdf0d..c0ca738166 100644 --- a/cicd/devnet/terraform/ecs.tf +++ b/cicd/devnet/terraform/ecs.tf @@ -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"