refactor to distribute validators via beacon-node role

This way we can deploy multiple nodes on the same host.
https://github.com/status-im/infra-nimbus/issues/52

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-06-28 16:41:04 +02:00
parent 5122d41a99
commit a99a6d0fc6
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
12 changed files with 59 additions and 36 deletions

View File

@ -48,8 +48,3 @@ beacon_node_max_peers: 320
# resource limits # resource limits
beacon_node_mem_limit: '{{ (ansible_memtotal_mb * 0.60) | int }}' beacon_node_mem_limit: '{{ (ansible_memtotal_mb * 0.60) | int }}'
beacon_node_mem_reserve: '{{ (ansible_memtotal_mb * 0.4) | int }}' beacon_node_mem_reserve: '{{ (ansible_memtotal_mb * 0.4) | int }}'
# Validators --------------------------
dist_validators_cont_name: '{{ beacon_node_cont_name }}'
dist_validators_name: '{{ beacon_node_network }}_deposits'
dist_validators_data_path: '{{ beacon_node_cont_vol }}/data/{{ beacon_node_data_folder }}'

View File

@ -1,9 +1,2 @@
--- ---
beacon_node_cont_tag: 'stable-large' 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 }

View File

@ -1,9 +1,2 @@
--- ---
beacon_node_cont_tag: 'testing-large' 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 }

View File

@ -1,4 +1,2 @@
--- ---
beacon_node_cont_tag: 'unstable-libp2p-stable-large' beacon_node_cont_tag: 'unstable-libp2p-stable-large'
dist_validators_layout:
"u-libp2p-s-large-01.aws-eu-central-1a.nimbus.prater": { start: 37500, end: 38750 } # 1250

View File

@ -1,4 +1,2 @@
--- ---
beacon_node_cont_tag: 'unstable-libp2p-unstable-large' beacon_node_cont_tag: 'unstable-libp2p-unstable-large'
dist_validators_layout:
"u-libp2p-u-large-01.aws-eu-central-1a.nimbus.prater": { start: 38750, end: 40000 } # 1250

View File

@ -1,9 +1,2 @@
--- ---
beacon_node_cont_tag: 'unstable-large' 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 }

View File

@ -1,2 +1,32 @@
--- ---
beacon_node_network: 'prater' beacon_node_network: 'prater'
# Split by hostname for more central location
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 }
# 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 }
# 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 }
# 1250 validators per node
'u-libp2p-s-large-01.aws-eu-central-1a.nimbus.prater': { start: 37500, end: 38750 }
# 1250 validators per node
'u-libp2p-u-large-01.aws-eu-central-1a.nimbus.prater': { start: 38750, end: 40000 }
# Copy correct validators from nimbus-private repo
beacon_node_dist_validators_enabled: true
beacon_node_dist_validators_start: '{{ validators_layout[hostname]["start"] | mandatory }}'
beacon_node_dist_validators_end: '{{ validators_layout[hostname]["end"] | mandatory }}'

View File

@ -0,0 +1,25 @@
---
beacon_node_network: 'pyrmont'
# Split by hostname for more central location
validators_layout:
# bootstrap nodes
"testing-small-03.aws-eu-central-1a.nimbus.pyrmont": { start: 0, end: 0 } # none
"testing-small-04.aws-eu-central-1a.nimbus.pyrmont": { start: 0, end: 0 } # none
"stable-large-01.aws-eu-central-1a.nimbus.pyrmont": { start: 0, end: 2500 } # 2500
"stable-small-01.aws-eu-central-1a.nimbus.pyrmont": { start: 2500, end: 4500 } # 2500
"testing-large-01.aws-eu-central-1a.nimbus.pyrmont": { start: 4500, end: 7750 } # 3250
"testing-small-01.aws-eu-central-1a.nimbus.pyrmont": { start: 7750, end: 9750 } # 2000
"testing-small-02.aws-eu-central-1a.nimbus.pyrmont": { start: 9750, end: 10750 } # 1000
"unstable-large-01.aws-eu-central-1a.nimbus.pyrmont": { start: 10750, end: 14750 } # 4000
"unstable-large-02.aws-eu-central-1a.nimbus.pyrmont": { start: 14750, end: 16750 } # 2000
"unstable-small-01.aws-eu-central-1a.nimbus.pyrmont": { start: 16750, end: 18250 } # 1500
"unstable-small-02.aws-eu-central-1a.nimbus.pyrmont": { start: 18250, end: 18850 } # 600
"unstable-small-03.aws-eu-central-1a.nimbus.pyrmont": { start: 18850, end: 18999 } # 149
"unstable-small-04.aws-eu-central-1a.nimbus.pyrmont": { start: 18999, end: 19000 } # single validator
"unstable-libp2p-small-01.aws-eu-central-1a.nimbus.pyrmont": { start: 19000, end: 20000 } # 1000
# Copy correct validators from nimbus-private repo
beacon_node_dist_validators_enabled: true
eacon_node_dist_validators_start: '{{ validators_layout[hostname]["start"] | mandatory }}'
beacon_node_dist_validators_end: '{{ validators_layout[hostname]["end"] | mandatory }}'

View File

@ -40,5 +40,7 @@ beacon_node_web3_urls: [ 'ws://geth:{{ geth_websocket_port }}' ]
# Disabled for genesis to avoid missing first two slots # Disabled for genesis to avoid missing first two slots
beacon_node_doppelganger_detection: false beacon_node_doppelganger_detection: false
dist_validators_layout: # Copy correct validators from nimbus-private repo
"qmerge-large-01.aws-eu-central-1a.nimbus.rayonism": { start: 0, end: 2400 } beacon_node_dist_validators_enabled: true
beacon_node_dist_validators_start: 0
beacon_node_dist_validators_end: 2400

View File

@ -28,8 +28,6 @@
- nimbus-prater-testing - nimbus-prater-testing
- nimbus-prater-unstable - nimbus-prater-unstable
roles: roles:
- role: distribute-validators
tags: distribute-validators
- role: get-geth-web3-urls - role: get-geth-web3-urls
tags: get-geth-web3-urls tags: get-geth-web3-urls
- role: infra-role-beacon-node - role: infra-role-beacon-node

View File

@ -26,6 +26,5 @@
any_errors_fatal: true any_errors_fatal: true
hosts: 'nimbus.pyrmont' hosts: 'nimbus.pyrmont'
roles: roles:
- { role: distribute-validators, tags: [ distribute-validators ] }
- { role: get-geth-web3-urls, tags: [ get-geth-web3-urls ] } - { role: get-geth-web3-urls, tags: [ get-geth-web3-urls ] }
- { role: infra-role-beacon-node, tags: [ infra-role-beacon-node, beacon-node ] } - { role: infra-role-beacon-node, tags: [ infra-role-beacon-node, beacon-node ] }

View File

@ -16,5 +16,4 @@
hosts: 'nimbus.rayonism' hosts: 'nimbus.rayonism'
roles: roles:
- { role: infra-role-geth, tags: [ infra-role-geth ] } - { role: infra-role-geth, tags: [ infra-role-geth ] }
- { role: distribute-validators, tags: [ distribute-validators ] }
- { role: infra-role-beacon-node, tags: [ infra-role-beacon-node, beacon-node ] } - { role: infra-role-beacon-node, tags: [ infra-role-beacon-node, beacon-node ] }