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

Use faster droplet for snapshot service #347

Merged
merged 1 commit into from
Nov 21, 2023
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 terraform/daily_snapshot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module "daily_snapshot" {

# Configure service:
name = "forest-snapshot-dev" # droplet name
size = "s-4vcpu-16gb-amd" # droplet size
size = "c2-8vcpu-16gb" # droplet size
slack_channel = "#forest-dump" # slack channel for notifications
snapshot_bucket = "forest-archive-dev"
snapshot_endpoint = "fra1.digitaloceanspaces.com"
Expand Down
2 changes: 1 addition & 1 deletion terraform/daily_snapshot/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module "daily_snapshot" {

# Configure service:
name = "forest-snapshot" # droplet name
size = "s-4vcpu-16gb-amd" # droplet size
size = "c2-8vcpu-16gb" # droplet size
slack_channel = "#forest-notifications" # slack channel for notifications
snapshot_bucket = "forest-archive"
forest_tag = "v0.16.1"
Expand Down
9 changes: 2 additions & 7 deletions terraform/modules/daily_snapshot/service/upload_snapshot.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# If Forest hasn't synced to the network after 3 hours, something has gone wrong.
SYNC_TIMEOUT=3h
# If Forest hasn't synced to the network after 6 hours, something has gone wrong.
SYNC_TIMEOUT=6h

if [[ $# != 3 ]]; then
echo "Usage: bash $0 CHAIN_NAME LOG_EXPORT_DAEMON LOG_EXPORT_METRICS"
Expand Down Expand Up @@ -67,11 +67,6 @@ forest-tool db destroy --force --config config.toml --chain "$CHAIN_NAME"
forest --config config.toml --chain "$CHAIN_NAME" --auto-download-snapshot --halt-after-import
forest --config config.toml --chain "$CHAIN_NAME" --no-gc --save-token=token.txt --detach
timeout "$SYNC_TIMEOUT" forest-cli sync wait
# Forest isn't waiting until fully synced. Tracking issue: https://github.com/ChainSafe/forest/issues/3540
# Calling 'sync wait' multiple times is a work-around.
timeout "$SYNC_TIMEOUT" forest-cli sync wait
timeout "$SYNC_TIMEOUT" forest-cli sync wait
timeout "$SYNC_TIMEOUT" forest-cli sync wait
forest-cli snapshot export -o forest_db/
forest-cli --token=\$(cat token.txt) shutdown --force

Expand Down