Skip to content

Commit

Permalink
Merge pull request #89 from paritytech/fix-database-backend-selection
Browse files Browse the repository at this point in the history
Fix database backend selection
  • Loading branch information
PierreBesson authored Jun 14, 2022
2 parents e908d74 + a356c2a commit 296c6d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions charts/node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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 }}"
Expand All @@ -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:
Expand All @@ -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 }}"
Expand All @@ -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:
Expand Down

0 comments on commit 296c6d1

Please sign in to comment.