Skip to content

Commit

Permalink
pruning CLI flag was changed (#27)
Browse files Browse the repository at this point in the history
* the pruning CLI flag was changed, fix molecule

Signed-off-by: kogeler <roman.gavrilov@parity.io>
  • Loading branch information
kogeler authored Mar 31, 2023
1 parent 0fde07b commit aa0b7a8
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 23 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: parity
name: chain

# The version of the collection. Must be compatible with semantic versioning
version: 1.0.9
version: 1.0.10

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
10 changes: 7 additions & 3 deletions roles/node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ node_ws_max_connections: "100"
### Node preferences
node_paritydb_enable: false
node_db_cache: ""
# Set amount of blocks to save in the pruning mode, 0 - pruning mode is disabled
# amount of blocks to save state in the pruning mode
# if you need the state pruning mode the recommended (default) value is 256
# 0 - the state pruning mode is disabled, keep the state of all blocks ('--state-pruning archive')
node_pruning: 0
# You can specify any custom options as a list
node_custom_options: []
Expand Down Expand Up @@ -177,12 +179,14 @@ node_parachain_ws_max_connections: "100"

### Node preferences
node_parachain_paritydb_enable: false
node_parachain_db_cache: 512
node_parachain_db_cache: ""
# You can redefine any variables from playbooks directly
# Values from the "_node_profiles" are used by default
node_parachain_in_peers: "25"
node_parachain_out_peers: "25"
# Set amount of blocks to save in the pruning mode, 0 - pruning mode is disabled
# amount of blocks to save state in the pruning mode
# if you need the state pruning mode the recommended (default) value is 256
# 0 - the state pruning mode is disabled, keep the state of all blocks ('--state-pruning archive')
node_parachain_pruning: 0
# You can specify any custom options as a list
node_parachain_custom_options: []
Expand Down
9 changes: 3 additions & 6 deletions roles/node/molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ You can deploy role locally in docker container, e.g to check node logs.
#### Relaychain
```bash
cd roles/node
molecule lint
molecule converge
molecule verify
molecule login
Expand All @@ -53,14 +54,10 @@ molecule destroy # to clean everything
#### Parachain
```bash
cd roles/node
molecule test
cd roles/node
molecule lint
molecule converge --scenario-name parachain
molecule verify --scenario-name parachain
molecule login --scenario-name parachain --host instance1
> journalctl -f
> exit
molecule login -s parachain -h instance2
molecule login --scenario-name parachain --host instance-parachain
> journalctl -f
> exit
molecule destroy --scenario-name parachain # to clean everything
Expand Down
2 changes: 1 addition & 1 deletion roles/node/molecule/default/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ansible_user: root

## Node
node_chain: polkadot
node_binary_version: v0.9.30
node_binary_version: v0.9.40
node_binary: https://github.com/paritytech/polkadot/releases/download/{{ node_binary_version }}/polkadot
node_binary_signature: https://github.com/paritytech/polkadot/releases/download/{{ node_binary_version }}/polkadot.asc
node_chain_backup_restoring_type: "none"
Expand Down
2 changes: 2 additions & 0 deletions roles/node/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ provisioner:
D: True
verifier:
name: ansible
options:
D: True
lint: |
set -e
yamllint .
Expand Down
6 changes: 4 additions & 2 deletions roles/node/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
hosts: all
gather_facts: false
pre_tasks:
- name: Install python
ansible.builtin.raw: apt -y update && apt install -y python3
changed_when: false
- name: Install required packages
ansible.builtin.apt:
name:
- python3
- gpg
update_cache: yes
update_cache: no
changed_when: false
2 changes: 1 addition & 1 deletion roles/node/molecule/parachain/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ansible_user: root

# Common
node_binary_version: v0.9.270
node_binary_version: v0.9.380
node_binary: https://github.com/paritytech/cumulus/releases/download/{{ node_binary_version }}/polkadot-parachain
node_binary_signature: https://github.com/paritytech/cumulus/releases/download/{{ node_binary_version }}/polkadot-parachain.asc
node_app_name: "shell"
Expand Down
6 changes: 5 additions & 1 deletion roles/node/molecule/parachain/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependency:
driver:
name: ${DRIVER:-docker}
platforms:
- name: instance
- name: instance-parachain
# LXD
source:
alias: debian/bullseye/amd64
Expand All @@ -18,6 +18,10 @@ platforms:
# to pull image from docker hub uncomment this
pre_build_image: true

provisioner:
name: ansible
options:
D: True
verifier:
name: ansible
options:
Expand Down
6 changes: 4 additions & 2 deletions roles/node/molecule/parachain/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
hosts: all
gather_facts: false
pre_tasks:
- name: Install Python
ansible.builtin.raw: apt -y update && apt install -y python3
changed_when: false
- name: Install required packages
ansible.builtin.apt:
name:
- python3
- gpg
update_cache: yes
update_cache: no
changed_when: false
1 change: 1 addition & 0 deletions roles/node/tasks/400-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
mode: 0755
owner: "root"
group: "root"
timeout: 30
headers:
PRIVATE-TOKEN: "{{ node_binary_download_private_token }}"
check_mode: false
Expand Down
1 change: 1 addition & 0 deletions roles/node/tasks/900-systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- name: Systemd | Get public IP
community.general.ipify_facts:
timeout: 30
register: _node_ipify_result
until: _node_ipify_result.failed is defined and not _node_ipify_result.failed
retries: 3
Expand Down
14 changes: 8 additions & 6 deletions roles/node/templates/env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ RC_TELEMETRY="

RC_PRUNING="
{%- if node_pruning > 0 %}
--pruning={{ node_pruning }}
--state-pruning={{ node_pruning }}
{%- else %}
--pruning=archive
--state-pruning=archive
{%- endif %}"

RC_LOGS="
Expand Down Expand Up @@ -129,9 +129,11 @@ PC_CONNECTIONS="--in-peers {{ node_parachain_in_peers }} --out-peers {{ node_par

PC_DB="\
{% if node_parachain_paritydb_enable %}
--database paritydb-experimental \
--database paritydb \
{% endif %}
--db-cache {{ node_parachain_db_cache }}"
{% if node_parachain_db_cache != '' %}
--db-cache {{ node_parachain_db_cache }}
{% endif %}"

PC_TELEMETRY="
{%- if not node_parachain_telemetry_enable %}
Expand All @@ -144,9 +146,9 @@ PC_TELEMETRY="

PC_PRUNING="
{%- if node_parachain_pruning > 0 %}
--pruning={{ node_parachain_pruning }}
--state-pruning={{ node_parachain_pruning }}
{%- else %}
--pruning=archive
--state-pruning=archive
{%- endif %}"

PC_LOGS="
Expand Down

0 comments on commit aa0b7a8

Please sign in to comment.