From dcd4d7a7a8de3ab41d9fb859b910c3b962eaa2fe Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 9 Nov 2022 21:50:32 -0500 Subject: [PATCH] update docker entrypoint and example composes --- docs/docker_examples/docker-compose.yml | 3 +-- docs/docker_examples/hub-compose.yml | 3 +-- scripts/entrypoint.sh | 12 ++---------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/docs/docker_examples/docker-compose.yml b/docs/docker_examples/docker-compose.yml index 6de55f3..556d1ea 100644 --- a/docs/docker_examples/docker-compose.yml +++ b/docs/docker_examples/docker-compose.yml @@ -17,11 +17,10 @@ services: - "lbry_rocksdb:/database" environment: - HUB_COMMAND=scribe - - SNAPSHOT_URL=https://snapshots.lbry.com/hub/lbry-rocksdb.zip + - SNAPSHOT_URL=https://snapshots.lbry.com/hub/block_1256013/lbry-rocksdb.tar command: # for full options, see `scribe --help` - "--daemon_url=http://lbry:lbry@127.0.0.1:9245" - "--max_query_workers=2" - # - "--cache_all_tx_hashes" # uncomment to keep an index of all tx hashes in memory. This uses lots (10+g) of memory but substantially improves performance. - "--index_address_statuses" scribe_elastic_sync: depends_on: diff --git a/docs/docker_examples/hub-compose.yml b/docs/docker_examples/hub-compose.yml index d7642d3..88b7d3c 100644 --- a/docs/docker_examples/hub-compose.yml +++ b/docs/docker_examples/hub-compose.yml @@ -14,11 +14,10 @@ services: - "lbry_rocksdb:/database" environment: - HUB_COMMAND=scribe - - SNAPSHOT_URL=https://snapshots.lbry.com/hub/lbry-rocksdb.zip + - SNAPSHOT_URL=https://snapshots.lbry.com/hub/block_1256013/lbry-rocksdb.tar command: - "--daemon_url=http://lbry:lbry@127.0.0.1:9245" - "--max_query_workers=2" - - "--cache_all_tx_hashes" scribe_elastic_sync: image: lbry/hub:${SCRIBE_TAG:-master} restart: always diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index bef8856..5e74456 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -8,16 +8,8 @@ SNAPSHOT_URL="${SNAPSHOT_URL:-}" #off by default. latest snapshot at https://lbr if [[ "$HUB_COMMAND" == "scribe" ]] && [[ -n "$SNAPSHOT_URL" ]] && [[ ! -d /database/lbry-rocksdb ]]; then files="$(ls)" - echo "Downloading hub snapshot from $SNAPSHOT_URL" - wget --no-verbose --trust-server-names --content-disposition "$SNAPSHOT_URL" - echo "Extracting snapshot..." - filename="$(grep -vf <(echo "$files") <(ls))" # finds the file that was not there before - case "$filename" in - *.tgz|*.tar.gz|*.tar.bz2 ) tar xvf "$filename" --directory /database ;; - *.zip ) unzip "$filename" -d /database/ ;; - * ) echo "Don't know how to extract ${filename}. SNAPSHOT COULD NOT BE LOADED" && exit 1 ;; - esac - rm "$filename" + echo "Downloading and extracting hub snapshot from $SNAPSHOT_URL" + wget --no-verbose -c "$SNAPSHOT_URL" -O - | tar x -C /database fi if [ -z "$HUB_COMMAND" ]; then