From 5372bfd751b2b61b1ba7cf089b1a81f575d883b8 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 5 Apr 2024 12:40:12 +0000 Subject: [PATCH 1/2] fix: invalid fork terraform --- .circleci/config.yml | 4 ++-- build-system/scripts/deploy_terraform_services | 5 ++++- iac/mainnet-fork/terraform/main.tf | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc2958989a1..3fe7d604c70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1186,7 +1186,7 @@ jobs: name: "Deploy mainnet fork" command: | should_deploy || exit 0 - deploy_terraform_services iac/mainnet-fork + deploy_terraform_services iac/mainnet-fork mainnet-fork mainnet-fork aws_efs_file_system.aztec_mainnet_fork_data_store - run: name: "Release canary to NPM: bb.js" command: | @@ -1244,7 +1244,7 @@ jobs: # Check if l1-contracts have changed if [ "$CONTRACTS_DEPLOYED" -eq 1 ]; then echo "Contracts have changed, taint nodes to force redeploy.." - deploy_terraform_services yarn-project/aztec-node aztec aztec-node "aws_ecs_task_definition.aztec-node[0],aws_ecs_task_definition.aztec-node[1]" + deploy_terraform_services yarn-project/aztec-node aztec aztec-node "aws_ecs_task_definition.aztec-node[0],aws_ecs_task_definition.aztec-node[1]" 1 else deploy_terraform_services yarn-project/aztec-node aztec fi diff --git a/build-system/scripts/deploy_terraform_services b/build-system/scripts/deploy_terraform_services index 7ae1bfa4ec2..f3518263589 100755 --- a/build-system/scripts/deploy_terraform_services +++ b/build-system/scripts/deploy_terraform_services @@ -19,12 +19,15 @@ SERVICE_NAMES=${3:-$PROJECT_NAME} # The terraform resources to taint. Defaults to none. TO_TAINT=${4:-} +# Flag to force a deployment even if no changes are detected. +FORCE_DEPLOY=${5:-} + cd $PROJECT_DIR # Bail out if nothing changed. CONTENT_HASH=$(calculate_content_hash $CHECK_REBUILD_REPOSITORY) echo "Last successfully deployed commit: $CONTENT_HASH" -if [ -z "$TO_TAINT" ] && check_rebuild cache-$CONTENT_HASH-$DEPLOY_TAG-deployed $CHECK_REBUILD_REPOSITORY; then +if [ -z "$FORCE_DEPLOY" ] && check_rebuild cache-$CONTENT_HASH-$DEPLOY_TAG-deployed $CHECK_REBUILD_REPOSITORY; then echo "No changes detected, skipping deployment." exit 0 fi diff --git a/iac/mainnet-fork/terraform/main.tf b/iac/mainnet-fork/terraform/main.tf index e8978b48120..74497ecc2cf 100644 --- a/iac/mainnet-fork/terraform/main.tf +++ b/iac/mainnet-fork/terraform/main.tf @@ -77,8 +77,7 @@ resource "aws_efs_file_system" "aztec_mainnet_fork_data_store" { creation_token = "${var.DEPLOY_TAG}-mainnet-fork-data" tags = { - Name = "${var.DEPLOY_TAG}-mainnet-fork-data" - TaskDefinitionArn = "${aws_ecs_task_definition.aztec_mainnet_fork.arn}" # This line forces recreation on task definition change + Name = "${var.DEPLOY_TAG}-mainnet-fork-data" } lifecycle_policy { From 1d8b48ac1b67338534a457e55d5f62db6c538938 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 5 Apr 2024 15:07:06 +0100 Subject: [PATCH 2/2] remove lifecycle rule --- iac/mainnet-fork/terraform/main.tf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/iac/mainnet-fork/terraform/main.tf b/iac/mainnet-fork/terraform/main.tf index 74497ecc2cf..08198ba5e0b 100644 --- a/iac/mainnet-fork/terraform/main.tf +++ b/iac/mainnet-fork/terraform/main.tf @@ -83,10 +83,6 @@ resource "aws_efs_file_system" "aztec_mainnet_fork_data_store" { lifecycle_policy { transition_to_ia = "AFTER_30_DAYS" } - - lifecycle { - create_before_destroy = true - } } resource "aws_efs_mount_target" "aztec_fork_private_az1" {