Skip to content

Commit

Permalink
A0-4610: Added support for overriding snapshot say (#1933)
Browse files Browse the repository at this point in the history
# Description

1. Adds support for overriding snapshot date. If this date is not given,
current day is assumed (current behaviour).


![image](https://github.com/user-attachments/assets/94a979e4-1b0b-4625-8368-158a1532d539)

2. Move workflow run time to +1 day.

## Type of change

Please delete options that are not relevant.

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
  • Loading branch information
Marcin-Radecki authored Feb 5, 2025
1 parent 05418fa commit 4bc5d3e
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/actions/sync-from-snapshot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
type: string
required: true
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date is assumed."
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
aws-access-key-id:
Expand Down Expand Up @@ -47,7 +47,7 @@ runs:
shell: bash
run: |
if [[ '${{ inputs.snapshot-day }}' == "" ]]; then
snapshot_day=$(date "+%Y-%m-%d")
snapshot_day=$(date "+%Y-%m-%d" -d "1 day ago")
else
snapshot_day='${{ inputs.snapshot-day }}'
fi
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-from-snapshot-mainnet-paritydb-pruned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@

name: Sync from snapshot, Mainnet, ParityDB pruned
on:
# At 20:00 on Saturday
# At 15:00 on Sunday
# Time corresponds with a snapshot creation time
schedule:
- cron: '0 20 * * 6'
- cron: '0 15 * * 0'
workflow_dispatch:
inputs:
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
default: ''

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -48,6 +54,7 @@ jobs:
args: --mainnet --parity-db --pruned
aws-access-key-id: ${{ secrets.AWS_MAINNET_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_S3_SECRET_ACCESS_KEY }}
snapshot-day: ${{ inputs.snapshot-day }}

slack-notification:
name: Slack notification
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-from-snapshot-mainnet-paritydb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@

name: Sync from snapshot test, Mainnet, ParityDB non-pruned
on:
# At 21:00 on Saturday
# At 15:00 on Sunday
# Time corresponds with a snapshot creation time
schedule:
- cron: '0 21 * * 6'
- cron: '0 15 * * 0'
workflow_dispatch:
inputs:
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
default: ''

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -48,6 +54,7 @@ jobs:
args: --mainnet --parity-db
aws-access-key-id: ${{ secrets.AWS_MAINNET_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_S3_SECRET_ACCESS_KEY }}
snapshot-day: ${{ inputs.snapshot-day }}

slack-notification:
name: Slack notification
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-from-snapshot-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@

name: Sync from snapshot test, Mainnet, RocksDB
on:
# At 22:00 on Saturday
# At 15:00 on Sunday
# Time corresponds with a snapshot creation time
schedule:
- cron: '0 22 * * 6'
- cron: '0 15 * * 0'
workflow_dispatch:
inputs:
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
default: ''

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -48,6 +54,7 @@ jobs:
args: --mainnet
aws-access-key-id: ${{ secrets.AWS_MAINNET_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_S3_SECRET_ACCESS_KEY }}
snapshot-day: ${{ inputs.snapshot-day }}

slack-notification:
name: Slack notification
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-from-snapshot-testnet-paritydb-pruned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@

name: Sync from snapshot, Testnet, ParityDB pruned
on:
# At 20:00 on Saturday
# At 15:00 on Sunday
# Time corresponds with a snapshot creation time
schedule:
- cron: '0 20 * * 6'
- cron: '0 15 * * 0'
workflow_dispatch:
inputs:
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
default: ''

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -45,6 +51,7 @@ jobs:
args: --testnet --parity-db --pruned
aws-access-key-id: ${{ secrets.AWS_TESTNET_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TESTNET_S3_SECRET_ACCESS_KEY }}
snapshot-day: ${{ inputs.snapshot-day }}

slack-notification:
name: Slack notification
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-from-snapshot-testnet-paritydb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@

name: Sync from snapshot test, Testnet, ParityDB non-pruned
on:
# At 21:00 on Saturday
# At 15:00 on Sunday
# Time corresponds with a snapshot creation time
schedule:
- cron: '0 21 * * 6'
- cron: '0 15 * * 0'
workflow_dispatch:
inputs:
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
default: ''

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -45,6 +51,7 @@ jobs:
args: --testnet --parity-db
aws-access-key-id: ${{ secrets.AWS_TESTNET_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TESTNET_S3_SECRET_ACCESS_KEY }}
snapshot-day: ${{ inputs.snapshot-day }}

slack-notification:
name: Slack notification
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-from-snapshot-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@

name: Sync from snapshot test, Testnet, RocksDB
on:
# At 22:00 on Saturday
# At 15:00 on Sunday
# Time corresponds with a snapshot creation time
schedule:
- cron: '0 22 * * 6'
- cron: '0 15 * * 0'
workflow_dispatch:
inputs:
snapshot-day:
description: "Day in date format %Y-%m-%d. If not given, current date - 1 day is assumed."
type: string
required: false
default: ''

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -45,6 +51,7 @@ jobs:
args: --testnet
aws-access-key-id: ${{ secrets.AWS_TESTNET_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TESTNET_S3_SECRET_ACCESS_KEY }}
snapshot-day: ${{ inputs.snapshot-day }}

slack-notification:
name: Slack notification
Expand Down

0 comments on commit 4bc5d3e

Please sign in to comment.