-
Notifications
You must be signed in to change notification settings - Fork 6
120 lines (105 loc) · 4.86 KB
/
Copy pathhotpath-runtime-core.yml
File metadata and controls
120 lines (105 loc) · 4.86 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
# Narrow Hotpath lane for the runtime-core GitRepositoryAuthority slice.
#
# Proves both directions of the profiling contract for this one surface
# without changing what default/production CI builds:
#
# - feature-off: the git_repository_authority tests and bench run on
# default features; the dedicated lane test additionally proves that
# report/output variables produce no report file and no listener on
# 6770/6771, and a dependency-graph check proves the default feature set
# never enables Hotpath collection.
# - feature-on (--features hotpath): the same tests pass, and the lane
# test proves one process-boundary guard emits a JSON exit report
# carrying the static runtime_core.git.* probe labels while the metrics
# server stays off.
#
# The CPU section (FunctionsCpu / samply autospawn) is excluded by the
# guards in the lane test and bench, and this workflow never sets
# HOTPATH_REPORT, so CPU sampling cannot be reached from here. Workspace CI
# (ci.yml) is unchanged: it keeps compiling hotpath surfaces without running
# them, and nothing here touches default or production feature sets.
name: hotpath-runtime-core
on:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
# Hotpath binds a localhost metrics server by default; the feature-on test
# turns it off itself, and this makes that explicit at the job boundary so
# the bench smoke lanes cannot race a fixed port either.
HOTPATH_METRICS_SERVER_OFF: "1"
jobs:
git-authority:
name: git_repository_authority hotpath lanes
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-pnpm
- uses: ./.github/actions/setup-linux-mold
- name: Check rust-cache restore lineage
run: |
python3 scripts/test-rust-cache-lineage.py
python3 scripts/check-rust-cache-lineage.py
# v1-rust invalidates the v0-rust blobs this lane restored, whose
# rustc-readonly .rmeta files the feature-on rebuild could not write.
- name: Cache Rust dependency artifacts
id: rust-cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-rust
shared-key: hotpath-runtime-core
cache-workspace-crates: "false"
cache-on-failure: true
- name: Discard prefix-restored compiler artifacts
run: scripts/drop-prefix-restored-rust-artifacts.sh "${{ steps.rust-cache.outputs.cache-hit }}"
# The default dependency graph must resolve the hotpath crate with the
# profiler compiled out (macros-only: expected activated feature set is
# exactly "threads"). Any hotpath* feature on that crate here means a
# default feature set started enabling collection.
- name: Default features exclude hotpath collection
run: |
cargo tree -p tracedecay-runtime-core -e features -f '{p} {f}' \
--prefix none --locked | sort -u | grep '^hotpath v'
if cargo tree -p tracedecay-runtime-core -e features -f '{p} {f}' \
--prefix none --locked | grep -E '^hotpath v[^ ]+ .*hotpath'; then
echo "::error::default features enable the hotpath profiler"
exit 1
fi
# The report/output variables mirror what the feature-off lane test
# sets in-process: nothing may read them, so the post-condition is
# that the report path never comes into existence.
- name: Feature-off tests
env:
HOTPATH_OUTPUT_FORMAT: json
HOTPATH_OUTPUT_PATH: /tmp/hotpath-feature-off-report.json
HOTPATH_REPORT: functions-timing
run: |
cargo test -p tracedecay-runtime-core --locked \
--test git_repository_authority \
--test git_repository_authority_hotpath
if [ -e /tmp/hotpath-feature-off-report.json ]; then
echo "::error::feature-off test run wrote a Hotpath report"
exit 1
fi
- name: Feature-off bench smoke (criterion --test mode)
run: |
cargo bench -p tracedecay-runtime-core --locked \
--bench git_repository_authority -- --test
# One guard per process; the lane binary holds a process-global guard,
# so keep every binary in this invocation single-threaded.
- name: Feature-on tests (--features hotpath)
run: |
cargo test -p tracedecay-runtime-core --locked --features hotpath \
--test git_repository_authority \
--test git_repository_authority_hotpath \
-- --test-threads=1
- name: Feature-on bench smoke (--features hotpath)
run: |
cargo bench -p tracedecay-runtime-core --locked --features hotpath \
--bench git_repository_authority -- --test