-
Notifications
You must be signed in to change notification settings - Fork 29
132 lines (117 loc) · 4.71 KB
/
Copy pathgossip-benchmark.yml
File metadata and controls
132 lines (117 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Gossip Benchmark
on:
workflow_dispatch:
inputs:
duration_secs:
description: "Benchmark duration in seconds"
required: false
default: "60"
steady_interval_ms:
description: "Steady mode update interval in milliseconds"
required: false
default: "50"
burst_updates_per_window:
description: "Burst mode updates per window"
required: false
default: "200"
burst_window_ms:
description: "Burst mode window in milliseconds"
required: false
default: "1000"
gossip_network_interval_ms:
description: "Fiber gossip network maintenance interval in milliseconds"
required: false
default: "60000"
gossip_store_interval_ms:
description: "Fiber gossip store maintenance interval in milliseconds"
required: false
default: "20000"
schedule:
- cron: "0 3 * * 0"
release:
types: [published]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
gossip-benchmark:
name: Gossip Benchmark (Production-like Intervals)
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dsherret/rust-toolchain-file@v1
- uses: Swatinem/rust-cache@v2
with:
key: gossip-benchmark-${{ runner.os }}
- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
ckb-version: "0.202.0"
cache-prefix: "gossip-benchmark"
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
./tests/deploy/udt-init/target
./tests/perf/target
key: gossip-benchmark-build-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
gossip-benchmark-build-${{ runner.os }}-
- name: Build rust code
run: |
cd ./tests/deploy/udt-init && cargo build --locked && cd -
cd ./tests/perf/ && cargo build --release --locked && cd -
- name: Run gossip steady and burst benchmarks
env:
DURATION_SECS: ${{ github.event.inputs.duration_secs || '60' }}
STEADY_INTERVAL_MS: ${{ github.event.inputs.steady_interval_ms || '50' }}
BURST_UPDATES_PER_WINDOW: ${{ github.event.inputs.burst_updates_per_window || '200' }}
BURST_WINDOW_MS: ${{ github.event.inputs.burst_window_ms || '1000' }}
GOSSIP_NETWORK_INTERVAL_MS: ${{ github.event.inputs.gossip_network_interval_ms || '60000' }}
GOSSIP_STORE_INTERVAL_MS: ${{ github.event.inputs.gossip_store_interval_ms || '20000' }}
run: |
set -euo pipefail
export ON_GITHUB_ACTION=y
REMOVE_OLD_STATE=y \
ENABLE_FIBER_METRICS=1 \
START_BOOTNODE=y \
CKB_LOG=warn \
TEST_ENV=release \
FIBER_GOSSIP_NETWORK_MAINTENANCE_INTERVAL_MS="${GOSSIP_NETWORK_INTERVAL_MS}" \
FIBER_GOSSIP_STORE_MAINTENANCE_INTERVAL_MS="${GOSSIP_STORE_INTERVAL_MS}" \
./tests/nodes/start.sh > gossip-benchmark.log 2>&1 &
./tests/nodes/wait.sh
cd ./tests/perf/
cargo run --bin run-test --release integration
cargo run --bin run-test --release -- gossip-benchmark steady \
--duration-secs "${DURATION_SECS}" \
--interval-ms "${STEADY_INTERVAL_MS}" \
--result-mode base
cp artifacts/gossip_baseline.json artifacts/gossip_steady_baseline.json
cargo run --bin run-test --release -- gossip-benchmark burst \
--duration-secs "${DURATION_SECS}" \
--burst-updates-per-window "${BURST_UPDATES_PER_WINDOW}" \
--burst-window-ms "${BURST_WINDOW_MS}" \
--result-mode base
cp artifacts/gossip_baseline.json artifacts/gossip_burst_baseline.json
{
echo "duration_secs=${DURATION_SECS}"
echo "steady_interval_ms=${STEADY_INTERVAL_MS}"
echo "burst_updates_per_window=${BURST_UPDATES_PER_WINDOW}"
echo "burst_window_ms=${BURST_WINDOW_MS}"
echo "gossip_network_interval_ms=${GOSSIP_NETWORK_INTERVAL_MS}"
echo "gossip_store_interval_ms=${GOSSIP_STORE_INTERVAL_MS}"
} > artifacts/gossip_benchmark_params.txt
- name: Upload gossip benchmark artifacts
uses: actions/upload-artifact@v4
with:
name: gossip-benchmark-results
path: |
./gossip-benchmark.log
./tests/perf/artifacts/gossip_baseline.json
./tests/perf/artifacts/gossip_steady_baseline.json
./tests/perf/artifacts/gossip_burst_baseline.json
./tests/perf/artifacts/gossip_benchmark_params.txt