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

[bsc] fix init-from-gcs with pruneancient #310

Merged
merged 1 commit into from
Jul 19, 2024
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 dysnix/bsc/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: bsc
description: Binance Smart Chain chart for Kubernetes
version: 0.6.45
version: 0.6.46
appVersion: 1.4.11

keywords:
Expand Down
8 changes: 5 additions & 3 deletions dysnix/bsc/templates/scripts/_init_from_gcs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ S_STATE_URL="/state_url"
S_ANCIENT_URL="/ancient_url"
S_STATS="/stats"
MAX_USED_SPACE_PERCENT={{ .Values.bsc.initFromGCS.maxUsedSpacePercent }}
S5CMD_SYNC_STATE_OPTS=""
S5CMD_SYNC_ANCIENT_OPTS="--part-size 200 --concurrency 2"
S5CMD_STATE_OPTS=""
S5CMD_ANCIENT_OPTS="--part-size 200 --concurrency 2"
S5CMD_ANCIENT_OPTS=""
{{- if .Values.bsc.pruneancient }}
# we expect the source snapshot to be pruned, thus we may increase workers from default 256 to speed things up
# as ancient dir has less than 100 files with the size less than 10GB, we want to run full speed on state dir instead
Expand Down Expand Up @@ -131,9 +133,9 @@ while [ "${SYNC}" -gt 0 ] ; do
# sync from cloud to local disk, with removing existing [missing in the cloud] files
# run multiple syncs in background

time ${S5CMD} sync --delete ${S5CMD_STATE_OPTS} s3://${STATE_SRC}/* ${STATE_TMP_DIR}/ > cplist_state.txt &
time ${S5CMD} ${S5CMD_STATE_OPTS} sync --delete ${S5CMD_SYNC_STATE_OPTS} s3://${STATE_SRC}/* ${STATE_TMP_DIR}/ > cplist_state.txt &
STATE_CP_PID=$!
time nice ${S5CMD} sync --delete ${S5CMD_ANCIENT_OPTS} s3://${ANCIENT_SRC}/* ${ANCIENT_TMP_DIR}/ > cplist_ancient.txt &
time nice ${S5CMD} ${S5CMD_ANCIENT_OPTS} sync --delete ${S5CMD_SYNC_ANCIENT_OPTS} s3://${ANCIENT_SRC}/* ${ANCIENT_TMP_DIR}/ > cplist_ancient.txt &
ANCIENT_CP_PID=$!

# wait for all syncs to complete
Expand Down
2 changes: 1 addition & 1 deletion dysnix/bsc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ bsc:
baseUrlOverride: "" # "bucket/path/to/dir"
fullResyncOnSrcUpdate: false
maxUsedSpacePercent: 93 # percents
boostStateCopyWorkers: 800
boostStateCopyWorkers: 800 # 800 is ok for 16vCPU and 1500MB/s disk
syncToGCS:
enabled: false
image: peakcom/s5cmd:v2.2.2
Expand Down
Loading