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

[Enhancement] Replace with the correct blocks pruning args #312

Merged
merged 8 commits into from
Nov 17, 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
2 changes: 1 addition & 1 deletion charts/node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: node
description: A Helm chart to deploy Substrate/Polkadot nodes
type: application
version: 5.4.3
version: 5.5.0
maintainers:
- name: Parity
url: https://github.com/paritytech/helm-charts
Expand Down
9 changes: 6 additions & 3 deletions charts/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is intended behaviour. Make sure to run `git add -A` once again to stage ch

# Substrate/Polkadot node Helm chart

![Version: 5.4.3](https://img.shields.io/badge/Version-5.4.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 5.5.0](https://img.shields.io/badge/Version-5.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

## Maintainers

Expand Down Expand Up @@ -111,6 +111,9 @@ node:
```

## Upgrade
### From v5.x.x to v5.5.0 (⚠️ breaking changes)
- The pruning flag is now using `--blocks-pruning` which starts from polkadot version v0.9.28
- The flag `--pruning` is now allowed in both .Values.node.flags and .Values.node.collatorRelayChain.flags. When using `--pruning`, ensure that the values of .Values.node.chainData.pruning and .Values.node.collatorRelayChain.chainData.pruning are explicitly set to `false` to maintain previous behavior.

### From v5.x.x to v5.3.0 (⚠️ breaking changes)
- The following flags have changed:
Expand Down Expand Up @@ -304,7 +307,7 @@ If you're running a collator node:
| node.chainData.database | string | `"rocksdb"` | Database backend engine to use |
| node.chainData.kubernetesVolumeSnapshot | string | `nil` | If set, create a clone of the volume (using volumeClaimTemplates.dataSource.VolumeSnapshot) and use it to store chain data |
| node.chainData.kubernetesVolumeToClone | string | `nil` | If set, create a clone of the volume (using volumeClaimTemplates.dataSource.PersistentVolumeClaim) and use it to store chain data |
| node.chainData.pruning | int | `1000` | Set the amount of blocks to retain. If set to 0 archive node will be run |
| node.chainData.pruning | int | `1000` | Set the amount of blocks to retain. If set to 0 archive node will be run. If deprecated `--pruning` flags is used in `node.flags`, set this to `false`. |
| node.chainData.storageClass | string | `""` | Storage class to use for persistent volume |
| node.chainData.volumeSize | string | `"100Gi"` | Size of the volume for chain data |
| node.chainKeystore | object | `{"accessModes":["ReadWriteOnce"],"annotations":{},"kubernetesVolumeSnapshot":null,"kubernetesVolumeToClone":null,"mountInMemory":{"enabled":false,"sizeLimit":null},"storageClass":"","volumeSize":"10Mi"}` | Configure chain keystore parameters |
Expand Down Expand Up @@ -336,7 +339,7 @@ If you're running a collator node:
| node.collatorRelayChain.chainData.database | string | `"rocksdb"` | Database backend engine to use for the collator relay-chain database |
| node.collatorRelayChain.chainData.kubernetesVolumeSnapshot | string | `nil` | If set, create a clone of the volume (using volumeClaimTemplates.dataSource.VolumeSnapshot) and use it to store relay-chain data |
| node.collatorRelayChain.chainData.kubernetesVolumeToClone | string | `nil` | If set, create a clone of the volume (using volumeClaimTemplates.dataSource.PersistentVolumeClaim) and use it to store relay-chain data |
| node.collatorRelayChain.chainData.pruning | int | `1000` | Set the amount of blocks to retain for the collator relay-chain database. If set to 0 archive node will be run |
| node.collatorRelayChain.chainData.pruning | int | `1000` | Set the amount of blocks to retain for the collator relay-chain database. If set to 0 archive node will be run. If deprecated `--pruning` flags is used in `node.collatorRelayChain.flags`, set this to `false`. |
| node.collatorRelayChain.chainData.storageClass | string | `""` | Storage class to use for persistent volume |
| node.collatorRelayChain.chainData.volumeSize | string | `"100Gi"` | Size of the volume |
| node.collatorRelayChain.chainKeystore.accessModes | list | `["ReadWriteOnce"]` | Access mode of the volume |
Expand Down
3 changes: 3 additions & 0 deletions charts/node/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ node:
```

## Upgrade
### From v5.x.x to v5.5.0 (⚠️ breaking changes)
- The pruning flag is now using `--blocks-pruning` which starts from polkadot version v0.9.28
- The flag `--pruning` is now allowed in both .Values.node.flags and .Values.node.collatorRelayChain.flags. When using `--pruning`, ensure that the values of .Values.node.chainData.pruning and .Values.node.collatorRelayChain.chainData.pruning are explicitly set to `false` to maintain previous behavior.

### From v5.x.x to v5.3.0 (⚠️ breaking changes)
- The following flags have changed:
Expand Down
2 changes: 1 addition & 1 deletion charts/node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ Create the database path depending on the database backend in use (rocksdb or pa
Define a regex matcher to check if the passed node flags are managed by the chart already
*/}}
{{- define "node.chartManagedFlagsRegex" -}}
{{- "(\\W|^)(--name|--base-path|--chain|--validator|--collator|--light|--database|--pruning|--prometheus-external|--prometheus-port|--node-key|--wasm-runtime-overrides|--jaeger-agent|--rpc-external|--unsafe-rpc-external|--ws-external|--unsafe-ws-external|--rpc-methods|--rpc-cors|--rpc-port|--ws-port|--enable-offchain-indexing)(\\W|$)" }}
{{- "(\\W|^)(--name|--base-path|--chain|--blocks-pruning|--validator|--collator|--light|--database|--prometheus-external|--prometheus-port|--node-key|--wasm-runtime-overrides|--jaeger-agent|--rpc-external|--unsafe-rpc-external|--ws-external|--unsafe-ws-external|--rpc-methods|--rpc-cors|--rpc-port|--ws-port|--enable-offchain-indexing)(\\W|$)" }}
{{- end }}
16 changes: 8 additions & 8 deletions charts/node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,10 @@ spec:
{{- if .Values.node.chainData.database }}
--database={{ .Values.node.chainData.database }} \
{{- end }}
{{- if ge ( int .Values.node.chainData.pruning ) 1 }}
--pruning={{ .Values.node.chainData.pruning }} \
{{- else if and ( not ( kindIs "invalid" .Values.node.chainData.pruning ) ) ( eq 0 ( int .Values.node.chainData.pruning ) ) }}
--pruning=archive \
{{- if and ( not (kindIs "bool" .Values.node.chainData.pruning ) ) (ge ( int .Values.node.chainData.pruning ) 1) }}
--blocks-pruning={{ .Values.node.chainData.pruning }} \
{{- else if and ( not (kindIs "bool" .Values.node.chainData.pruning ) ) ( not ( kindIs "invalid" .Values.node.chainData.pruning ) ) ( eq 0 ( int .Values.node.chainData.pruning ) ) }}
--blocks-pruning=archive \
{{- end }}
{{- if eq .Values.node.role "collator" }}
--collator \
Expand Down Expand Up @@ -629,10 +629,10 @@ spec:
{{- if .Values.node.collatorRelayChain.chainData.database}}
--database={{ .Values.node.collatorRelayChain.chainData.database }} \
{{- end }}
{{- if ge ( int .Values.node.collatorRelayChain.chainData.pruning ) 1 }}
--pruning={{ .Values.node.collatorRelayChain.chainData.pruning }} \
{{- else if and ( not ( kindIs "invalid" .Values.node.collatorRelayChain.chainData.pruning ) ) ( eq 0 ( int .Values.node.collatorRelayChain.chainData.pruning ) ) }}
--pruning=archive \
{{- if and ( not (kindIs "bool" .Values.node.collatorRelayChain.chainData.pruning )) (ge ( int .Values.node.collatorRelayChain.chainData.pruning ) 1) }}
--blocks-pruning={{ .Values.node.collatorRelayChain.chainData.pruning }} \
{{- else if and ( not (kindIs "bool" .Values.node.collatorRelayChain.chainData.pruning )) ( not ( kindIs "invalid" .Values.node.collatorRelayChain.chainData.pruning ) ) ( eq 0 ( int .Values.node.collatorRelayChain.chainData.pruning ) ) }}
--blocks-pruning=archive \
{{- end }}
{{- if .Values.node.collatorRelayChain.prometheus.enabled }}
--prometheus-external \
Expand Down
6 changes: 4 additions & 2 deletions charts/node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ node:
chainData:
# -- Database backend engine to use
database: rocksdb
# -- Set the amount of blocks to retain. If set to 0 archive node will be run
# -- Set the amount of blocks to retain.
# If set to 0 archive node will be run. If deprecated `--pruning` flags is used in `node.flags`, set this to `false`.
pruning: 1000
# -- (string) If set, create a clone of the volume (using volumeClaimTemplates.dataSource.VolumeSnapshot) and use it to store chain data
kubernetesVolumeSnapshot:
Expand Down Expand Up @@ -274,7 +275,8 @@ node:
chainData:
# -- Database backend engine to use for the collator relay-chain database
database: rocksdb
# -- Set the amount of blocks to retain for the collator relay-chain database. If set to 0 archive node will be run
# -- Set the amount of blocks to retain for the collator relay-chain database.
# If set to 0 archive node will be run. If deprecated `--pruning` flags is used in `node.collatorRelayChain.flags`, set this to `false`.
pruning: 1000
# -- (string) If set, create a clone of the volume (using volumeClaimTemplates.dataSource.VolumeSnapshot) and use it to store relay-chain data
kubernetesVolumeSnapshot:
Expand Down