From 662e456d069ef699bb8895310df33f4d4bc05a54 Mon Sep 17 00:00:00 2001 From: Arthur Koziel Date: Thu, 18 Mar 2021 12:59:45 +0800 Subject: [PATCH] add config for prater testnet Signed-off-by: Arthur Koziel --- ansible/group_vars/nimbus-prater-libp2p.yml | 4 + ansible/group_vars/nimbus-prater-stable.yml | 9 ++ ansible/group_vars/nimbus-prater-testing.yml | 9 ++ ansible/group_vars/nimbus-prater-unstable.yml | 9 ++ ansible/group_vars/nimbus.prater.yml | 8 ++ ansible/prater.yml | 39 ++++++ prater.tf | 120 ++++++++++++++++++ 7 files changed, 198 insertions(+) create mode 100644 ansible/group_vars/nimbus-prater-libp2p.yml create mode 100644 ansible/group_vars/nimbus-prater-stable.yml create mode 100644 ansible/group_vars/nimbus-prater-testing.yml create mode 100644 ansible/group_vars/nimbus-prater-unstable.yml create mode 100644 ansible/group_vars/nimbus.prater.yml create mode 100644 ansible/prater.yml create mode 100644 prater.tf diff --git a/ansible/group_vars/nimbus-prater-libp2p.yml b/ansible/group_vars/nimbus-prater-libp2p.yml new file mode 100644 index 0000000..304fb6e --- /dev/null +++ b/ansible/group_vars/nimbus-prater-libp2p.yml @@ -0,0 +1,4 @@ +--- +beacon_node_cont_tag: 'libp2p-large' +dist_validators_layout: + "libp2p-large-01.aws-eu-central-1a.nimbus.prater": { start: 37500, end: 40000 } # 2500 diff --git a/ansible/group_vars/nimbus-prater-stable.yml b/ansible/group_vars/nimbus-prater-stable.yml new file mode 100644 index 0000000..6d55d31 --- /dev/null +++ b/ansible/group_vars/nimbus-prater-stable.yml @@ -0,0 +1,9 @@ +--- +beacon_node_cont_tag: 'stable-large' +dist_validators_layout: + # 2500 validators per node + "stable-large-01.aws-eu-central-1a.nimbus.prater": { start: 0, end: 2500 } + "stable-large-02.aws-eu-central-1a.nimbus.prater": { start: 2500, end: 5000 } + "stable-large-03.aws-eu-central-1a.nimbus.prater": { start: 5000, end: 7500 } + "stable-large-04.aws-eu-central-1a.nimbus.prater": { start: 7500, end: 10000 } + "stable-large-05.aws-eu-central-1a.nimbus.prater": { start: 10000, end: 12500 } diff --git a/ansible/group_vars/nimbus-prater-testing.yml b/ansible/group_vars/nimbus-prater-testing.yml new file mode 100644 index 0000000..40f7828 --- /dev/null +++ b/ansible/group_vars/nimbus-prater-testing.yml @@ -0,0 +1,9 @@ +--- +beacon_node_cont_tag: 'testing-large' +dist_validators_layout: + # 2500 validators per node + "testing-large-01.aws-eu-central-1a.nimbus.prater": { start: 12500, end: 15000 } + "testing-large-02.aws-eu-central-1a.nimbus.prater": { start: 15000, end: 17500 } + "testing-large-03.aws-eu-central-1a.nimbus.prater": { start: 17500, end: 20000 } + "testing-large-04.aws-eu-central-1a.nimbus.prater": { start: 20000, end: 22500 } + "testing-large-05.aws-eu-central-1a.nimbus.prater": { start: 22500, end: 25000 } diff --git a/ansible/group_vars/nimbus-prater-unstable.yml b/ansible/group_vars/nimbus-prater-unstable.yml new file mode 100644 index 0000000..91d8098 --- /dev/null +++ b/ansible/group_vars/nimbus-prater-unstable.yml @@ -0,0 +1,9 @@ +--- +beacon_node_cont_tag: 'unstable-large' +dist_validators_layout: + # 2500 validators per node + "unstable-large-01.aws-eu-central-1a.nimbus.prater": { start: 25000, end: 27500 } + "unstable-large-02.aws-eu-central-1a.nimbus.prater": { start: 27500, end: 30000 } + "unstable-large-03.aws-eu-central-1a.nimbus.prater": { start: 30000, end: 32500 } + "unstable-large-04.aws-eu-central-1a.nimbus.prater": { start: 32500, end: 35000 } + "unstable-large-05.aws-eu-central-1a.nimbus.prater": { start: 35000, end: 37500 } diff --git a/ansible/group_vars/nimbus.prater.yml b/ansible/group_vars/nimbus.prater.yml new file mode 100644 index 0000000..2ef3e97 --- /dev/null +++ b/ansible/group_vars/nimbus.prater.yml @@ -0,0 +1,8 @@ +--- +beacon_node_network: 'prater' + +# We are running v2 on all hosts prior to the official release in order +# to reduce the I/O load on all servers. On the large servers where we +# have enough capacity, we're running the `both` mode that checks that +# the new slashing DB logic behaves precisely as the old one. +beacon_node_slashing_db_kind: '{{ (hostname is search("large")) | ternary("both", "v2") }}' diff --git a/ansible/prater.yml b/ansible/prater.yml new file mode 100644 index 0000000..c5a104c --- /dev/null +++ b/ansible/prater.yml @@ -0,0 +1,39 @@ +--- +- name: Pre-playbook checks + hosts: localhost + tasks: + - name: 'Verify Ansible version is 2.8 or newer' + assert: + that: 'ansible_version.full is version_compare("2.8", ">=")' + msg: 'Your Ansible version is lower than 2.8. Upgrade it.' + +- name: Configure build nodes + become: true + hosts: + - testing-large-01.aws-eu-central-1a.nimbus.pyrmont + roles: + - { role: beacon-node-builds, tags: beacon-node-builds } + +- name: Configure network prater + become: true + # To avoid clashing/duplicate validators. + any_errors_fatal: true + hosts: + - nimbus-prater-stable + - nimbus-prater-testing + - nimbus-prater-unstable + - nimbus-prater-libp2p + pre_tasks: + - name: Discover Goerli Geth WebSocket endpoint + tags: [ infra-role-beacon-node, beacon-node ] + uri: + url: '{{ consul_catalog_url }}/service/geth-goerli-ws' + register: geth_service + + - name: Extract Goerli Geth WebSocket URL + tags: [ infra-role-beacon-node, beacon-node ] + set_fact: + beacon_node_web3_url: 'ws://{{ geth_service.json[0].ServiceAddress }}:{{ geth_service.json[0].ServicePort }}' + roles: + - { role: distribute-validators, tags: [ distribute-validators ] } + - { role: infra-role-beacon-node, tags: [ infra-role-beacon-node, beacon-node ] } diff --git a/prater.tf b/prater.tf new file mode 100644 index 0000000..083e7cb --- /dev/null +++ b/prater.tf @@ -0,0 +1,120 @@ +locals { + /* Volumes */ + prater_root_vol_size = 20 + prater_data_vol_size = 50 + prater_data_vol_type = "io1" + prater_data_vol_iops = 2500 + /* Instances */ + prater_large_instance_type = "z1d.large" +} + +module "nimbus_nodes_prater_stable_large" { + source = "github.com/status-im/infra-tf-amazon-web-services" + + name = "stable-large" + env = "nimbus" + stage = "prater" + group = "nimbus-prater-stable" + domain = var.domain + + /* Scaling */ + instance_type = local.prater_large_instance_type + root_vol_size = local.prater_root_vol_size + data_vol_size = local.prater_data_vol_size + data_vol_type = local.prater_data_vol_type + data_vol_iops = local.prater_data_vol_iops + host_count = 5 + + /* Firewall */ + open_udp_ports = local.nimbus_ports + open_tcp_ports = local.nimbus_ports + + /* Plumbing */ + vpc_id = module.nimbus_network.vpc.id + subnet_id = module.nimbus_network.subnets[0].id + secgroup_id = module.nimbus_network.secgroup.id + keypair_name = aws_key_pair.jakubgs.key_name +} + +module "nimbus_nodes_prater_testing_large" { + source = "github.com/status-im/infra-tf-amazon-web-services" + + name = "testing-large" + env = "nimbus" + stage = "prater" + group = "nimbus-prater-testing" + domain = var.domain + + /* Scaling */ + instance_type = local.prater_large_instance_type + root_vol_size = local.prater_root_vol_size + data_vol_size = local.prater_data_vol_size + data_vol_type = local.prater_data_vol_type + data_vol_iops = local.prater_data_vol_iops + host_count = 5 + + /* Firewall */ + open_udp_ports = local.nimbus_ports + open_tcp_ports = local.nimbus_ports + + /* Plumbing */ + vpc_id = module.nimbus_network.vpc.id + subnet_id = module.nimbus_network.subnets[0].id + secgroup_id = module.nimbus_network.secgroup.id + keypair_name = aws_key_pair.jakubgs.key_name +} + +module "nimbus_nodes_prater_unstable_large" { + source = "github.com/status-im/infra-tf-amazon-web-services" + + name = "unstable-large" + env = "nimbus" + stage = "prater" + group = "nimbus-prater-unstable" + domain = var.domain + + /* Scaling */ + instance_type = local.prater_large_instance_type + root_vol_size = local.prater_root_vol_size + data_vol_size = local.prater_data_vol_size + data_vol_type = local.prater_data_vol_type + data_vol_iops = local.prater_data_vol_iops + host_count = 5 + + /* Firewall */ + open_udp_ports = local.nimbus_ports + open_tcp_ports = local.nimbus_ports + + /* Plumbing */ + vpc_id = module.nimbus_network.vpc.id + subnet_id = module.nimbus_network.subnets[0].id + secgroup_id = module.nimbus_network.secgroup.id + keypair_name = aws_key_pair.jakubgs.key_name +} + +module "nimbus_nodes_prater_libp2p_large" { + source = "github.com/status-im/infra-tf-amazon-web-services" + + name = "libp2p-large" + env = "nimbus" + stage = "prater" + group = "nimbus-prater-libp2p" + domain = var.domain + + /* Scaling */ + instance_type = local.prater_large_instance_type + root_vol_size = local.prater_root_vol_size + data_vol_size = local.prater_data_vol_size + data_vol_type = local.prater_data_vol_type + host_count = 1 + + /* Firewall */ + open_udp_ports = local.nimbus_ports + open_tcp_ports = local.nimbus_ports + + /* Plumbing */ + vpc_id = module.nimbus_network.vpc.id + subnet_id = module.nimbus_network.subnets[0].id + secgroup_id = module.nimbus_network.secgroup.id + keypair_name = aws_key_pair.jakubgs.key_name +}