Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP backups were removed from the node role #63

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Create `requirements.yml` file in your playbook repository (or add to the existi
collections:
- name: https://github.com/paritytech/ansible-galaxy.git
type: git
version: 1.6.2
version: 1.8.0
```

or

```yaml
collections:
- name: paritytech.chain
version: 1.6.2
version: 1.8.0
```

If you want to install collections in the project space, you have to run:
Expand All @@ -38,3 +38,5 @@ ansible-galaxy collection install -f -r requirements.yml
* secure_apt - [README](./roles/secure_apt/README.md)
* state_exporter - [README](./roles/state_exporter/README.md)
* ws_health_exporter - [README](./roles/ws_health_exporter/README.md)
* nginx - [README](./roles/nginx/README.md)
* nginx_exporter - [README](./roles/nginx_exporter/README.md)
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: paritytech
name: chain

# The version of the collection. Must be compatible with semantic versioning
version: 1.7.0
version: 1.8.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
18 changes: 2 additions & 16 deletions roles/node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ node_custom_options: []
node_enable_detailed_log_output: true

### Backup restoring
# Can be "http", "gcp", "tar" or "none". If it's "none", the role will not restore the blockstore of relaychain.
# Can be "http", "tar" or "none". If it's "none", the role will not restore the blockstore of relaychain.
# It will also not perform a restore if the db folder exists and is not empty
node_chain_backup_restoring_type: none
# Name of a folder that is used by different networks to store chain.
Expand All @@ -135,14 +135,6 @@ node_chain_backup_http_install_rclone: false
# A tar archive must contain database on the root level
node_chain_backup_url: ""

## GCP backups
# You can find the structure of a bucket in README.md
node_chain_backup_gcp_bucket: ""
# full link to a GCP backup, you have to specify a full path including a bucket name.
node_chain_backup_gcp_path: ""
# If you don't have pre-installed google SDK the role can install it
node_chain_backup_gcp_install_sdk: false

### Loging and telemetry
node_telemetry_enable: true
# If you set an empty value, it will use the default telemetry server
Expand Down Expand Up @@ -219,7 +211,7 @@ node_parachain_custom_options: []
# - "--rpc-methods Unsafe"

### Backup restoring
# Can be "http", "gcp", "tar" or "none". If it's "none", the role will not restore the blockstore of parachain.
# Can be "http", "tar" or "none". If it's "none", the role will not restore the blockstore of parachain.
# It will also not perform a restore if the db folder exists and is not empty
node_parachain_chain_backup_restoring_type: none
# Name of a folder that is used by different parachain networks to store chain.
Expand All @@ -238,12 +230,6 @@ node_parachain_chain_backup_http_url: ""
# A tar archive must contain database on the root level
node_parachain_chain_backup_url: ""

## GCP backups
# You can find the structure of a bucket in README.md
node_parachain_chain_backup_gcp_bucket: ""
# Link to a gcp backup, you have to specify a full path including a bucket name.
node_parachain_chain_backup_gcp_path: ""

### Loging and telemetry
node_parachain_telemetry_enable: true
# If you set an empty value, it will use the default telemetry server
Expand Down
22 changes: 4 additions & 18 deletions roles/node/tasks/100-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,13 @@

- name: Test | Check node_chain_backup_restoring_type
ansible.builtin.fail:
msg: "The 'node_chain_backup_restoring_type' variable can contain only 'gcp', 'tar' or 'none' values!"
when: node_chain_backup_restoring_type not in ["http", "gcp", "tar", "none"]
msg: "The 'node_chain_backup_restoring_type' variable can contain only 'http', 'tar' or 'none' values!"
when: node_chain_backup_restoring_type not in ["http", "tar", "none"]

- name: Test | Check node_parachain_chain_backup_restoring_type
ansible.builtin.fail:
msg: "The 'node_parachain_chain_backup_restoring_type' variable can contain only 'gcp', 'tar' or 'none' values!"
when: node_parachain_chain_backup_restoring_type not in ["http", "gcp", "tar", "none"]

- name: Test | Check gcp backup
ansible.builtin.fail:
msg: "If you use GCP backups for the node that uses chain: {{ node_chain }},
pruning state: {{ (node_pruning > 0) }},
you have to set the node_chain_backup_gcp_bucket variable or the node_chain_backup_gcp_path"
when: node_chain_backup_restoring_type == 'gcp' and node_chain_backup_gcp_bucket == '' and node_chain_backup_gcp_path == ''

- name: Test | Check parachain gcp backup
ansible.builtin.fail:
msg: "If you use GCP backups for the node that uses parachain: {{ node_parachain_chain }},
pruning state: {{ (node_parachain_pruning > 0) }},
you have to set the node_parachain_chain_backup_gcp_bucket variable or the node_parachain_chain_backup_gcp_path variable"
when: node_parachain_role != '' and node_parachain_chain_backup_restoring_type == 'gcp' and node_parachain_chain_backup_gcp_bucket == '' and node_parachain_chain_backup_gcp_path == ''
msg: "The 'node_parachain_chain_backup_restoring_type' variable can contain only 'http', 'tar' or 'none' values!"
when: node_parachain_chain_backup_restoring_type not in ["http", "tar", "none"]

- name: Test | Check node_chain_backup_url
ansible.builtin.fail:
Expand Down
7 changes: 0 additions & 7 deletions roles/node/tasks/800-restore-chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@
tags: [ 'node', 'node-restore-chain' ]
when: item.restoring_type == 'tar'

- name: Restore {{ item.part }} | GCP restoring
ansible.builtin.include_tasks:
file: 802-restore-chain-gcp.yml
apply:
tags: [ 'node', 'node-restore-chain' ]
when: item.restoring_type == 'gcp'

- name: Restore {{ item.part }} | HTTP restoring
ansible.builtin.include_tasks:
file: 803-restore-chain-http.yml
Expand Down
101 changes: 0 additions & 101 deletions roles/node/tasks/802-restore-chain-gcp.yml

This file was deleted.

10 changes: 0 additions & 10 deletions roles/node/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ _node_chainspec_file: "{{ _node_user_home_path }}/chainspecs/{{ node_app_name }}

_node_restore_relaychain: "{{
(node_chain_backup_restoring_type == 'http' and ( node_chain_backup_http_base_url != '' or node_chain_backup_http_url != '')) or
(node_chain_backup_restoring_type == 'gcp' and ( node_chain_backup_gcp_bucket != '' or node_chain_backup_gcp_path != '')) or
(node_chain_backup_restoring_type == 'tar' and node_chain_backup_url != '')
}}"
_node_chain_backup_data:
Expand All @@ -82,10 +81,6 @@ _node_chain_backup_data:
chain_path: "{{ _node_data_chain_path }}"
db_folder: "{{ 'paritydb' if node_paritydb_enable else 'db' }}"
tar_url: "{{ node_chain_backup_url }}"
gcp_url: "{{ node_chain_backup_gcp_bucket +
node_chain +
('-paritydb' if node_paritydb_enable else '-rocksdb') + ('-prune' if node_pruning > 0 else '-archive') }}"
custom_gcp_url: "{{ node_chain_backup_gcp_path }}"
http_url: "{{ node_chain_backup_http_base_url + '/' +
node_chain +
('-paritydb' if node_paritydb_enable else '-rocksdb') + ('-prune' if node_pruning > 0 else '-archive') }}"
Expand All @@ -103,7 +98,6 @@ _node_parachain_chainspec_file: "{{ _node_user_home_path }}/chainspecs/{{ node_a

_node_restore_parachain: "{{ node_parachain_role != '' and
((node_parachain_chain_backup_restoring_type == 'http' and (node_parachain_chain_backup_http_base_url != '' or node_parachain_chain_backup_http_url != '' )) or
(node_parachain_chain_backup_restoring_type == 'gcp' and (node_parachain_chain_backup_gcp_bucket != '' or node_parachain_chain_backup_gcp_path != '' )) or
(node_parachain_chain_backup_restoring_type == 'tar' and node_parachain_chain_backup_url != ''))
}}"
_node_parachain_chain_backup_data:
Expand All @@ -112,10 +106,6 @@ _node_parachain_chain_backup_data:
chain_path: "{{ _node_parachain_data_chain_path }}"
db_folder: "{{ 'paritydb' if node_parachain_paritydb_enable else 'db' }}"
tar_url: "{{ node_parachain_chain_backup_url }}"
gcp_url: "{{ node_parachain_chain_backup_gcp_bucket +
node_parachain_chain +
('-paritydb' if node_parachain_paritydb_enable else '-rocksdb') + ('-prune' if node_parachain_pruning > 0 else '-archive') }}"
custom_gcp_url: "{{ node_parachain_chain_backup_gcp_path }}"
http_url: "{{ node_parachain_chain_backup_http_base_url + '/' +
node_parachain_chain +
('-paritydb' if node_parachain_paritydb_enable else '-rocksdb') + ('-prune' if node_parachain_pruning > 0 else '-archive') }}"
Expand Down