Skip to content

Commit eb24f66

Browse files
A0-0000: Update Snapshot URLs (#1969)
This change update snapshot URLs to new ones, as well as remove "mark snapshot as latest" feature from tests,
1 parent 7e6fa14 commit eb24f66

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

.github/actions/sync-from-snapshot/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ runs:
5858
run: |
5959
./.github/scripts/test_db_sync.sh \
6060
${{ inputs.args }} \
61-
--snapshot-day ${{ steps.get-snapshot-day.outputs.snapshot-day }} \
62-
--mark-snapshot-as-latest
61+
--snapshot-day ${{ steps.get-snapshot-day.outputs.snapshot-day }}
6362
6463
- name: Archive logs from failed test
6564
if: ${{ failure() }}

.github/scripts/test_db_sync.sh

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ PARITY_DB="false"
66
PRUNING="false"
77
ENV="mainnet"
88
SNAPSHOT_DAY=""
9-
MARK_SNAPSHOT_AS_LATEST=""
10-
S3_BUCKET=""
119

1210
while [[ $# -gt 0 ]]; do
1311
case "$1" in
@@ -29,9 +27,6 @@ while [[ $# -gt 0 ]]; do
2927
SNAPSHOT_DAY="$2"
3028
shift; shift
3129
;;
32-
--mark-snapshot-as-latest)
33-
MARK_SNAPSHOT_AS_LATEST="true"
34-
shift;;
3530
*)
3631
echo "Unrecognized argument: $1"
3732
exit 1;;
@@ -53,41 +48,35 @@ if [[ "${ENV}" == "mainnet" ]]; then
5348
BOOT_NODES=/dns4/bootnode-eu-central-1-0.azero.dev/tcp/30333/p2p/12D3KooWEF1Eo7uFZWdqFsTPP7CehpRt5NeXFwCe3157qpoU5aqd/dns4/bootnode-eu-central-1-1.azero.dev/tcp/30333/p2p/12D3KooWSeKnKHwumcVuWz2g5wn5xyWZpZJzuZXHJrEdpi8bj4HR/dns4/bootnode-us-east-1-0.azero.dev/tcp/30333/p2p/12D3KooWFQSGvQii2gRGB5T4M6TXhM83JV4bTEhubCBpdoR6Rkwk/dns4/bootnode-us-east-1-1.azero.dev/tcp/30333/p2p/12D3KooWSX2TbzpengsKsXdNPs6g2aQpp91qduL5FPax2SqgCaxa
5449
DB_PATH="chains/mainnet/"
5550
TARGET_CHAIN="wss://ws.azero.dev"
56-
S3_URL="http://db.azero.dev.s3-website.eu-central-1.amazonaws.com"
57-
S3_BUCKET="db.azero.dev"
51+
BASE_SNAPSHOT_URL="https://azero-snapshots.dev/mainnet"
5852
else
5953
SOURCE_CHAINSPEC="./bin/node/src/resources/testnet_chainspec.json"
6054
BOOT_NODES=/dns4/bootnode-eu-central-1-0.test.azero.dev/tcp/30333/p2p/12D3KooWRkGLz4YbVmrsWK75VjFTs8NvaBu42xhAmQaP4KeJpw1L/dns4/bootnode-us-east-1-0.test.azero.dev/tcp/30333/p2p/12D3KooWSv1nApKkcnq8ZVHJQLK5GJ4NKS9ebag9QrRTzksLTGUy
6155
DB_PATH="chains/testnet/"
6256
TARGET_CHAIN="wss://ws.test.azero.dev"
63-
S3_URL="http://db.test.azero.dev.s3-website.eu-central-1.amazonaws.com"
64-
S3_BUCKET="db.test.azero.dev"
57+
BASE_SNAPSHOT_URL="https://azero-snapshots.dev/testnet"
6558
fi
6659

6760
declare -a DB_ARG
6861
S3_SNAPSHOT_PREFIX=""
69-
LATEST_SNAPSHOT_NAME=""
7062
if [[ "${PARITY_DB}" == "true" && "${PRUNING}" == "true" ]]; then
7163
DB_ARG+=("--database paritydb")
7264
DB_ARG+=("--enable-pruning")
73-
S3_SNAPSHOT_PREFIX="db_backup_parity_pruned"
74-
LATEST_SNAPSHOT_NAME="latest-parity-pruned.html"
65+
S3_SNAPSHOT_PREFIX="paritydb-pruned"
7566
fi
7667
if [[ "${PARITY_DB}" == "false" && "${PRUNING}" == "true" ]]; then
7768
DB_ARG+=("--enable-pruning")
78-
S3_SNAPSHOT_PREFIX="db_backup_rocksdb_pruned"
79-
LATEST_SNAPSHOT_NAME="latest-rocksdb-pruned.html"
69+
S3_SNAPSHOT_PREFIX="rocksdb-pruned"
8070
fi
8171
if [[ "${PARITY_DB}" == "false" && "${PRUNING}" == "false" ]]; then
82-
S3_SNAPSHOT_PREFIX="db_backup"
83-
LATEST_SNAPSHOT_NAME="latest.html"
72+
S3_SNAPSHOT_PREFIX="rocksdb"
8473
fi
8574

8675
if [[ -z "${SNAPSHOT_DAY}" ]]; then
8776
SNAPSHOT_DAY=$(date "+%Y-%m-%d")
8877
fi
8978

90-
DB_SNAPSHOT_URL="${S3_URL}/${SNAPSHOT_DAY}/${S3_SNAPSHOT_PREFIX}_${SNAPSHOT_DAY}.tar.gz"
79+
DB_SNAPSHOT_URL="${BASE_SNAPSHOT_URL}/${S3_SNAPSHOT_PREFIX}/db_${SNAPSHOT_DAY}.tar.gz"
9180

9281
initialize() {
9382
pip install substrate-interface
@@ -150,11 +139,5 @@ while [ $CURRENT_BLOCK -le $TARGET_BLOCK ]; do
150139
echo "Sync status: ${CURRENT_BLOCK}/${TARGET_BLOCK}".
151140
done
152141

153-
if [[ "${MARK_SNAPSHOT_AS_LATEST}" == "true" ]]; then
154-
echo "<meta http-equiv=\"refresh\" content=\"0;url=${S3_URL}/${SNAPSHOT_DAY}/${S3_SNAPSHOT_PREFIX}_${SNAPSHOT_DAY}.tar.gz\">" | \
155-
aws s3 cp - "s3://${S3_BUCKET}/${LATEST_SNAPSHOT_NAME}" \
156-
--website-redirect "${S3_URL}/${SNAPSHOT_DAY}/${S3_SNAPSHOT_PREFIX}_${SNAPSHOT_DAY}.tar.gz"
157-
fi
158-
159142
kill -9 $ALEPH_NODE_PID
160143

0 commit comments

Comments
 (0)