Skip to content

Commit

Permalink
The Merge molecule tests (#573)
Browse files Browse the repository at this point in the history
* ADD: merge support molecule tests

* FIX: use correct length for engine.jwt

* FIX: use latest teku

* FIX: correct settings for el<->cl connection

* FIX: adapt verify for geth-teku el-cl engine check

* FIX: start cl before el generates jwt too

Co-authored-by: NeoPlays <[email protected]>
  • Loading branch information
stefa2k and NeoPlays authored Aug 3, 2022
1 parent 82a64ef commit c9aa16d
Show file tree
Hide file tree
Showing 28 changed files with 323 additions and 366 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@
- "/opt/app/services/{{ teku_service }}/data:/opt/app/data"
- "/opt/app/services/{{ besu_service }}/engine.jwt:/engine.jwt"

# EOF
# EOF
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@
host: "{{ item.address }}"
search_regex: SSH
delay: 10
with_items: "{{ lookup('file', molecule_instance_config) | from_yaml }}"
with_items: "{{ lookup('file', molecule_instance_config) | from_yaml }}"
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
copy:
content: "{{ instance_conf | to_yaml }}"
dest: "{{ molecule_instance_config }}"
when: server.changed | bool
when: server.changed | bool
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ scenario:
#- idempotence
- lint
- verify
- destroy
- destroy
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
tasks:
- name: "Include manage-service"
include_role:
name: "manage-service"
name: "manage-service"
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
- include_role:
name: "configure-firewall"

# EOF
# EOF
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
retries: 60
delay: 10

# EOF
# EOF
52 changes: 0 additions & 52 deletions controls/roles/manage-service/molecule/besu/converge.yml

This file was deleted.

75 changes: 0 additions & 75 deletions controls/roles/manage-service/molecule/besu/prepare.yml

This file was deleted.

54 changes: 0 additions & 54 deletions controls/roles/manage-service/molecule/besu/verify.yml

This file was deleted.

98 changes: 98 additions & 0 deletions controls/roles/manage-service/molecule/geth-teku/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
- name: Converge
hosts: all
vars_files:
- ../../../../defaults/stereum_defaults.yaml
vars:
teku_service: d2cf0214-ea78-11ec-bbf0-ab0094207ad6
geth_service: d6358d80-ea76-11ec-94b3-2fb45dfeb66a

tasks:
# geth service
- block:
- set_fact:
stereum: "{{ stereum_static | combine(stereum_args, recursive=True) }}"
- name: "Include manage-service"
include_role:
name: "manage-service"
vars:
stereum_args:
manage_service:
save: true
state: started
configuration:
service: GethService
id: "{{ geth_service }}"
image: "ethereum/client-go:{{ stereum_static.defaults.versions.geth }}"
ports:
- 0.0.0.0:30303:30303/tcp
- 0.0.0.0:30303:30303/udp
- 127.0.0.1:8551:8551
entrypoint: ["geth"]
env: {}
command:
- --goerli
- --http
- --datadir=/opt/app/geth
- --http.addr=0.0.0.0
- --http.vhosts=*
- --http.api="engine,eth,web3,net,debug"
- --http.corsdomain=*
- --authrpc.addr=0.0.0.0
- --authrpc.vhosts=*
- --authrpc.jwtsecret=/engine.jwt
user: "2000"
volumes:
- "/opt/app/services/{{ geth_service }}/data:/opt/app/geth"
- "/opt/app/services/{{ geth_service }}/engine.jwt:/engine.jwt"

# teku beacon service
- block:
- set_fact:
stereum: "{{ stereum_static | combine(stereum_args, recursive=True) }}"
- name: "Include manage-service"
include_role:
name: "manage-service"
vars:
stereum_args:
manage_service:
save: true
state: started
configuration:
service: TekuBeaconService
id: "{{ teku_service }}"
image: "consensys/teku:{{ stereum_static.defaults.versions.teku }}"
ports:
- 0.0.0.0:9001:9001/tcp
- 0.0.0.0:9001:9001/udp
env:
JAVA_OPTS: -Xmx4g
entrypoint: ["/opt/teku/bin/teku"]
command:
- --network=prater
- --logging=INFO
- --p2p-enabled=true
- --p2p-port=9001
- --ee-endpoint=http://stereum-{{ geth_service }}:8551
- --ee-jwt-secret-file=/engine.jwt
- --metrics-enabled=true
- --metrics-categories=BEACON,LIBP2P,NETWORK,PROCESS
- --metrics-port=8008
- --metrics-interface=0.0.0.0
- --metrics-host-allowlist="*"
- --metrics-publish-interval=10
- --data-path=/opt/app/data
- --data-storage-mode=prune
- --rest-api-port=5051
- --rest-api-host-allowlist="*"
- --rest-api-interface=0.0.0.0
- --rest-api-docs-enabled=true
- --rest-api-enabled=true
- --log-destination=CONSOLE
# - --eth1-endpoints=http://10.10.0.3:8545
user: "2000"
volumes:
- "/opt/app/services/{{ teku_service }}/data:/opt/app/data"
- "/opt/app/services/{{ geth_service }}/engine.jwt:/engine.jwt"

# EOF
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ dependency:
driver:
name: hetznercloud
platforms:
- name: "manage-service--besu--ubuntu-22.04"
- name: "manage-service--geth-teku--ubuntu-22.04"
hostname: ubuntu
server_type: cpx31
image: ubuntu-22.04
# - name: "manage-service--besu--centos-stream-8"
# - name: "manage-service--geth-teku--centos-stream-8"
# hostname: "centos"
# server_type: cpx31
# image: centos-stream-8
Expand Down
30 changes: 30 additions & 0 deletions controls/roles/manage-service/molecule/geth-teku/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- name: Prepare
hosts: all
roles:
- role: '../'
vars_files:
- ../../../../defaults/stereum_defaults.yaml

tasks:
- name: Install python for Ansible (Ubuntu)
apt:
update_cache: yes
name: pip
become: true
changed_when: false
when: ansible_distribution == "Ubuntu"

- name: Install python for Ansible (CentOS 8)
raw: yum install -y python38 tar && yum remove -y python36
become: true
changed_when: false
when: ansible_distribution == "CentOS"

- include_role:
name: "setup"

- include_role:
name: "configure-firewall"

# EOF
15 changes: 15 additions & 0 deletions controls/roles/manage-service/molecule/geth-teku/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
# teku beacon logs
- name: Teku beacon
command: "docker logs --tail=20 stereum-d2cf0214-ea78-11ec-bbf0-ab0094207ad6"
register: teku_beacon
until:
- teku_beacon.stdout is search("Endpoint http://stereum-d6358d80-ea76-11ec-94b3-2fb45dfeb66a:8551 is INVALID | Still syncing")
retries: 60
delay: 10

# EOF
Loading

0 comments on commit c9aa16d

Please sign in to comment.