Skip to content

Commit f4a755d

Browse files
committed
Unify benchmark build
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent e3c7401 commit f4a755d

File tree

4 files changed

+150
-34
lines changed

4 files changed

+150
-34
lines changed

.github/workflows/bench-pr.yml

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,44 @@ permissions:
1919
id-token: write # enables AWS-GitHub OIDC
2020

2121
jobs:
22+
build:
23+
timeout-minutes: 60
24+
runs-on: >-
25+
${{ github.repository == 'vortex-data/vortex'
26+
&& format('runs-on={0}/runner=bench-dedicated/tag=bench-build{1}', github.run_id, github.event.pull_request.head.repo.fork == false && '/extras=s3-cache' || '')
27+
|| 'ubuntu-latest' }}
28+
steps:
29+
- uses: runs-on/action@v2
30+
if: github.event.pull_request.head.repo.fork == false
31+
with:
32+
sccache: s3
33+
- uses: actions/checkout@v6
34+
with:
35+
ref: ${{ github.event.pull_request.head.sha }}
36+
- uses: ./.github/actions/setup-rust
37+
with:
38+
repo-token: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Build binaries
40+
shell: bash
41+
env:
42+
RUSTFLAGS: "-C target-cpu=native -C force-frame-pointers=yes"
43+
run: |
44+
cargo build --package random-access-bench --profile release_debug --features lance
45+
cargo build --package compress-bench --profile release_debug
46+
- name: Stage binaries for upload
47+
shell: bash
48+
run: |
49+
mkdir -p staging/bin
50+
cp target/release_debug/random-access-bench staging/bin/
51+
cp target/release_debug/compress-bench staging/bin/
52+
- uses: actions/upload-artifact@v7
53+
with:
54+
name: bench-binaries
55+
path: staging/
56+
retention-days: 1
57+
2258
bench:
59+
needs: build
2360
timeout-minutes: 120
2461
runs-on: >-
2562
${{ github.repository == 'vortex-data/vortex'
@@ -30,22 +67,16 @@ jobs:
3067
benchmark:
3168
- id: random-access-bench
3269
name: Random Access
33-
build_args: "--features lance"
3470
- id: compress-bench
3571
name: Compression
3672
steps:
3773
- uses: runs-on/action@v2
3874
if: github.event.pull_request.head.repo.fork == false
39-
with:
40-
sccache: s3
4175
- uses: actions/checkout@v6
4276
with:
4377
ref: ${{ github.event.pull_request.head.sha }}
4478
- name: Setup benchmark environment
4579
run: sudo bash scripts/setup-benchmark.sh
46-
- uses: ./.github/actions/setup-rust
47-
with:
48-
repo-token: ${{ secrets.GITHUB_TOKEN }}
4980

5081
- name: Install DuckDB
5182
run: |
@@ -55,12 +86,16 @@ jobs:
5586
5687
- uses: ./.github/actions/system-info
5788

58-
- name: Build binary
89+
- uses: actions/download-artifact@v8
90+
with:
91+
name: bench-binaries
92+
path: staging
93+
- name: Install binaries
5994
shell: bash
60-
env:
61-
RUSTFLAGS: "-C target-cpu=native -C force-frame-pointers=yes"
6295
run: |
63-
cargo build --package ${{ matrix.benchmark.id }} --profile release_debug ${{ matrix.benchmark.build_args }}
96+
mkdir -p target/release_debug
97+
cp staging/bin/* target/release_debug/
98+
chmod +x target/release_debug/*
6499
65100
- name: Setup Polar Signals
66101
if: github.event.pull_request.head.repo.fork == false

.github/workflows/bench.yml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,41 @@ jobs:
3131
bash scripts/commit-json.sh > new-commit.json
3232
bash scripts/cat-s3.sh vortex-ci-benchmark-results commits.json new-commit.json
3333
34+
build:
35+
timeout-minutes: 60
36+
runs-on: >-
37+
${{ github.repository == 'vortex-data/vortex'
38+
&& format('runs-on={0}/runner=bench-dedicated/extras=s3-cache/tag=bench-build', github.run_id)
39+
|| 'ubuntu-latest' }}
40+
steps:
41+
- uses: runs-on/action@v2
42+
if: github.repository == 'vortex-data/vortex'
43+
with:
44+
sccache: s3
45+
- uses: actions/checkout@v6
46+
- uses: ./.github/actions/setup-rust
47+
with:
48+
repo-token: ${{ secrets.GITHUB_TOKEN }}
49+
- name: Build binaries
50+
shell: bash
51+
env:
52+
RUSTFLAGS: "-C target-cpu=native -C force-frame-pointers=yes"
53+
run: |
54+
cargo build --bin random-access-bench --bin compress-bench --profile release_debug --features lance
55+
- name: Stage binaries for upload
56+
shell: bash
57+
run: |
58+
mkdir -p staging/bin
59+
cp target/release_debug/random-access-bench staging/bin/
60+
cp target/release_debug/compress-bench staging/bin/
61+
- uses: actions/upload-artifact@v7
62+
with:
63+
name: bench-binaries
64+
path: staging/
65+
retention-days: 1
66+
3467
bench:
68+
needs: build
3569
timeout-minutes: 120
3670
runs-on: >-
3771
${{ github.repository == 'vortex-data/vortex'
@@ -42,23 +76,16 @@ jobs:
4276
benchmark:
4377
- id: random-access-bench
4478
name: Random Access
45-
build_args: "--features lance"
4679
formats: "parquet,lance,vortex"
4780
- id: compress-bench
4881
name: Compression
49-
build_args: "--features lance"
5082
formats: "parquet,lance,vortex"
5183
steps:
5284
- uses: runs-on/action@v2
5385
if: github.repository == 'vortex-data/vortex'
54-
with:
55-
sccache: s3
5686
- uses: actions/checkout@v6
5787
- name: Setup benchmark environment
5888
run: sudo bash scripts/setup-benchmark.sh
59-
- uses: ./.github/actions/setup-rust
60-
with:
61-
repo-token: ${{ secrets.GITHUB_TOKEN }}
6289

6390
- name: Install DuckDB
6491
run: |
@@ -68,12 +95,16 @@ jobs:
6895
6996
- uses: ./.github/actions/system-info
7097

71-
- name: Build binary
98+
- uses: actions/download-artifact@v8
99+
with:
100+
name: bench-binaries
101+
path: staging
102+
- name: Install binaries
72103
shell: bash
73-
env:
74-
RUSTFLAGS: "-C target-cpu=native -C force-frame-pointers=yes"
75104
run: |
76-
cargo build --bin ${{ matrix.benchmark.id }} --profile release_debug ${{ matrix.benchmark.build_args }}
105+
mkdir -p target/release_debug
106+
cp staging/bin/* target/release_debug/
107+
chmod +x target/release_debug/*
77108
78109
- name: Setup Polar Signals
79110
uses: polarsignals/gh-actions-ps-profiling@v0.8.1
@@ -115,6 +146,7 @@ jobs:
115146
secrets: inherit
116147
with:
117148
mode: "develop"
149+
build_lance: true
118150
benchmark_matrix: |
119151
[
120152
{

.github/workflows/nightly-bench.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
with:
2424
mode: "develop"
2525
machine_type: ${{ matrix.machine_type.instance_name }}
26+
build_lance: true
2627
# datafusion:vortex uses a lot of memory
2728
benchmark_matrix: |
2829
[

.github/workflows/sql-benchmarks.yml

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
required: false
1111
type: string
1212
default: c6id.8xlarge
13+
build_lance:
14+
required: false
15+
type: boolean
16+
default: false
1317
benchmark_matrix:
1418
required: false
1519
type: string
@@ -98,7 +102,55 @@ on:
98102
]
99103
100104
jobs:
105+
build:
106+
timeout-minutes: 60
107+
runs-on: >-
108+
${{ github.repository == 'vortex-data/vortex'
109+
&& format('runs-on={0}/runner=bench-dedicated/tag=sql-build{1}', github.run_id, (inputs.mode != 'pr' || github.event.pull_request.head.repo.fork == false) && '/extras=s3-cache' || '')
110+
|| 'ubuntu-latest' }}
111+
steps:
112+
- uses: runs-on/action@v2
113+
if: inputs.mode != 'pr' || github.event.pull_request.head.repo.fork == false
114+
with:
115+
sccache: s3
116+
- uses: actions/checkout@v6
117+
if: inputs.mode == 'pr'
118+
with:
119+
ref: ${{ github.event.pull_request.head.sha }}
120+
- uses: actions/checkout@v6
121+
if: inputs.mode != 'pr'
122+
- uses: ./.github/actions/setup-rust
123+
with:
124+
repo-token: ${{ secrets.GITHUB_TOKEN }}
125+
- name: Build binaries
126+
shell: bash
127+
env:
128+
RUSTFLAGS: "-C target-cpu=native -C force-frame-pointers=yes"
129+
run: |
130+
packages="--bin data-gen --bin datafusion-bench --bin duckdb-bench"
131+
if [ "${{ inputs.build_lance }}" = "true" ]; then
132+
packages="$packages --bin lance-bench"
133+
fi
134+
cargo build $packages --profile release_debug
135+
- name: Stage binaries for upload
136+
shell: bash
137+
run: |
138+
mkdir -p staging/bin staging/lib
139+
cp target/release_debug/data-gen staging/bin/
140+
cp target/release_debug/datafusion-bench staging/bin/
141+
cp target/release_debug/duckdb-bench staging/bin/
142+
if [ -f target/release_debug/lance-bench ]; then
143+
cp target/release_debug/lance-bench staging/bin/
144+
fi
145+
cp target/duckdb-lib-*/libduckdb.so staging/lib/ 2>/dev/null || true
146+
- uses: actions/upload-artifact@v7
147+
with:
148+
name: sql-bench-binaries
149+
path: staging/
150+
retention-days: 1
151+
101152
bench:
153+
needs: build
102154
timeout-minutes: 120
103155
strategy:
104156
fail-fast: false
@@ -112,8 +164,6 @@ jobs:
112164
steps:
113165
- uses: runs-on/action@v2
114166
if: inputs.mode != 'pr' || github.event.pull_request.head.repo.fork == false
115-
with:
116-
sccache: s3
117167
- uses: actions/checkout@v6
118168
if: inputs.mode == 'pr'
119169
with:
@@ -123,9 +173,6 @@ jobs:
123173
if: inputs.mode != 'pr'
124174
- name: Setup benchmark environment
125175
run: sudo bash scripts/setup-benchmark.sh
126-
- uses: ./.github/actions/setup-rust
127-
with:
128-
repo-token: ${{ secrets.GITHUB_TOKEN }}
129176

130177
- name: Install DuckDB
131178
run: |
@@ -135,16 +182,17 @@ jobs:
135182
136183
- uses: ./.github/actions/system-info
137184

138-
- name: Build binaries
185+
- uses: actions/download-artifact@v8
186+
with:
187+
name: sql-bench-binaries
188+
path: staging
189+
- name: Install binaries
139190
shell: bash
140-
env:
141-
RUSTFLAGS: "-C target-cpu=native -C force-frame-pointers=yes"
142191
run: |
143-
packages="--bin data-gen --bin datafusion-bench --bin duckdb-bench"
144-
if [ "${{ matrix.build_lance }}" = "true" ]; then
145-
packages="$packages --bin lance-bench"
146-
fi
147-
cargo build $packages --profile release_debug
192+
mkdir -p target/release_debug
193+
cp staging/bin/* target/release_debug/
194+
chmod +x target/release_debug/*
195+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/staging/lib" >> "$GITHUB_ENV"
148196
149197
- name: Generate data
150198
shell: bash

0 commit comments

Comments
 (0)