From a356c2a1f12a94ddd17ac9abd8f0ba6a43f29d7b Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Tue, 14 Jun 2022 12:12:31 +0200 Subject: [PATCH] fix database backend selection by changing hardcoded 'db' folder with --- charts/node/Chart.yaml | 2 +- charts/node/templates/statefulset.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/node/Chart.yaml b/charts/node/Chart.yaml index 943d15f4..78958819 100644 --- a/charts/node/Chart.yaml +++ b/charts/node/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 name: node description: A Helm chart to deploy Substrate/Polkadot nodes type: application -version: 2.3.0 +version: 2.3.1 diff --git a/charts/node/templates/statefulset.yaml b/charts/node/templates/statefulset.yaml index 35c085a7..64123070 100644 --- a/charts/node/templates/statefulset.yaml +++ b/charts/node/templates/statefulset.yaml @@ -74,7 +74,7 @@ spec: - -c - | set -eu -o pipefail - if [ -d "/data/chains/${CHAIN_PATH}/db" ]; then + if [ -d "/data/chains/${CHAIN_PATH}/{{ $databasePath }}" ]; then echo "Database directory already exists, skipping chain snapshot download" else echo "Downloading chain snapshot" @@ -103,12 +103,12 @@ spec: - -c - | set -eu -o pipefail - if [ -d "/data/relay/chains/${RELAY_CHAIN_PATH}/db" ]; then + if [ -d "/data/relay/chains/${RELAY_CHAIN_PATH}/{{ $databasePath }}" ]; then echo "Database directory already exists, skipping relay-chain snapshot download" else echo "Downloading relay-chain snapshot" RELAY_SNAPSHOT_URL="{{ .Values.node.collator.relayChainDataSnapshotUrl }}" - mkdir -p /data/relay/chains/${RELAY_CHAIN_PATH}/db + mkdir -p /data/relay/chains/${RELAY_CHAIN_PATH}/{{ $databasePath }} if [ "${RELAY_SNAPSHOT_FORMAT}" == "lz4" ]; then wget -O - ${RELAY_SNAPSHOT_URL} | lz4 -c -d - | tar -x -C /data/chains/${RELAY_CHAIN_PATH}/ else @@ -135,7 +135,7 @@ spec: {{- if .Values.googleCloudSdk.serviceAccountKey }} gcloud auth activate-service-account --key-file /tmp/service-account-key.json {{- end }} - if [ -d "/data/chains/${CHAIN_PATH}/db" ]; then + if [ -d "/data/chains/${CHAIN_PATH}/{{ $databasePath }}" ]; then echo "Chain database directory already exists, skipping GCS sync" else BUCKET_URL="{{ .Values.node.chainDataGcsBucketUrl }}" @@ -144,7 +144,7 @@ spec: echo "Failed to retrieve latest_version metadata" exit 1 fi - mkdir -p /data/chains/${CHAIN_PATH}/db + mkdir -p /data/chains/${CHAIN_PATH}/{{ $databasePath }} gsutil -m -o "GSUtil:parallel_process_count=3" -o "GSUtil:parallel_thread_count=15" rsync -d -r ${BUCKET_URL}/${LATEST} /data/chains/${CHAIN_PATH}/{{ $databasePath }}/ fi env: @@ -170,7 +170,7 @@ spec: {{- if .Values.googleCloudSdk.serviceAccountKey }} gcloud auth activate-service-account --key-file /tmp/service-account-key.json {{- end }} - if [ -d "/data/relay/chains/${RELAY_CHAIN_PATH}/db" ]; then + if [ -d "/data/relay/chains/${RELAY_CHAIN_PATH}/{{ $databasePath }}" ]; then echo "Relay-chain database directory already exists, skipping GCS sync" else BUCKET_URL="{{ .Values.node.collator.relayChainDataGcsBucketUrl }}" @@ -179,7 +179,7 @@ spec: echo "Failed to retrieve latest_version metadata" exit 1 fi - mkdir -p /data/relay/chains/${RELAY_CHAIN_PATH}/db + mkdir -p /data/relay/chains/${RELAY_CHAIN_PATH}/{{ $databasePath }} gsutil -m -o "GSUtil:parallel_process_count=3" -o "GSUtil:parallel_thread_count=15" rsync -d -r ${BUCKET_URL}/${LATEST} /data/relay/chains/${RELAY_CHAIN_PATH}/{{ $databasePath }}/ fi env: