diff --git a/.github/workflows/devnet-deploys.yml b/.github/workflows/devnet-deploys.yml index a2b09291c1e..1120fef4628 100644 --- a/.github/workflows/devnet-deploys.yml +++ b/.github/workflows/devnet-deploys.yml @@ -3,6 +3,10 @@ on: push: branches: [devnet] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} GIT_COMMIT: ${{ github.sha }} @@ -56,10 +60,10 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-west-2 - - name: Deploy Bootstrap Nodes - working-directory: ./yarn-project/aztec/terraform/node + - name: Deploy P2P Bootstrap Nodes + working-directory: ./yarn-project/p2p-bootstrap/terraform run: | - terraform init -input=false -backend-config="key=devnet/aztec-node" + terraform init -input=false -backend-config="key=devnet/p2p-bootstrap" terraform apply -input=false -auto-approve - name: Deploy Aztec Nodes @@ -67,3 +71,9 @@ jobs: run: | terraform init -input=false -backend-config="key=devnet/aztec-node" terraform apply -input=false -auto-approve + + - name: Deploy Provers + working-directory: ./yarn-project/aztec/terraform/prover + run: | + terraform init -input=false -backend-config="key=devnet/prover" + terraform apply -input=false -auto-approve diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index c0230b06913..e9e1abb4d16 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -1665,4 +1665,4 @@ Now, just remove the `src` folder,: ```rust easy_private_token_contract = {git = "https://github.com/AztecProtocol/aztec-packages/", tag ="v0.17.0", directory = "noir-projects/noir-contracts/contracts/easy_private_token_contract"} -``` +``` \ No newline at end of file diff --git a/yarn-project/aztec/terraform/node/main.tf b/yarn-project/aztec/terraform/node/main.tf index d627d416f0a..d446d334c89 100644 --- a/yarn-project/aztec/terraform/node/main.tf +++ b/yarn-project/aztec/terraform/node/main.tf @@ -57,9 +57,11 @@ locals { publisher_private_keys = [var.SEQ_1_PUBLISHER_PRIVATE_KEY, var.SEQ_2_PUBLISHER_PRIVATE_KEY] node_p2p_private_keys = [var.NODE_1_PRIVATE_KEY, var.NODE_2_PRIVATE_KEY] node_count = length(local.publisher_private_keys) - #node_count = 1 - data_dir = "/usr/src/yarn-project/aztec/data" - agents_per_sequencer = var.AGENTS_PER_SEQUENCER + data_dir = "/usr/src/yarn-project/aztec/data" +} + +output "node_count" { + value = local.node_count } resource "aws_cloudwatch_log_group" "aztec-node-log-group" { @@ -115,20 +117,6 @@ resource "aws_efs_file_system" "node_data_store" { } } -# resource "aws_efs_mount_target" "private_az1" { -# count = local.node_count -# file_system_id = aws_efs_file_system.node_data_store[count.index].id -# subnet_id = data.terraform_remote_state.setup_iac.outputs.subnet_az1_private_id -# security_groups = [data.terraform_remote_state.setup_iac.outputs.security_group_private_id] -# } - -# resource "aws_efs_mount_target" "private_az2" { -# count = local.node_count -# file_system_id = aws_efs_file_system.node_data_store[count.index].id -# subnet_id = data.terraform_remote_state.setup_iac.outputs.subnet_az2_private_id -# security_groups = [data.terraform_remote_state.setup_iac.outputs.security_group_private_id] -# } - resource "aws_efs_mount_target" "public_az1" { count = local.node_count file_system_id = aws_efs_file_system.node_data_store[count.index].id @@ -165,7 +153,7 @@ resource "aws_ecs_task_definition" "aztec-node" { [ { "name": "${var.DEPLOY_TAG}-aztec-node-${count.index + 1}", - "image": "${var.FULL_IMAGE}", + "image": "${var.DOCKERHUB_ACCOUNT}/aztec:${var.DEPLOY_TAG}", "command": ["start", "--node", "--archiver", "--sequencer", "--prover"], "essential": true, "memoryReservation": 3776, @@ -205,7 +193,7 @@ resource "aws_ecs_task_definition" "aztec-node" { }, { "name": "ETHEREUM_HOST", - "value": "https://${var.DEPLOY_TAG}-mainnet-fork.aztec.network:8545/${var.API_KEY}" + "value": "https://aztec-dev-mainnet-fork.aztec.network:8545/${var.API_KEY}" }, { "name": "DATA_DIRECTORY", @@ -357,6 +345,7 @@ resource "aws_ecs_service" "aztec-node" { deployment_maximum_percent = 100 deployment_minimum_healthy_percent = 0 platform_version = "1.4.0" + force_new_deployment = true network_configuration { @@ -373,19 +362,6 @@ resource "aws_ecs_service" "aztec-node" { container_port = 80 } - - # load_balancer { - # target_group_arn = aws_lb_target_group.aztec-node-tcp[count.index].arn - # container_name = "${var.DEPLOY_TAG}-aztec-node-${count.index + 1}" - # container_port = var.NODE_P2P_TCP_PORT + count.index - # } - - # load_balancer { - # target_group_arn = aws_lb_target_group.aztec-node-udp[count.index].arn - # container_name = "${var.DEPLOY_TAG}-aztec-node-${count.index + 1}" - # container_port = var.NODE_P2P_UDP_PORT + count.index - # } - service_registries { registry_arn = aws_service_discovery_service.aztec-node[count.index].arn container_name = "${var.DEPLOY_TAG}-aztec-node-${count.index + 1}" @@ -436,23 +412,6 @@ resource "aws_lb_listener_rule" "api" { } } -# resource "aws_lb_target_group" "aztec-node-tcp" { -# count = local.node_count -# name = "${var.DEPLOY_TAG}-node-${count.index + 1}-p2p-tcp-target" -# port = var.NODE_P2P_TCP_PORT + count.index -# protocol = "TCP" -# target_type = "ip" -# vpc_id = data.terraform_remote_state.setup_iac.outputs.vpc_id - -# health_check { -# protocol = "TCP" -# interval = 10 -# healthy_threshold = 2 -# unhealthy_threshold = 2 -# port = var.NODE_P2P_TCP_PORT + count.index -# } -# } - resource "aws_security_group_rule" "allow-node-tcp-in" { count = local.node_count type = "ingress" @@ -473,40 +432,6 @@ resource "aws_security_group_rule" "allow-node-tcp-out" { security_group_id = data.terraform_remote_state.aztec-network_iac.outputs.p2p_security_group_id } -# resource "aws_lb_listener" "aztec-node-tcp-listener" { -# count = local.node_count -# load_balancer_arn = data.terraform_remote_state.aztec-network_iac.outputs.nlb_arn -# port = var.NODE_P2P_TCP_PORT + count.index -# protocol = "TCP" - -# tags = { -# name = "aztec-node-${count.index}-tcp-listener" -# } - -# default_action { -# type = "forward" -# target_group_arn = aws_lb_target_group.aztec-node-tcp[count.index].arn -# } -# } - - -# resource "aws_lb_target_group" "aztec-node-udp" { -# count = local.node_count -# name = "${var.DEPLOY_TAG}-node-${count.index + 1}-p2p-udp-target" -# port = var.NODE_P2P_UDP_PORT + count.index -# protocol = "UDP" -# target_type = "ip" -# vpc_id = data.terraform_remote_state.setup_iac.outputs.vpc_id - -# health_check { -# protocol = "TCP" -# interval = 10 -# healthy_threshold = 2 -# unhealthy_threshold = 2 -# port = var.NODE_P2P_TCP_PORT + count.index -# } -# } - resource "aws_security_group_rule" "allow-node-udp-in" { type = "ingress" from_port = var.NODE_P2P_UDP_PORT @@ -524,235 +449,3 @@ resource "aws_security_group_rule" "allow-node-udp-out" { cidr_blocks = ["0.0.0.0/0"] security_group_id = data.terraform_remote_state.aztec-network_iac.outputs.p2p_security_group_id } - -# resource "aws_lb_listener" "aztec-node-udp-listener" { -# count = local.node_count -# load_balancer_arn = data.terraform_remote_state.aztec-network_iac.outputs.nlb_arn -# port = var.NODE_P2P_UDP_PORT + count.index -# protocol = "UDP" - -# tags = { -# name = "aztec-node-${count.index}-udp-listener" -# } - -# default_action { -# type = "forward" -# target_group_arn = aws_lb_target_group.aztec-node-udp[count.index].arn -# } -# } - - - -// Configuration for proving agents - -resource "aws_cloudwatch_log_group" "aztec-proving-agent-log-group" { - count = local.node_count - name = "/fargate/service/${var.DEPLOY_TAG}/aztec-proving-agent-group-${count.index + 1}" - retention_in_days = 14 -} - -resource "aws_service_discovery_service" "aztec-proving-agent" { - count = local.node_count - name = "${var.DEPLOY_TAG}-aztec-proving-agent-group-${count.index + 1}" - - health_check_custom_config { - failure_threshold = 1 - } - dns_config { - namespace_id = data.terraform_remote_state.setup_iac.outputs.local_service_discovery_id - dns_records { - ttl = 60 - type = "A" - } - dns_records { - ttl = 60 - type = "SRV" - } - routing_policy = "MULTIVALUE" - } - # Terraform just fails if this resource changes and you have registered instances. - provisioner "local-exec" { - when = destroy - command = "${path.module}/servicediscovery-drain.sh ${self.id}" - } -} - -# Define task definitions for each node. -resource "aws_ecs_task_definition" "aztec-proving-agent" { - count = local.node_count - family = "${var.DEPLOY_TAG}-aztec-proving-agent-group-${count.index + 1}" - requires_compatibilities = ["FARGATE"] - network_mode = "awsvpc" - cpu = "16384" - memory = "98304" - execution_role_arn = data.terraform_remote_state.setup_iac.outputs.ecs_task_execution_role_arn - task_role_arn = data.terraform_remote_state.aztec2_iac.outputs.cloudwatch_logging_ecs_role_arn - container_definitions = <