forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
100 lines (85 loc) · 3.48 KB
/
Copy pathjustfile
File metadata and controls
100 lines (85 loc) · 3.48 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
set shell := ["bash", "-uc"]
default:
just --list
# ============================================================================
# Local benchmarking commands
# ============================================================================
# Test instrumented run using signet (includes report generation)
[group('local')]
test-instrumented datadir:
nix develop --command python3 bench.py --profile quick experiment run \
bench/experiments/test-signet.toml \
--subject-name head \
--profile-name 450-instrumented \
--datadir {{ datadir }} \
--binaries-dir ./binaries \
--skip-existing
nix develop --command python3 bench.py report bench-output/ bench-output/
# Test uninstrumented run using signet
[group('local')]
test-uninstrumented datadir:
nix develop --command python3 bench.py --profile quick experiment run \
bench/experiments/test-signet.toml \
--subject-name head \
--profile-name 450-uninstrumented \
--datadir {{ datadir }} \
--binaries-dir ./binaries \
--skip-existing
# Full benchmark with instrumentation (flamegraphs + plots)
[group('local')]
instrumented datadir:
python3 bench.py experiment run \
bench/experiments/pr.toml \
--subject-name head \
--profile-name 450-instrumented \
--datadir {{ datadir }} \
--skip-existing
# Just build a binary (useful for incremental testing)
[group('local')]
build commit:
python3 bench.py build {{ commit }}
# Run the default PR-style experiment
[group('local')]
run datadir:
python3 bench.py experiment run bench/experiments/pr.toml --datadir {{ datadir }}
# Generate plots from a debug.log file
[group('local')]
analyze commit logfile output_dir="./plots":
python3 bench.py analyze {{ commit }} {{ logfile }} --output-dir {{ output_dir }}
# Generate HTML report from benchmark results
[group('local')]
report input_dir output_dir nightly_history="":
#!/usr/bin/env bash
set -euo pipefail
if [ -n "{{ nightly_history }}" ]; then
python3 bench.py report {{ input_dir }} {{ output_dir }} --nightly-history {{ nightly_history }}
else
python3 bench.py report {{ input_dir }} {{ output_dir }}
fi
# ============================================================================
# CI commands (called by GitHub Actions)
# ============================================================================
# Run experiment for CI
[group('ci')]
ci-run experiment datadir tmp_dir output_dir binaries_dir:
python3 bench.py experiment run \
{{ experiment }} \
--datadir {{ datadir }} \
--tmp-dir {{ tmp_dir }} \
--output-dir {{ output_dir }} \
--binaries-dir {{ binaries_dir }} \
--skip-existing
# ============================================================================
# Git helpers
# ============================================================================
# Cherry-pick commits from a Bitcoin Core PR onto this branch
[group('git')]
pick-pr pr_number:
#!/usr/bin/env bash
set -euxo pipefail
if ! git remote get-url upstream 2>/dev/null | grep -q "bitcoin/bitcoin"; then
echo "Error: 'upstream' remote not found or doesn't point to bitcoin/bitcoin"
echo "Please add it with: git remote add upstream https://github.com/bitcoin/bitcoin.git"
exit 1
fi
git fetch upstream pull/{{ pr_number }}/head:bench-{{ pr_number }} && git cherry-pick $(git rev-list --reverse bench-{{ pr_number }} --not upstream/master)