Repository navigation
198 lines (169 loc) · 8.12 KB
/
Copy pathbench.yml
File metadata and controls
198 lines (169 loc) · 8.12 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
on:
workflow_call:
inputs:
save-rust-cache:
required: false
type: string
default: "true"
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUSTUP_MAX_RETRIES: 10
UV_LOCKED: 1
jobs:
benchmarks-walltime-build:
name: "walltime build"
# codspeed-macro doesn't support Ubuntu 24.04 yet
runs-on: depot-ubuntu-22.04-arm-4
# uv-dev benchmarks pull requests but imports its main-branch measurements from uv.
if: ${{ github.repository == 'astral-sh/uv' || (github.repository == 'astral-sh/uv-dev' && github.ref != 'refs/heads/main') }}
timeout-minutes: 30
steps:
- name: "Checkout Branch"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
save-if: ${{ inputs.save-rust-cache == 'true' }}
- name: "Install Rust toolchain"
run: rustup show
- name: "Install uv"
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
# renovate: datasource=github-release-attachments depName=astral-sh/uv
version: "0.12.13"
checksum: "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9"
- name: "Install requirements and prime cache"
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev libldap2-dev libkrb5-dev
cargo run --bin uv -- venv --cache-dir .cache
# Resolve benchmark fixtures without the repository's tooling build policy.
cargo run --bin uv -- --config-file test/uv.toml pip compile test/requirements/jupyter.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
cargo run --bin uv -- --config-file test/uv.toml pip compile test/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
- name: "Build benchmarks"
run: uv run --only-dev cargo codspeed build -m walltime --profile profiling -p uv-bench --bench uv --bench workspace_discovery --bench atomic_write --bench cached_client
- name: "Create artifact archive"
run: tar -cvf benchmarks-walltime.tar target/codspeed target/debug/uv .cache
- name: "Upload benchmark artifacts"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: benchmarks-walltime
path: benchmarks-walltime.tar
retention-days: 1
benchmarks-walltime-run:
name: "walltime on aarch64 linux"
runs-on: codspeed-macro
needs: benchmarks-walltime-build
timeout-minutes: 30
permissions:
contents: read
id-token: write # for codspeed authentication
steps:
- name: "Checkout Branch"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: "Install uv"
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
# renovate: datasource=github-release-attachments depName=astral-sh/uv
version: "0.12.13"
checksum: "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9"
- name: "Download benchmark artifacts"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: benchmarks-walltime
- name: "Extract artifact archive"
run: tar -xvf benchmarks-walltime.tar
- name: "Create venv"
run: ./target/debug/uv venv --cache-dir .cache
- name: "Retain benchmark profiles"
id: profiles
# Only public main pushes produce reusable baseline profiles.
if: ${{ github.repository == 'astral-sh/uv' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: ./target/debug/uv run --script scripts/codspeed-profiles.py start "$RUNNER_TEMP/codspeed-walltime" walltime >> "$GITHUB_OUTPUT"
- name: "Run benchmarks"
uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
with:
run: uv run --only-dev cargo codspeed run
mode: walltime
upload-url: ${{ steps.profiles.outputs.upload-url }}
- name: "Finish profile capture"
if: ${{ always() && steps.profiles.outcome == 'success' }}
run: ./target/debug/uv run --script scripts/codspeed-profiles.py finish "$RUNNER_TEMP/codspeed-walltime"
- name: "Upload benchmark profiles"
if: ${{ steps.profiles.outcome == 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: codspeed-profiles-walltime
path: |
${{ runner.temp }}/codspeed-walltime/metadata.json
${{ runner.temp }}/codspeed-walltime/profile.tar
compression-level: 0
if-no-files-found: error
retention-days: 30
benchmarks-simulated:
name: "simulated"
runs-on: depot-ubuntu-24.04-4
# Only uv measures main; uv-dev reuses the resulting profiles.
if: ${{ github.repository == 'astral-sh/uv' || (github.repository == 'astral-sh/uv-dev' && github.ref != 'refs/heads/main') }}
timeout-minutes: 30
permissions:
contents: read
id-token: write # for codspeed authentication
steps:
- name: "Checkout Branch"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
save-if: ${{ inputs.save-rust-cache == 'true' }}
- name: "Install Rust toolchain"
run: rustup show
- name: "Install uv"
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
# renovate: datasource=github-release-attachments depName=astral-sh/uv
version: "0.12.13"
checksum: "745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd"
- name: "Install requirements and prime cache"
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev libldap2-dev libkrb5-dev
cargo run --bin uv -- venv --cache-dir .cache
# Resolve benchmark fixtures without the repository's tooling build policy.
cargo run --bin uv -- --config-file test/uv.toml pip compile test/requirements/jupyter.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
cargo run --bin uv -- --config-file test/uv.toml pip compile test/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
- name: "Build benchmarks"
run: uv run --only-dev cargo codspeed build --profile profiling -p uv-bench
- name: "Retain benchmark profiles"
id: profiles
# Only public main pushes produce reusable baseline profiles.
if: ${{ github.repository == 'astral-sh/uv' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: ./target/debug/uv run --script scripts/codspeed-profiles.py start "$RUNNER_TEMP/codspeed-simulation" simulation >> "$GITHUB_OUTPUT"
- name: "Run benchmarks"
uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
with:
run: uv run --only-dev cargo codspeed run
mode: simulation
upload-url: ${{ steps.profiles.outputs.upload-url }}
- name: "Finish profile capture"
if: ${{ always() && steps.profiles.outcome == 'success' }}
run: ./target/debug/uv run --script scripts/codspeed-profiles.py finish "$RUNNER_TEMP/codspeed-simulation"
- name: "Upload benchmark profiles"
if: ${{ steps.profiles.outcome == 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: codspeed-profiles-simulation
path: |
${{ runner.temp }}/codspeed-simulation/metadata.json
${{ runner.temp }}/codspeed-simulation/profile.tar
compression-level: 0
if-no-files-found: error
retention-days: 30