Skip to content

Commit 102c44d

Browse files
authored
Merge branch 'trunk' into lukim/databricks
2 parents 3baab9e + f06dc9f commit 102c44d

3 files changed

Lines changed: 79 additions & 47 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Build spicebench"
2+
description: "Builds spicebench and caches the binary. Restores from cache if available."
3+
4+
inputs:
5+
lookup-only:
6+
description: "Only check if the cache exists, don't restore the binary"
7+
required: false
8+
default: "false"
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Restore spicebench cache
14+
id: cache-spicebench
15+
uses: actions/cache/restore@v4
16+
with:
17+
path: ~/.spice/bin/spicebench
18+
key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }}
19+
restore-keys: |
20+
spicebench-${{ runner.os }}-
21+
lookup-only: ${{ inputs.lookup-only }}
22+
23+
- name: Setup Rust toolchain
24+
if: steps.cache-spicebench.outputs.cache-hit != 'true'
25+
uses: actions-rust-lang/setup-rust-toolchain@v1
26+
with:
27+
toolchain: 1.91
28+
cache: true
29+
30+
- name: Build spicebench
31+
id: build-spicebench
32+
if: steps.cache-spicebench.outputs.cache-hit != 'true'
33+
shell: bash
34+
run: |
35+
mkdir -p ~/.spice/bin
36+
cargo build -p spicebench
37+
install -m 755 target/debug/spicebench ~/.spice/bin/spicebench
38+
39+
- name: Save spicebench cache
40+
if: steps.build-spicebench.outcome == 'success'
41+
uses: actions/cache/save@v4
42+
with:
43+
path: ~/.spice/bin/spicebench
44+
key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Cache spicebench
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
8+
jobs:
9+
build-and-cache:
10+
name: Build and cache spicebench
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- uses: ./.github/actions/build-spicebench
17+
with:
18+
lookup-only: "true"

.github/workflows/run_spicebench.yml

Lines changed: 17 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
workflow_dispatch:
66
inputs:
77
scenario:
8-
description: 'Scenario/query set to run (e.g. tpch)'
8+
description: "Scenario/query set to run (e.g. tpch)"
99
required: true
10-
default: 'tpch'
10+
default: "tpch"
1111
type: string
1212
system_adapter:
1313
description: 'System adapter to run (docker spidapter or local databricks adapter)'
@@ -18,41 +18,41 @@ on:
1818
- spidapter
1919
- databricks
2020
run_data_generation:
21-
description: 'Run data-generation before spicebench'
21+
description: "Run data-generation before spicebench"
2222
required: false
2323
default: false
2424
type: boolean
2525
data_generation_runner_type:
26-
description: 'Runner label for data-generation job'
26+
description: "Runner label for data-generation job"
2727
required: false
28-
default: 'ubuntu-latest'
28+
default: "ubuntu-latest"
2929
type: string
3030
data_generation_scale_factor:
31-
description: 'Data-generation scale factor'
31+
description: "Data-generation scale factor"
3232
required: false
33-
default: '1.0'
33+
default: "1.0"
3434
type: string
3535
data_generation_bucket:
36-
description: 'S3 bucket for generated data (required if run_data_generation=true)'
36+
description: "S3 bucket for generated data (required if run_data_generation=true)"
3737
required: false
3838
type: string
3939
data_generation_prefix:
40-
description: 'Base S3 prefix for generated data (scenario appended automatically)'
40+
description: "Base S3 prefix for generated data (scenario appended automatically)"
4141
required: false
42-
default: 'data-gen'
42+
default: "data-gen"
4343
type: string
4444
data_generation_max_concurrency:
45-
description: 'Data-generation max concurrent S3 writes'
45+
description: "Data-generation max concurrent S3 writes"
4646
required: false
47-
default: '8'
47+
default: "8"
4848
type: string
4949
data_generation_region:
50-
description: 'AWS region for data-generation'
50+
description: "AWS region for data-generation"
5151
required: false
52-
default: 'us-east-1'
52+
default: "us-east-1"
5353
type: string
5454
data_generation_skip_initial:
55-
description: 'Skip data-generation initial ingest'
55+
description: "Skip data-generation initial ingest"
5656
required: false
5757
default: false
5858
type: boolean
@@ -100,36 +100,7 @@ jobs:
100100
if: ${{ github.event.inputs.system_adapter == 'spidapter' }}
101101
run: docker pull ghcr.io/spiceai/spidapter:latest
102102

103-
- name: Restore spicebench cache
104-
id: cache-spicebench
105-
uses: actions/cache/restore@v4
106-
with:
107-
path: ~/.spice/bin/spicebench
108-
key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }}
109-
restore-keys: |
110-
spicebench-${{ runner.os }}-
111-
112-
- name: Setup Rust toolchain
113-
if: steps.cache-spicebench.outputs.cache-hit != 'true'
114-
uses: actions-rust-lang/setup-rust-toolchain@v1
115-
with:
116-
toolchain: 1.91
117-
cache: true
118-
119-
- name: Build spicebench
120-
id: build-spicebench
121-
if: steps.cache-spicebench.outputs.cache-hit != 'true'
122-
run: |
123-
mkdir -p ~/.spice/bin
124-
cargo build -p spicebench
125-
install -m 755 target/debug/spicebench ~/.spice/bin/spicebench
126-
127-
- name: Save spicebench cache
128-
if: steps.build-spicebench.outcome == 'success'
129-
uses: actions/cache/save@v4
130-
with:
131-
path: ~/.spice/bin/spicebench
132-
key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }}
103+
- uses: ./.github/actions/build-spicebench
133104

134105
- name: Restore databricks adapter cache
135106
if: ${{ github.event.inputs.system_adapter == 'databricks' }}
@@ -241,7 +212,6 @@ jobs:
241212
DATABRICKS_CATALOG: ${{ secrets.DATABRICKS_CATALOG }}
242213
DATABRICKS_SCHEMA: ${{ secrets.DATABRICKS_SCHEMA }}
243214
SPICEAI_BENCHMARK_METRICS_KEY: ${{ secrets.SPICEAI_BENCHMARK_METRICS_KEY }}
244-
RUSTFLAGS: '-A warnings'
245215
SCENARIO: ${{ github.event.inputs.scenario || 'tpch' }}
246216
SYSTEM_ADAPTER: ${{ github.event.inputs.system_adapter || 'spidapter' }}
247217
run: |
@@ -265,7 +235,7 @@ jobs:
265235
266236
~/.spice/bin/spicebench \
267237
--concurrency 2 \
268-
--query-set "${SCENARIO}" \
238+
--scenario "${SCENARIO}" \
269239
--system-adapter-stdio-cmd "${ADAPTER_CMD}" \
270240
--system-adapter-stdio-args "${ADAPTER_ARGS}" \
271241
${ADAPTER_ENVS}

0 commit comments

Comments
 (0)