From df83f5577dde3115eb979fe26cad6ee1e99077fe Mon Sep 17 00:00:00 2001 From: kogeler Date: Sat, 25 May 2024 14:59:19 +0300 Subject: [PATCH] fix ci Signed-off-by: kogeler --- .../molecule/default/group_vars/all.yml | 35 +++++----- .../node_backup/molecule/default/prepare.yml | 67 +++++++++++-------- roles/node_backup/molecule/default/verify.yml | 26 ++----- .../molecule/default/collections.yml | 4 ++ .../molecule/default/collections.yml.bak | 4 -- 5 files changed, 66 insertions(+), 70 deletions(-) create mode 100644 roles/ws_health_exporter/molecule/default/collections.yml delete mode 100644 roles/ws_health_exporter/molecule/default/collections.yml.bak diff --git a/roles/node_backup/molecule/default/group_vars/all.yml b/roles/node_backup/molecule/default/group_vars/all.yml index 016c908..538548a 100644 --- a/roles/node_backup/molecule/default/group_vars/all.yml +++ b/roles/node_backup/molecule/default/group_vars/all.yml @@ -2,34 +2,35 @@ ## Molecule ansible_user: root -## prepare.yml -#node_legacy_rpc_flags: false -node_binary: https://github.com/paritytech/polkadot/releases/download/v0.9.42/polkadot -node_chain: rococo-local -node_data_root_path: /opt/{{ node_app_name }} +## node +node_role: "validator" +node_user: polkadot +node_chain: westend-local +node_chain_backup_chain_path: "westend_local_testnet" node_chain_backup_restoring_type: none -node_pruning: 256 -# node_binary_deployment: false +node_parachain_chain_backup_restoring_type: none +node_p2p_bind_addr: "127.0.0.1" +node_ansible_annotation_path: /tmp/substrate.prom +node_binary_version: v1.12.0 +node_binary: "https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-{{ node_binary_version }}/polkadot" +node_prepare_worker_binary: "https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-{{ node_binary_version }}/polkadot-prepare-worker" +node_execute_worker_binary: "https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-{{ node_binary_version }}/polkadot-execute-worker" + # node_backup _gcp_bucket: test-blockstore-backups -node_backup_user: parity +node_backup_user: polkadot node_backup_r2_access_key_id: abc node_backup_r2_secret_access_key: cba node_backup_r2_api_url: https://a.b node_backup_targets: - - service_name: rococo-alice-rocksdb-prune - local_path: /opt/rococo-alice-rocksdb-prune/chains/rococo_local_testnet/db + - service_name: alice-rocksdb-prune + local_path: /opt/alice-rocksdb-prune/chains/{{ node_chain_backup_chain_path }}/db rpc_port: 9933 bucket_name: "{{ _gcp_bucket }}" - type: gcp-native - - service_name: rococo-bob-paritydb-prune - local_path: /opt/rococo-bob-paritydb-prune/chains/rococo_local_testnet/paritydb - rpc_port: 9934 - bucket_name: "{{ _gcp_bucket }}" type: gcp-rclone - - service_name: rococo-bob-paritydb-prune - local_path: /opt/rococo-bob-paritydb-prune/chains/rococo_local_testnet/paritydb + - service_name: bob-paritydb-prune + local_path: /opt/bob-paritydb-prune/chains/{{ node_chain_backup_chain_path }}/paritydb rpc_port: 9934 bucket_name: "{{ _gcp_bucket }}" type: r2-rclone diff --git a/roles/node_backup/molecule/default/prepare.yml b/roles/node_backup/molecule/default/prepare.yml index f8c8ac2..aabc8c5 100644 --- a/roles/node_backup/molecule/default/prepare.yml +++ b/roles/node_backup/molecule/default/prepare.yml @@ -3,42 +3,53 @@ hosts: all gather_facts: false pre_tasks: - - name: Install Python3 + - name: Prepare | Install Python3 ansible.builtin.raw: apt -y update && apt install -y python3 changed_when: false + - name: Prepare | Install required packages + ansible.builtin.apt: + name: + - gpg + - cron + update_cache: false + changed_when: false - name: Prepare | create user parity ansible.builtin.user: - name: parity + name: polkadot tasks: - - name: rococo-alice local + - name: Include node alice + # use include role to skip ansible-lint ansible.builtin.include_role: - name: parity.chain.node + name: node vars: - node_rpc_port: 9933 - node_app_name: rococo-alice-rocksdb-prune + node_app_name: "alice-rocksdb-prune" + node_handler_id: "{{ node_app_name }}" + node_data_root_path: "/opt/{{ node_app_name }}" + # 12D3KooWHhB5LqXji1moEvbzCEq7HzJuMvqi5E3BkoceUcQFPX2f + node_p2p_private_key: "4f1ae54a051e08161456b74a70b85e45e161fd4f614637f50a2a5f09ba7afb2e" node_custom_options: - - --alice - - name: rococo-bob local + - "--alice" + - "--bootnodes /ip4/127.0.0.1/tcp/30334/p2p/12D3KooWKvNLq5fFMcQvdZHejhUvRQcSxDpbWFBo1mXh4kGR949r" + - "--no-hardware-benchmarks" + - "--rpc-cors '*'" + node_p2p_port: "30333" + node_prometheus_port: "9615" + node_rpc_port: "9933" + - name: Include node bob ansible.builtin.include_role: - name: parity.chain.node + name: node vars: - node_rpc_port: 9934 - node_paritydb_enable: true - node_app_name: rococo-bob-paritydb-prune + node_app_name: "bob-paritydb-prune" + node_handler_id: "{{ node_app_name }}" + node_data_root_path: /opt/{{ node_app_name }} + # 12D3KooWKvNLq5fFMcQvdZHejhUvRQcSxDpbWFBo1mXh4kGR949r + node_p2p_private_key: "042cd72c647f27c6da663f15665b59f707bce7de4b771b098361ff756cde168e" node_custom_options: - - --bob - - name: Pretend we are in gcp | Install cron, gnupg - ansible.builtin.package: - name: - - cron - - gnupg - state: present - update_cache: true - - name: Pretend we are in gcp | Add an Apt signing key - ansible.builtin.apt_key: - url: https://packages.cloud.google.com/apt/doc/apt-key.gpg - state: present - - name: Pretend we are in gcp | Add apt repository into sources list - ansible.builtin.apt_repository: - repo: deb https://packages.cloud.google.com/apt cloud-sdk main - state: present + - "--bob" + - "--bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWHhB5LqXji1moEvbzCEq7HzJuMvqi5E3BkoceUcQFPX2f" + - "--no-hardware-benchmarks" + - "--rpc-cors '*'" + node_p2p_port: "30334" + node_prometheus_port: "9616" + node_rpc_port: "9934" + node_paritydb_enable: true diff --git a/roles/node_backup/molecule/default/verify.yml b/roles/node_backup/molecule/default/verify.yml index 10846bb..10b8fb8 100644 --- a/roles/node_backup/molecule/default/verify.yml +++ b/roles/node_backup/molecule/default/verify.yml @@ -22,26 +22,10 @@ - name: Print current block ansible.builtin.debug: var: _node_backup_register_header.json.result.number | int(base=16) -# # todo add tests -# -## a) upload to gcp -# GCP storage emulator is not available yet (https://github.com/googleapis/google-cloud-python/issues/10300), -# there are third party emulator, but support of gsutils is broken (https://github.com/oittaa/gcp-storage-emulator/issues/186) -# when emulator will be available: -# 1. run and configure emulator -# 2. run script: -# - name: run backup script -# ansible.builtin.command: /home/parity/bin/node_backup.sh -# 3. -# - name: "rococo-bob local" -# ansible.builtin.include_role: -# name: parity.chain.node -# vars: -# node_rpc_port: 9935 -# node_paritydb_enable: true -# node_app_name: "rococo-local-rpc" -# -## b) Test backup-exporter: -# We can push fake data to backup-exporter (like run bash script). + +# TODO - add tests +# Test backup-exporter: +# 1. We can push fake data to backup-exporter (like run bash script). # Then we can check the Prometheus endpoint to check and match the results. # This will allow checking the code of the exporter. +# 2. We can upload data to local MinIO \ No newline at end of file diff --git a/roles/ws_health_exporter/molecule/default/collections.yml b/roles/ws_health_exporter/molecule/default/collections.yml new file mode 100644 index 0000000..7a0c167 --- /dev/null +++ b/roles/ws_health_exporter/molecule/default/collections.yml @@ -0,0 +1,4 @@ +collections: + - name: https://github.com/paritytech/ansible-galaxy.git + type: git + version: main diff --git a/roles/ws_health_exporter/molecule/default/collections.yml.bak b/roles/ws_health_exporter/molecule/default/collections.yml.bak deleted file mode 100644 index 7650095..0000000 --- a/roles/ws_health_exporter/molecule/default/collections.yml.bak +++ /dev/null @@ -1,4 +0,0 @@ -#collections: -# - name: https://github.com/paritytech/ansible-galaxy.git -# type: git -# version: main