From 4eaab1e80bb19ec9b3c09b7cf0d18c1a04814e3e Mon Sep 17 00:00:00 2001 From: DaMandal0rian <3614052+DaMandal0rian@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:20:02 +0300 Subject: [PATCH] add auto domain to testing framework AWS PT.2 (#312) * extend auto domain testing framework AWS decouple domains to 2 separate ones - add autoid domain * bump traefik release --- .../ec2/base/autoid_node_provisioner.tf | 181 ++++++++++++++++++ .../base/bootstrap_node_autoid_provisioner.tf | 171 +++++++++++++++++ .../base/bootstrap_node_evm_provisioner.tf | 6 +- .../ec2/base/domain_node_provisioner.tf | 9 +- testing-framework/ec2/base/instances.tf | 126 ++++++++++++ testing-framework/ec2/base/outputs.tf | 31 +++ .../create_autoid_node_compose_file.sh | 151 +++++++++++++++ ...eate_bootstrap_node_autoid_compose_file.sh | 172 +++++++++++++++++ .../create_bootstrap_node_evm_compose_file.sh | 15 +- .../create_domain_node_compose_file.sh | 6 +- .../base/scripts/create_node_compose_file.sh | 2 +- testing-framework/ec2/base/variables.tf | 55 +++++- testing-framework/ec2/network/main.tf | 43 ++++- testing-framework/ec2/network/outputs.tf | 16 +- testing-framework/ec2/network/variables.tf | 16 +- 15 files changed, 967 insertions(+), 33 deletions(-) create mode 100644 testing-framework/ec2/base/autoid_node_provisioner.tf create mode 100644 testing-framework/ec2/base/bootstrap_node_autoid_provisioner.tf create mode 100644 testing-framework/ec2/base/scripts/create_autoid_node_compose_file.sh create mode 100644 testing-framework/ec2/base/scripts/create_bootstrap_node_autoid_compose_file.sh diff --git a/testing-framework/ec2/base/autoid_node_provisioner.tf b/testing-framework/ec2/base/autoid_node_provisioner.tf new file mode 100644 index 00000000..2a9466f2 --- /dev/null +++ b/testing-framework/ec2/base/autoid_node_provisioner.tf @@ -0,0 +1,181 @@ +locals { + autoid_node_ip_v4 = flatten([ + [aws_instance.autoid_node.*.public_ip] + ] + ) +} + +resource "null_resource" "setup-autoid-nodes" { + count = length(local.autoid_node_ip_v4) + + depends_on = [aws_instance.autoid_node] + + # trigger on node ip changes + triggers = { + cluster_instance_ipv4s = join(",", local.autoid_node_ip_v4) + } + + connection { + host = local.autoid_node_ip_v4[count.index] + user = var.ssh_user + type = "ssh" + agent = true + private_key = file("${var.private_key_path}") + timeout = "300s" + } + + # create subspace dir + provisioner "remote-exec" { + inline = [ + "sudo mkdir -p /home/${var.ssh_user}/subspace/", + "sudo chown -R ${var.ssh_user}:${var.ssh_user} /home/${var.ssh_user}/subspace/ && sudo chmod -R 750 /home/${var.ssh_user}/subspace/" + ] + } + + # copy install file + provisioner "file" { + source = "${var.path_to_scripts}/installer.sh" + destination = "/home/${var.ssh_user}/subspace/installer.sh" + } + + # copy acme.sh file + provisioner "file" { + source = "${var.path_to_scripts}/acme.sh" + destination = "/home/${var.ssh_user}/subspace/acme.sh" + } + + # install docker and docker compose + provisioner "remote-exec" { + inline = [ + "sudo bash /home/${var.ssh_user}/subspace/installer.sh", + ] + } + + # clone testing branch + provisioner "remote-exec" { + inline = [ + "cd /home/${var.ssh_user}/subspace/", + "git clone https://github.com/subspace/subspace.git", + "cd subspace", + "git checkout ${var.branch_name}" + ] + } + +} + +resource "null_resource" "prune-autoid-nodes" { + count = var.autoid-node-config.prune ? length(local.autoid_node_ip_v4) : 0 + depends_on = [null_resource.setup-autoid-nodes] + + triggers = { + prune = var.autoid-node-config.prune + } + + connection { + host = local.autoid_node_ip_v4[count.index] + user = var.ssh_user + type = "ssh" + agent = true + private_key = file("${var.private_key_path}") + timeout = "300s" + } + + provisioner "file" { + source = "${var.path_to_scripts}/prune_docker_system.sh" + destination = "/home/${var.ssh_user}/subspace/prune_docker_system.sh" + } + + # prune network + provisioner "remote-exec" { + inline = [ + "sudo bash /home/${var.ssh_user}/subspace/prune_docker_system.sh" + ] + } +} + +resource "null_resource" "start-autoid-nodes" { + count = length(local.autoid_node_ip_v4) + + depends_on = [null_resource.setup-autoid-nodes] + + # trigger on node deployment version change + triggers = { + deployment_version = var.autoid-node-config.deployment-version + reserved_only = var.autoid-node-config.reserved-only + } + + connection { + host = local.autoid_node_ip_v4[count.index] + user = var.ssh_user + type = "ssh" + agent = true + private_key = file("${var.private_key_path}") + timeout = "300s" + } + + # copy node keys file + provisioner "file" { + source = "./autoid_node_keys.txt" + destination = "/home/${var.ssh_user}/subspace/node_keys.txt" + } + + # copy boostrap node keys file + provisioner "file" { + source = "./bootstrap_node_keys.txt" + destination = "/home/${var.ssh_user}/subspace/bootstrap_node_keys.txt" + } + + # copy dsn_boostrap node keys file + provisioner "file" { + source = "./dsn_bootstrap_node_keys.txt" + destination = "/home/${var.ssh_user}/subspace/dsn_bootstrap_node_keys.txt" + } + + # copy keystore + provisioner "file" { + source = "./keystore" + destination = "/home/${var.ssh_user}/subspace/subspace/keystore/" + } + + # copy relayer ids + provisioner "file" { + source = "./relayer_ids.txt" + destination = "/home/${var.ssh_user}/subspace/relayer_ids.txt" + } + + # copy compose file creation script + provisioner "file" { + source = "${var.path_to_scripts}/create_autoid_node_compose_file.sh" + destination = "/home/${var.ssh_user}/subspace/create_compose_file.sh" + } + + # start docker containers + provisioner "remote-exec" { + inline = [ + # set hostname + "sudo hostnamectl set-hostname ${var.network_name}-autoid-node-${count.index}", + + # create .env file + "echo REPO_ORG=${var.autoid-node-config.repo-org} > /home/${var.ssh_user}/subspace/.env", + "echo DOCKER_TAG=${var.autoid-node-config.docker-tag} >> /home/${var.ssh_user}/subspace/.env", + "echo NETWORK_NAME=${var.network_name} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_PREFIX_AUTO=${var.autoid-node-config.domain-prefix[1]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_LABEL_AUTO=${var.autoid-node-config.domain-labels[1]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_ID_AUTO=${var.autoid-node-config.domain-id[1]} >> /home/${var.ssh_user}/subspace/.env", + "echo NODE_ID=${count.index} >> /home/${var.ssh_user}/subspace/.env", + "echo NODE_KEY=$(sed -nr 's/NODE_${count.index}_KEY=//p' /home/${var.ssh_user}/subspace/node_keys.txt) >> /home/${var.ssh_user}/subspace/.env", + "echo PIECE_CACHE_SIZE=${var.piece_cache_size} >> /home/${var.ssh_user}/subspace/.env", + "echo NODE_DSN_PORT=${var.autoid-node-config.node-dsn-port} >> /home/${var.ssh_user}/subspace/.env", + + # create docker compose file + "bash /home/${var.ssh_user}/subspace/create_compose_file.sh ${var.bootstrap-node-config.reserved-only} ${length(local.autoid_node_ip_v4)} ${count.index} ${length(local.bootstrap_nodes_ip_v4)} ${var.autoid-node-config.enable-domains} ${var.autoid-node-config.domain-id[0]}", + + # create acme.json file + "bash /home/${var.ssh_user}/subspace/acme.sh", + + # start subspace domain node + "cp -f /home/${var.ssh_user}/subspace/.env /home/${var.ssh_user}/subspace/subspace/.env", + "sudo docker compose -f /home/${var.ssh_user}/subspace/subspace/docker-compose.yml up -d", + ] + } +} diff --git a/testing-framework/ec2/base/bootstrap_node_autoid_provisioner.tf b/testing-framework/ec2/base/bootstrap_node_autoid_provisioner.tf new file mode 100644 index 00000000..1e953e29 --- /dev/null +++ b/testing-framework/ec2/base/bootstrap_node_autoid_provisioner.tf @@ -0,0 +1,171 @@ +locals { + bootstrap_nodes_autoid_ip_v4 = flatten([ + [aws_instance.bootstrap_node_autoid.*.public_ip] + ] + ) +} + +resource "null_resource" "setup-bootstrap-nodes-autoid" { + count = length(local.bootstrap_nodes_autoid_ip_v4) + + depends_on = [aws_instance.bootstrap_node_autoid] + + # trigger on node ip changes + triggers = { + cluster_instance_ipv4s = join(",", local.bootstrap_nodes_autoid_ip_v4) + } + + connection { + host = local.bootstrap_nodes_autoid_ip_v4[count.index] + user = var.ssh_user + type = "ssh" + agent = true + private_key = file("${var.private_key_path}") + timeout = "300s" + } + + # create subspace dir + provisioner "remote-exec" { + inline = [ + "sudo mkdir -p /home/${var.ssh_user}/subspace/", + "sudo chown -R ${var.ssh_user}:${var.ssh_user} /home/${var.ssh_user}/subspace/ && sudo chmod -R 750 /home/${var.ssh_user}/subspace/" + ] + } + + # copy install file + provisioner "file" { + source = "${var.path_to_scripts}/installer.sh" + destination = "/home/${var.ssh_user}/subspace/installer.sh" + } + + # install docker and docker compose + provisioner "remote-exec" { + inline = [ + "chmod +x /home/${var.ssh_user}/subspace/installer.sh", + "sudo bash /home/${var.ssh_user}/subspace/installer.sh", + ] + } + + # clone testing branch + provisioner "remote-exec" { + inline = [ + "cd /home/${var.ssh_user}/subspace/", + "git clone https://github.com/subspace/subspace.git", + "cd subspace", + "git checkout ${var.branch_name}" + ] + } + +} + +resource "null_resource" "prune-bootstrap-nodes-autoid" { + count = var.bootstrap-node-autoid-config.prune ? length(local.bootstrap_nodes_autoid_ip_v4) : 0 + depends_on = [null_resource.setup-bootstrap-nodes-autoid] + + triggers = { + prune = var.bootstrap-node-autoid-config.prune + } + + connection { + host = local.bootstrap_nodes_autoid_ip_v4[count.index] + user = var.ssh_user + type = "ssh" + agent = true + private_key = file("${var.private_key_path}") + timeout = "300s" + } + + provisioner "file" { + source = "${var.path_to_scripts}/prune_docker_system.sh" + destination = "/home/${var.ssh_user}/subspace/prune_docker_system.sh" + } + + # prune network + provisioner "remote-exec" { + inline = [ + "sudo bash /home/${var.ssh_user}/subspace/prune_docker_system.sh" + ] + } +} + +resource "null_resource" "start-bootstrap-nodes-autoid" { + count = length(local.bootstrap_nodes_autoid_ip_v4) + + depends_on = [null_resource.setup-bootstrap-nodes-autoid] + + # trigger on node deployment version change + triggers = { + deployment_version = var.bootstrap-node-autoid-config.deployment-version + reserved_only = var.bootstrap-node-autoid-config.reserved-only + } + + connection { + host = local.bootstrap_nodes_autoid_ip_v4[count.index] + user = var.ssh_user + type = "ssh" + agent = true + private_key = file("${var.private_key_path}") + timeout = "300s" + } + + # copy bootstrap node keys file + provisioner "file" { + source = "./bootstrap_node_autoid_keys.txt" + destination = "/home/${var.ssh_user}/subspace/node_keys.txt" + } + + # copy boostrap node keys file + provisioner "file" { + source = "./bootstrap_node_keys.txt" + destination = "/home/${var.ssh_user}/subspace/bootstrap_node_keys.txt" + } + + # copy DSN bootstrap node keys file + provisioner "file" { + source = "./dsn_bootstrap_node_keys.txt" + destination = "/home/${var.ssh_user}/subspace/dsn_bootstrap_node_keys.txt" + } + + # copy relayer ids + provisioner "file" { + source = "./relayer_ids.txt" + destination = "/home/${var.ssh_user}/subspace/relayer_ids.txt" + } + + # copy compose file creation script + provisioner "file" { + source = "${var.path_to_scripts}/create_bootstrap_node_autoid_compose_file.sh" + destination = "/home/${var.ssh_user}/subspace/create_compose_file.sh" + } + + # start docker containers + provisioner "remote-exec" { + inline = [ + # set hostname + "sudo hostnamectl set-hostname ${var.network_name}-bootstrap-node-autoid-${count.index}", + + # create .env file + "echo REPO_ORG=${var.bootstrap-node-autoid-config.repo-org} > /home/${var.ssh_user}/subspace/.env", + "echo DOCKER_TAG=${var.bootstrap-node-autoid-config.docker-tag} >> /home/${var.ssh_user}/subspace/.env", + "echo NETWORK_NAME=${var.network_name} >> /home/${var.ssh_user}/subspace/.env", + "echo NODE_ID=${count.index} >> /home/${var.ssh_user}/subspace/.env", + "echo NODE_KEY=$(sed -nr 's/NODE_${count.index}_KEY=//p' /home/${var.ssh_user}/subspace/node_keys.txt) >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_LABEL_AUTO=${var.domain-node-config.domain-labels[1]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_ID_AUTO=${var.domain-node-config.domain-id[1]} >> /home/${var.ssh_user}/subspace/.env", + "echo PIECE_CACHE_SIZE=${var.piece_cache_size} >> /home/${var.ssh_user}/subspace/.env", + "echo DSN_NODE_ID=${count.index} >> /home/${var.ssh_user}/subspace/.env", + "echo DSN_NODE_KEY=$(sed -nr 's/NODE_${count.index}_DSN_KEY=//p' /home/${var.ssh_user}/subspace/node_keys.txt) >> /home/${var.ssh_user}/subspace/.env", + "echo DSN_LISTEN_PORT=${var.bootstrap-node-autoid-config.dsn-listen-port} >> /home/${var.ssh_user}/subspace/.env", + "echo NODE_DSN_PORT=${var.bootstrap-node-autoid-config.node-dsn-port} >> /home/${var.ssh_user}/subspace/.env", + "echo OPERATOR_PORT=${var.bootstrap-node-autoid-config.operator-port} >> /home/${var.ssh_user}/subspace/.env", + "echo GENESIS_HASH=${var.bootstrap-node-autoid-config.genesis-hash} >> /home/${var.ssh_user}/subspace/.env", + + # create docker compose file + "bash /home/${var.ssh_user}/subspace/create_compose_file.sh ${var.bootstrap-node-autoid-config.reserved-only} ${length(local.bootstrap_nodes_autoid_ip_v4)} ${count.index} ${length(local.bootstrap_nodes_ip_v4)} ${var.domain-node-config.enable-domains} ", + + # start subspace bootstrap autoid node + "cp -f /home/${var.ssh_user}/subspace/.env /home/${var.ssh_user}/subspace/subspace/.env", + "sudo docker compose -f /home/${var.ssh_user}/subspace/subspace/docker-compose.yml up -d", + ] + } +} diff --git a/testing-framework/ec2/base/bootstrap_node_evm_provisioner.tf b/testing-framework/ec2/base/bootstrap_node_evm_provisioner.tf index ad176fe4..900d1890 100644 --- a/testing-framework/ec2/base/bootstrap_node_evm_provisioner.tf +++ b/testing-framework/ec2/base/bootstrap_node_evm_provisioner.tf @@ -150,10 +150,8 @@ resource "null_resource" "start-bootstrap-nodes-evm" { "echo NETWORK_NAME=${var.network_name} >> /home/${var.ssh_user}/subspace/.env", "echo NODE_ID=${count.index} >> /home/${var.ssh_user}/subspace/.env", "echo NODE_KEY=$(sed -nr 's/NODE_${count.index}_KEY=//p' /home/${var.ssh_user}/subspace/node_keys.txt) >> /home/${var.ssh_user}/subspace/.env", - "echo DOMAIN_LABEL=${var.domain-node-config.domain-labels[0]} >> /home/${var.ssh_user}/subspace/.env", - "echo DOMAIN_ID=${var.domain-node-config.domain-id[0]} >> /home/${var.ssh_user}/subspace/.env", - "echo RELAYER_SYSTEM_ID=$(sed -nr 's/NODE_${count.index}_RELAYER_SYSTEM_ID=//p' /home/${var.ssh_user}/subspace/relayer_ids.txt) >> /home/${var.ssh_user}/subspace/.env", - "echo RELAYER_DOMAIN_ID=$(sed -nr 's/NODE_${count.index}_RELAYER_DOMAIN_ID=//p' /home/${var.ssh_user}/subspace/relayer_ids.txt) >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_LABEL_EVM=${var.domain-node-config.domain-labels[0]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_ID_EVM=${var.domain-node-config.domain-id[0]} >> /home/${var.ssh_user}/subspace/.env", "echo PIECE_CACHE_SIZE=${var.piece_cache_size} >> /home/${var.ssh_user}/subspace/.env", "echo DSN_NODE_ID=${count.index} >> /home/${var.ssh_user}/subspace/.env", "echo DSN_NODE_KEY=$(sed -nr 's/NODE_${count.index}_DSN_KEY=//p' /home/${var.ssh_user}/subspace/node_keys.txt) >> /home/${var.ssh_user}/subspace/.env", diff --git a/testing-framework/ec2/base/domain_node_provisioner.tf b/testing-framework/ec2/base/domain_node_provisioner.tf index 491e1c24..bc19c667 100644 --- a/testing-framework/ec2/base/domain_node_provisioner.tf +++ b/testing-framework/ec2/base/domain_node_provisioner.tf @@ -159,14 +159,11 @@ resource "null_resource" "start-domain-nodes" { "echo REPO_ORG=${var.domain-node-config.repo-org} > /home/${var.ssh_user}/subspace/.env", "echo DOCKER_TAG=${var.domain-node-config.docker-tag} >> /home/${var.ssh_user}/subspace/.env", "echo NETWORK_NAME=${var.network_name} >> /home/${var.ssh_user}/subspace/.env", - "echo DOMAIN_PREFIX=${var.domain-node-config.domain-prefix} >> /home/${var.ssh_user}/subspace/.env", - # //todo use a map for domain id and labels - "echo DOMAIN_LABEL=${var.domain-node-config.domain-labels[0]} >> /home/${var.ssh_user}/subspace/.env", - "echo DOMAIN_ID=${var.domain-node-config.domain-id[0]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_PREFIX_EVM=${var.domain-node-config.domain-prefix[0]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_LABEL_EVM=${var.domain-node-config.domain-labels[0]} >> /home/${var.ssh_user}/subspace/.env", + "echo DOMAIN_ID_EVM=${var.domain-node-config.domain-id[0]} >> /home/${var.ssh_user}/subspace/.env", "echo NODE_ID=${count.index} >> /home/${var.ssh_user}/subspace/.env", "echo NODE_KEY=$(sed -nr 's/NODE_${count.index}_KEY=//p' /home/${var.ssh_user}/subspace/node_keys.txt) >> /home/${var.ssh_user}/subspace/.env", - "echo RELAYER_SYSTEM_ID=$(sed -nr 's/NODE_${count.index}_RELAYER_SYSTEM_ID=//p' /home/${var.ssh_user}/subspace/relayer_ids.txt) >> /home/${var.ssh_user}/subspace/.env", - "echo RELAYER_DOMAIN_ID=$(sed -nr 's/NODE_${count.index}_RELAYER_DOMAIN_ID=//p' /home/${var.ssh_user}/subspace/relayer_ids.txt) >> /home/${var.ssh_user}/subspace/.env", "echo PIECE_CACHE_SIZE=${var.piece_cache_size} >> /home/${var.ssh_user}/subspace/.env", "echo NODE_DSN_PORT=${var.domain-node-config.node-dsn-port} >> /home/${var.ssh_user}/subspace/.env", diff --git a/testing-framework/ec2/base/instances.tf b/testing-framework/ec2/base/instances.tf index ffa7eb7a..1f6d2fd3 100644 --- a/testing-framework/ec2/base/instances.tf +++ b/testing-framework/ec2/base/instances.tf @@ -126,6 +126,70 @@ resource "aws_instance" "bootstrap_node_evm" { } +resource "aws_instance" "bootstrap_node_autoid" { + count = length(var.aws_region) * var.bootstrap-node-autoid-config.instance-count + ami = data.aws_ami.ubuntu_amd64.image_id + instance_type = var.bootstrap-node-autoid-config.instance-type + subnet_id = element(aws_subnet.public_subnets.*.id, 0) + availability_zone = var.azs + ipv6_address_count = 1 + # Security Group + vpc_security_group_ids = ["${aws_security_group.network_sg.id}"] + # the Public SSH key + key_name = var.aws_key_name + associate_public_ip_address = true + ebs_optimized = true + ebs_block_device { + device_name = "/dev/sda1" + volume_size = var.bootstrap-node-config.disk-volume-size + volume_type = var.bootstrap-node-config.disk-volume-type + iops = 3000 + throughput = 250 + } + + + tags = { + Name = "${var.network_name}-bootstrap-autoid-${count.index}" + name = "${var.network_name}-bootstrap-autoid-${count.index}" + role = "bootstrap node" + os_name = "ubuntu" + os_version = "22.04" + arch = "x86_64" + } + + depends_on = [ + aws_subnet.public_subnets, + #aws_nat_gateway.nat_gateway, + aws_internet_gateway.gw + ] + + lifecycle { + + ignore_changes = [ami, ipv6_address_count] + + } + + provisioner "remote-exec" { + inline = [ + "cloud-init status --wait", + "sudo apt update -y", + ] + + on_failure = continue + + } + + # Setting up the ssh connection + connection { + type = "ssh" + host = element(self.*.public_ip, count.index) + user = var.ssh_user + private_key = file("${var.private_key_path}") + timeout = "300s" + } + +} + resource "aws_instance" "node" { count = length(var.aws_region) * var.node-config.instance-count ami = data.aws_ami.ubuntu_amd64.image_id @@ -253,6 +317,68 @@ resource "aws_instance" "domain_node" { } +resource "aws_instance" "autoid_node" { + count = length(var.aws_region) * var.autoid-node-config.instance-count + ami = data.aws_ami.ubuntu_amd64.image_id + instance_type = var.autoid-node-config.instance-type + subnet_id = element(aws_subnet.public_subnets.*.id, 0) + availability_zone = var.azs + ipv6_address_count = 1 + # Security Group + vpc_security_group_ids = ["${aws_security_group.network_sg.id}"] + # the Public SSH key + key_name = var.aws_key_name + associate_public_ip_address = true + ebs_optimized = true + ebs_block_device { + device_name = "/dev/sda1" + volume_size = var.autoid-node-config.disk-volume-size + volume_type = var.autoid-node-config.disk-volume-type + iops = 3000 + throughput = 250 + } + + tags = { + Name = "${var.network_name}-autoid-${count.index}" + name = "${var.network_name}-autoid-${count.index}" + role = "autoid node" + os_name = "ubuntu" + os_version = "22.04" + arch = "x86_64" + } + + depends_on = [ + aws_subnet.public_subnets, + #aws_nat_gateway.nat_gateway, + aws_internet_gateway.gw + ] + + lifecycle { + + ignore_changes = [ami, ipv6_address_count] + + } + + provisioner "remote-exec" { + inline = [ + "cloud-init status --wait", + "sudo apt update -y", + ] + + on_failure = continue + + } + + # Setting up the ssh connection + connection { + type = "ssh" + host = element(self.*.public_ip, count.index) + user = var.ssh_user + private_key = file("${var.private_key_path}") + timeout = "300s" + } + +} resource "aws_instance" "farmer_node" { count = length(var.aws_region) * var.farmer-node-config.instance-count diff --git a/testing-framework/ec2/base/outputs.tf b/testing-framework/ec2/base/outputs.tf index d92339ff..d1d6313e 100644 --- a/testing-framework/ec2/base/outputs.tf +++ b/testing-framework/ec2/base/outputs.tf @@ -32,6 +32,22 @@ output "bootstrap_node_evm_ami" { value = aws_instance.bootstrap_node_evm.*.ami } +output "bootstrap_node_autoid_server_id" { + value = aws_instance.bootstrap_node_autoid.*.id +} + +output "bootstrap_node_autoid_public_ip" { + value = aws_instance.bootstrap_node_autoid.*.public_ip +} + +output "bootstrap_node_autoid_private_ip" { + value = aws_instance.bootstrap_node_autoid.*.private_ip +} + +output "bootstrap_node_autoid_ami" { + value = aws_instance.bootstrap_node_autoid.*.ami +} + output "node_server_id" { value = aws_instance.node.*.id } @@ -64,6 +80,21 @@ output "domain_node_ami" { value = aws_instance.domain_node.*.ami } +output "autoid_node_server_id" { + value = aws_instance.autoid_node.*.id +} + +output "autoid_node_private_ip" { + value = aws_instance.autoid_node.*.private_ip +} + +output "autoid_node_public_ip" { + value = aws_instance.autoid_node.*.public_ip +} + +output "autoid_node_ami" { + value = aws_instance.autoid_node.*.ami +} output "farmer_node_server_id" { value = aws_instance.farmer_node.*.id diff --git a/testing-framework/ec2/base/scripts/create_autoid_node_compose_file.sh b/testing-framework/ec2/base/scripts/create_autoid_node_compose_file.sh new file mode 100644 index 00000000..07707283 --- /dev/null +++ b/testing-framework/ec2/base/scripts/create_autoid_node_compose_file.sh @@ -0,0 +1,151 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` +EXTERNAL_IP_V6=`curl -s -6 https://ifconfig.me` + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + +networks: + traefik-proxy: + +services: + # traefik reverse proxy with automatic tls management using let encrypt + traefik: + image: traefik:v2.11.3 + container_name: traefik + restart: unless-stopped + command: + - --api=false + - --api.dashboard=false + - --providers.docker + - --log.level=info + - --entrypoints.web.address=:80 + - --entrypoints.web.http.redirections.entryPoint.to=websecure + - --entrypoints.websecure.address=:443 + - --providers.docker=true + - --providers.docker.exposedbydefault=false + - --certificatesresolvers.le.acme.email=alerts@subspace.network + - --certificatesresolvers.le.acme.storage=/acme.json + - --certificatesresolvers.le.acme.tlschallenge=true + - "traefik.docker.network=traefik-proxy" + networks: + - traefik-proxy + ports: + - 80:80 + - 443:443 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./letsencrypt/acme.json:/acme.json + + archival-node: + build: + context: . + dockerfile: /home/ubuntu/subspace/subspace/Dockerfile-node + image: ghcr.io/\${REPO_ORG}/node:\${DOCKER_TAG} + volumes: + - archival_node_data:/var/subspace:rw + - ./keystore:/var/subspace/keystore:ro + restart: unless-stopped + ports: + - "30333:30333/tcp" + - "30333:30333/udp" + - "30433:30433/tcp" + - "30433:30433/udp" + - "30334:30334/tcp" + - "9615:9615" + labels: + - "traefik.enable=true" + - "traefik.http.services.archival-node.loadbalancer.server.port=8944" + - "traefik.http.routers.archival-node.rule=Host(\`\${DOMAIN_PREFIX_AUTO}-\${DOMAIN_ID_AUTO}.\${NETWORK_NAME}.subspace.network\`) && Path(\`/ws\`)" + - "traefik.http.routers.archival-node.tls=true" + - "traefik.http.routers.archival-node.tls.certresolver=le" + - "traefik.http.routers.archival-node.entrypoints=websecure" + - "traefik.http.routers.archival-node.middlewares=redirect-https" + - "traefik.http.middlewares.redirect-https.redirectscheme.scheme=https" + - "traefik.http.middlewares.redirect-https.redirectscheme.permanent=true" + - "traefik.docker.network=traefik-proxy" + networks: + - traefik-proxy + logging: + driver: loki + options: + loki-url: "https://logging.subspace.network/loki/api/v1/push" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "archive", +# "--pot-external-entropy", "\${POT_EXTERNAL_ENTROPY}", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", + "--listen-on", "/ip6/::/tcp/30333", + "--node-key", "\${NODE_KEY}", + "--in-peers", "500", + "--out-peers", "250", + "--rpc-max-connections", "10000", + "--rpc-cors", "all", + "--rpc-listen-on", "0.0.0.0:9944", + "--rpc-methods", "safe", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +reserved_only=${1} +node_count=${2} +current_node=${3} +bootstrap_node_count=${4} +dsn_bootstrap_node_count=${4} +bootstrap_node_autoid_count=${5} +enable_domains=${6} +domain_id=${7} + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" == "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_DSN_MULTI_ADDR=//p" ~/subspace/node_keys.txt) + echo " \"--dsn-external-address\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + fi +done + +for (( i = 0; i < bootstrap_node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR_TCP=//p" ~/subspace//bootstrap_node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +for (( i = 0; i < dsn_bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " \"--dsn-reserved-peers\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--dsn-bootstrap-nodes\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +if [ "${reserved_only}" == "true" ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +if [ "${enable_domains}" == "true" ]; then + { + # auto domain + echo ' "--",' + echo ' "--domain-id", "${DOMAIN_ID_AUTO}",' + echo ' "--state-pruning", "archive",' + echo ' "--blocks-pruning", "archive",' + echo ' "--operator-id", "0",' + echo ' "--listen-on", "/ip4/0.0.0.0/tcp/30334",' + echo ' "--listen-on", "/ip6/::/tcp/30334",' + echo ' "--rpc-cors", "all",' + echo ' "--rpc-methods", "safe",' + echo ' "--rpc-listen-on", "0.0.0.0:8944",' + + for (( i = 0; i < bootstrap_node_autoid_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR_TCP=//p" ~/subspace/bootstrap_node_autoid_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + done + + } >> ~/subspace/subspace/docker-compose.yml +fi + +echo ' ]' >> ~/subspace/subspace/docker-compose.yml diff --git a/testing-framework/ec2/base/scripts/create_bootstrap_node_autoid_compose_file.sh b/testing-framework/ec2/base/scripts/create_bootstrap_node_autoid_compose_file.sh new file mode 100644 index 00000000..2f3eb5ae --- /dev/null +++ b/testing-framework/ec2/base/scripts/create_bootstrap_node_autoid_compose_file.sh @@ -0,0 +1,172 @@ +#!/bin/bash + +EXTERNAL_IP=`curl -s -4 https://ifconfig.me` +EXTERNAL_IP_V6=`curl -s -6 https://ifconfig.me` + +reserved_only=${1} +node_count=${2} +current_node=${3} +bootstrap_node_count=${4} +enable_domains=${5} + +cat > ~/subspace/subspace/docker-compose.yml << EOF +version: "3.7" + +volumes: + archival_node_data: {} + +services: + dsn-bootstrap-node: + build: + context: . + dockerfile: /home/ubuntu/subspace/subspace/Dockerfile-bootstrap-node + image: ghcr.io/\${REPO_ORG}/bootstrap-node:\${DOCKER_TAG} + restart: unless-stopped + environment: + - RUST_LOG=info + ports: + - "30533:30533/tcp" + - "30533:30533/udp" + - "9616:9616" + logging: + driver: loki + options: + loki-url: "https://logging.subspace.network/loki/api/v1/push" + command: + - start + - "--metrics-endpoints=0.0.0.0:9616" + - "--keypair" + - \${DSN_NODE_KEY} + - "--listen-on" + - /ip4/0.0.0.0/udp/30533/quic-v1 + - "--listen-on" + - /ip4/0.0.0.0/tcp/30533 + - "--listen-on" + - /ip6/::/udp/30533/quic-v1 + - "--listen-on" + - /ip6/::/tcp/30533 + - --protocol-version + - \${GENESIS_HASH} + - "--in-peers" + - "1000" + - "--out-peers" + - "1000" + - "--pending-in-peers" + - "1000" + - "--pending-out-peers" + - "1000" + # - "--external-address" + # - "/ip4/$EXTERNAL_IP/udp/30533/quic-v1" + # - "--external-address" + # - "/ip4/$EXTERNAL_IP/tcp/30533" + # - "--external-address" + # - "/ip6/$EXTERNAL_IP_V6/udp/30533/quic-v1" + # - "--external-address" + # - "/ip6/$EXTERNAL_IP_V6/tcp/30533" +EOF + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" == "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_DSN_MULTI_ADDR=//p" ~/subspace/node_keys.txt) + echo " - \"--external-address\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + dsn_addr=$(sed -nr "s/NODE_${i}_DSN_MULTI_ADDR_TCP=//p" ~/subspace/node_keys.txt) + echo " - \"--external-address\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + fi +done + +for (( i = 0; i < bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " - \"--reserved-peers\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"--bootstrap-nodes\"" >> ~/subspace/subspace/docker-compose.yml + echo " - \"${dsn_addr}\"" >> ~/subspace/subspace/docker-compose.yml +done + +cat >> ~/subspace/subspace/docker-compose.yml << EOF + archival-node: + build: + context: . + dockerfile: /home/ubuntu/subspace/subspace/Dockerfile-node + image: ghcr.io/\${REPO_ORG}/node:\${DOCKER_TAG} + volumes: + - archival_node_data:/var/subspace:rw + restart: unless-stopped + ports: + - "30333:30333/udp" + - "30333:30333/tcp" + - "30433:30433/udp" + - "30433:30433/tcp" + - "\${OPERATOR_PORT}:30334/tcp" + - "9615:9615" + logging: + driver: loki + options: + loki-url: "https://logging.subspace.network/loki/api/v1/push" + command: [ + "run", + "--chain", "\${NETWORK_NAME}", + "--base-path", "/var/subspace", + "--state-pruning", "archive", + "--blocks-pruning", "256", +# "--pot-external-entropy", "\${POT_EXTERNAL_ENTROPY}", + "--listen-on", "/ip4/0.0.0.0/tcp/30333", + "--listen-on", "/ip6/::/tcp/30333", +## comment to disable external addresses using IP format for now +# "--dsn-external-address", "/ip4/$EXTERNAL_IP/udp/30433/quic-v1", +# "--dsn-external-address", "/ip4/$EXTERNAL_IP/tcp/30433", +# "--dsn-external-address", "/ip6/$EXTERNAL_IP_V6/udp/30433/quic-v1", +# "--dsn-external-address", "/ip6/$EXTERNAL_IP_V6/tcp/30433", + "--node-key", "\${NODE_KEY}", + "--in-peers", "1000", + "--out-peers", "1000", + "--dsn-in-connections", "1000", + "--dsn-out-connections", "1000", + "--dsn-pending-in-connections", "1000", + "--dsn-pending-out-connections", "1000", + "--prometheus-listen-on", "0.0.0.0:9615", +EOF + +for (( i = 0; i < node_count; i++ )); do + if [ "${current_node}" == "${i}" ]; then + dsn_addr=$(sed -nr "s/NODE_${i}_DSN_OPERATOR_MULTI_ADDR=//p" ~/subspace/node_keys.txt) + echo " \"--dsn-external-address\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + fi +done + +for (( i = 0; i < bootstrap_node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_MULTI_ADDR_TCP=//p" ~/subspace/bootstrap_node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +for (( i = 0; i < dsn_bootstrap_node_count; i++ )); do + dsn_addr=$(sed -nr "s/NODE_${i}_SUBSPACE_MULTI_ADDR=//p" ~/subspace/dsn_bootstrap_node_keys.txt) + echo " \"--dsn-reserved-peers\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--dsn-bootstrap-nodes\", \"${dsn_addr}\"," >> ~/subspace/subspace/docker-compose.yml +done + +if [ "${reserved_only}" == true ]; then + echo " \"--reserved-only\"," >> ~/subspace/subspace/docker-compose.yml +fi + +if [ "${enable_domains}" == "true" ]; then + { + # auto domain + echo ' "--",' + echo ' "--domain-id", "${DOMAIN_ID_AUTO}",' + echo ' "--state-pruning", "archive",' + echo ' "--blocks-pruning", "archive",' + echo ' "--listen-on", "/ip4/0.0.0.0/tcp/${OPERATOR_PORT}",' + echo ' "--rpc-cors", "all",' + echo ' "--rpc-listen-on", "0.0.0.0:8944",' + for (( i = 0; i < node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_OPERATOR_MULTI_ADDR_TCP=//p" ~/subspace/node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + done + + } >> ~/subspace/subspace/docker-compose.yml +fi +echo ' ]' >> ~/subspace/subspace/docker-compose.yml diff --git a/testing-framework/ec2/base/scripts/create_bootstrap_node_evm_compose_file.sh b/testing-framework/ec2/base/scripts/create_bootstrap_node_evm_compose_file.sh index 945747fb..892d8d8d 100644 --- a/testing-framework/ec2/base/scripts/create_bootstrap_node_evm_compose_file.sh +++ b/testing-framework/ec2/base/scripts/create_bootstrap_node_evm_compose_file.sh @@ -155,7 +155,20 @@ if [ "${enable_domains}" == "true" ]; then { # core domain echo ' "--",' - echo ' "--domain-id", "${DOMAIN_ID}",' + echo ' "--domain-id", "${DOMAIN_ID_EVM}",' + echo ' "--state-pruning", "archive",' + echo ' "--blocks-pruning", "archive",' + echo ' "--listen-on", "/ip4/0.0.0.0/tcp/${OPERATOR_PORT}",' + echo ' "--rpc-cors", "all",' + echo ' "--rpc-listen-on", "0.0.0.0:8944",' + for (( i = 0; i < node_count; i++ )); do + addr=$(sed -nr "s/NODE_${i}_OPERATOR_MULTI_ADDR_TCP=//p" ~/subspace/node_keys.txt) + echo " \"--reserved-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + echo " \"--bootstrap-nodes\", \"${addr}\"," >> ~/subspace/subspace/docker-compose.yml + done + # auto domain + echo ' "--",' + echo ' "--domain-id", "${DOMAIN_ID_AUTO}",' echo ' "--state-pruning", "archive",' echo ' "--blocks-pruning", "archive",' echo ' "--listen-on", "/ip4/0.0.0.0/tcp/${OPERATOR_PORT}",' diff --git a/testing-framework/ec2/base/scripts/create_domain_node_compose_file.sh b/testing-framework/ec2/base/scripts/create_domain_node_compose_file.sh index de7aaaa2..3ec792e5 100644 --- a/testing-framework/ec2/base/scripts/create_domain_node_compose_file.sh +++ b/testing-framework/ec2/base/scripts/create_domain_node_compose_file.sh @@ -15,7 +15,7 @@ networks: services: # traefik reverse proxy with automatic tls management using let encrypt traefik: - image: traefik:v2.10 + image: traefik:v2.11.3 container_name: traefik restart: unless-stopped command: @@ -60,7 +60,7 @@ services: labels: - "traefik.enable=true" - "traefik.http.services.archival-node.loadbalancer.server.port=8944" - - "traefik.http.routers.archival-node.rule=Host(\`\${DOMAIN_PREFIX}.\${NETWORK_NAME}.subspace.network\`) && Path(\`/ws\`)" + - "traefik.http.routers.archival-node.rule=Host(\`\${DOMAIN_PREFIX_EVM}-\${DOMAIN_ID_EVM}.\${NETWORK_NAME}.subspace.network\`) && Path(\`/ws\`)" - "traefik.http.routers.archival-node.tls=true" - "traefik.http.routers.archival-node.tls.certresolver=le" - "traefik.http.routers.archival-node.entrypoints=websecure" @@ -129,7 +129,7 @@ if [ "${enable_domains}" == "true" ]; then { # core domain echo ' "--",' - echo ' "--domain-id", "${DOMAIN_ID}",' + echo ' "--domain-id", "${DOMAIN_ID_EVM}",' echo ' "--state-pruning", "archive",' echo ' "--blocks-pruning", "archive",' echo ' "--operator-id", "0",' diff --git a/testing-framework/ec2/base/scripts/create_node_compose_file.sh b/testing-framework/ec2/base/scripts/create_node_compose_file.sh index d68abeea..b02597d2 100644 --- a/testing-framework/ec2/base/scripts/create_node_compose_file.sh +++ b/testing-framework/ec2/base/scripts/create_node_compose_file.sh @@ -15,7 +15,7 @@ networks: services: # traefik reverse proxy with automatic tls management using let encrypt traefik: - image: traefik:v2.10 + image: traefik:v2.11.3 container_name: traefik restart: unless-stopped command: diff --git a/testing-framework/ec2/base/variables.tf b/testing-framework/ec2/base/variables.tf index 423d1bae..a83fa3f0 100644 --- a/testing-framework/ec2/base/variables.tf +++ b/testing-framework/ec2/base/variables.tf @@ -19,11 +19,13 @@ variable "azs" { variable "instance_count" { type = map(number) default = { - bootstrap = 1 - node = 1 - domain = 1 - farmer = 1 - evm_bootstrap = 1 + bootstrap = 1 + node = 1 + domain = 1 + autoid = 1 + farmer = 1 + evm_bootstrap = 1 + autoid_bootstrap = 1 } } @@ -85,7 +87,28 @@ variable "domain-node-config" { instance-count = number repo-org = string docker-tag = string - domain-prefix = string + domain-prefix = list(string) + reserved-only = bool + prune = bool + node-dsn-port = number + enable-domains = bool + domain-id = list(number) + domain-labels = list(string) + disk-volume-size = number + disk-volume-type = string + }) +} + +variable "autoid-node-config" { + description = "Autoid node deployment config" + type = object({ + instance-type = string + deployment-version = number + regions = list(string) + instance-count = number + repo-org = string + docker-tag = string + domain-prefix = list(string) reserved-only = bool prune = bool node-dsn-port = number @@ -136,6 +159,26 @@ variable "bootstrap-node-evm-config" { }) } +variable "bootstrap-node-autoid-config" { + description = "Bootstrap node autoid domain deployment config" + type = object({ + instance-type = string + deployment-version = number + regions = list(string) + instance-count = number + repo-org = string + docker-tag = string + reserved-only = bool + prune = bool + genesis-hash = string + dsn-listen-port = number + node-dsn-port = number + operator-port = number + disk-volume-size = number + disk-volume-type = string + }) +} + variable "farmer-node-config" { description = "Farmer and Node configuration" type = object({ diff --git a/testing-framework/ec2/network/main.tf b/testing-framework/ec2/network/main.tf index 60871b6b..2c14fa36 100644 --- a/testing-framework/ec2/network/main.tf +++ b/testing-framework/ec2/network/main.tf @@ -36,6 +36,23 @@ module "network" { disk-volume-type = var.disk_volume_type } + bootstrap-node-autoid-config = { + instance-type = var.instance_type + deployment-version = 1 + regions = var.aws_region + instance-count = var.instance_count["autoid_bootstrap"] + repo-org = "subspace" + docker-tag = var.branch_name + reserved-only = false + prune = false + genesis-hash = var.genesis_hash + dsn-listen-port = 30533 + node-dsn-port = 30433 + operator-port = 30334 + disk-volume-size = var.disk_volume_size + disk-volume-type = var.disk_volume_type + } + node-config = { instance-type = var.instance_type deployment-version = 1 @@ -57,7 +74,25 @@ module "network" { instance-count = var.instance_count["domain"] repo-org = "subspace" docker-tag = var.branch_name - domain-prefix = "domain" + domain-prefix = ["nova", "auto"] + reserved-only = false + prune = false + node-dsn-port = 30433 + enable-domains = true + domain-id = var.domain_id + domain-labels = var.domain_labels + disk-volume-size = var.disk_volume_size + disk-volume-type = var.disk_volume_type + } + + autoid-node-config = { + instance-type = var.instance_type + deployment-version = 1 + regions = var.aws_region + instance-count = var.instance_count["autoid"] + repo-org = "subspace" + docker-tag = var.branch_name + domain-prefix = ["autoid"] reserved-only = false prune = false node-dsn-port = 30433 @@ -99,6 +134,10 @@ module "network" { } # External data source to run the shell command and extract the value of the operator bootnode connection parameter -data "external" "operator_peer_multiaddr" { +data "external" "operator_peer_evm_multiaddr" { program = ["bash", "-c", "echo '{\"OPERATOR_MULTI_ADDR\": \"'$(sed -nr 's/^NODE_0_OPERATOR_MULTI_ADDR=(.*)/\\1/p' ./bootstrap_node_evm_keys.txt)'\"}'"] } + +data "external" "operator_peer_autoid_multiaddr" { + program = ["bash", "-c", "echo '{\"OPERATOR_MULTI_ADDR\": \"'$(sed -nr 's/^NODE_0_OPERATOR_MULTI_ADDR=(.*)/\\1/p' ./bootstrap_node_autoid_keys.txt)'\"}'"] +} diff --git a/testing-framework/ec2/network/outputs.tf b/testing-framework/ec2/network/outputs.tf index 8619973b..6ab5bc1a 100644 --- a/testing-framework/ec2/network/outputs.tf +++ b/testing-framework/ec2/network/outputs.tf @@ -19,12 +19,22 @@ output "bootstrap-node-evm-ipv4-addresses" { description = "Bootstrap node evm IPv4 Addresses" } +output "bootstrap-node-autoid-ipv4-addresses" { + value = module.network.bootstrap_node_autoid_public_ip + description = "Bootstrap node autoid IPv4 Addresses" +} + output "domain-node-ipv4-addresses" { value = module.network.domain_node_public_ip description = "Domain node IPv4 Addresses" } -# Output the operator_peer_multiaddr value -output "operator_peer_multiaddr" { - value = data.external.operator_peer_multiaddr.result +# Output the operator_peer_evm_multiaddr value +output "operator_peer_evm_multiaddr" { + value = data.external.operator_peer_evm_multiaddr.result +} + +# Output the operator_peer_autoid_multiaddr value +output "operator_peer_autoid_multiaddr" { + value = data.external.operator_peer_autoid_multiaddr.result } diff --git a/testing-framework/ec2/network/variables.tf b/testing-framework/ec2/network/variables.tf index 3fc39536..5ca5273f 100644 --- a/testing-framework/ec2/network/variables.tf +++ b/testing-framework/ec2/network/variables.tf @@ -7,14 +7,14 @@ variable "farmer_reward_address" { variable "domain_id" { description = "Domain ID" type = list(number) - default = [0] + default = [0, 1] } //todo change this to a map variable "domain_labels" { description = "Tag of the domain to run" type = list(string) - default = ["evm"] + default = ["nova", "autoid"] } variable "instance_type" { @@ -45,11 +45,13 @@ variable "azs" { variable "instance_count" { type = map(number) default = { - bootstrap = 1 - node = 1 - farmer = 1 - domain = 1 - evm_bootstrap = 1 + bootstrap = 1 + node = 1 + farmer = 1 + domain = 1 + autoid = 1 + evm_bootstrap = 1 + autoid_bootstrap = 1 } }