From 5928d41dbe4443993dcd315d49b3a0a3a52bb833 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 18 Feb 2026 07:11:21 -0600 Subject: [PATCH 1/6] CI --- .github/workflows/run_spicebench.yml | 42 ++++++++++++++++++++++------ Makefile | 24 +++++++++++++++- src/main.rs | 31 ++++++++++++-------- 3 files changed, 76 insertions(+), 21 deletions(-) diff --git a/.github/workflows/run_spicebench.yml b/.github/workflows/run_spicebench.yml index 639eab91..e9df6da2 100644 --- a/.github/workflows/run_spicebench.yml +++ b/.github/workflows/run_spicebench.yml @@ -23,15 +23,39 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: pull spidapter image + run: docker pull ghcr.io/spiceai/spidapter:latest + + - name: Cache spicebench binary + id: cache-spicebench + uses: actions/cache@v4 + with: + path: ~/.spice/bin/spicebench + key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }} + restore-keys: | + spicebench-${{ runner.os }}- + + - name: Setup Rust toolchain + if: steps.cache-spicebench.outputs.cache-hit != 'true' + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.91 + cache: false + + - name: Build spicebench + if: steps.cache-spicebench.outputs.cache-hit != 'true' + run: | + mkdir -p ~/.spice/bin + cargo build -p spicebench + install -m 755 target/debug/spicebench ~/.spice/bin/spicebench + - name: Run spicebench + env: + SPICEAI_API_KEY: ${{ secrets.SPICEAI_API_KEY }} + SPICE_CLOUD_API_URL: https://dev-api.spice.ai run: | - docker run \ - -e SPICEAI_API_KEY \ - -v ${{ github.workspace }}/test/spicepods:/spicepods \ - ghcr.io/spiceai/spidapter:latest \ - run load \ - --spiced-start-api-url https://dev-api.spice.ai \ - --concurrency 2 \ + ~/.spice/bin/spicebench \ + --concurrency 2 \ --query-set tpch \ - --spiced-start-mode spice-cloud \ - -p /spicepods/s3-public\[parquet\].yaml + --system-adapter-stdio-cmd docker \ + --system-adapter-stdio-args "-e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL run stdio --verbose" diff --git a/Makefile b/Makefile index 08d4887c..e1235a08 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: lint check test clippy fmt fmt-check clippy-fix fix +.PHONY: lint check test clippy fmt fmt-check clippy-fix fix build build-dev install install-dev # Run all CI checks (matches .github/workflows/pr.yml) lint: check test clippy @@ -26,3 +26,25 @@ clippy-fix: # Run all fixes fix: fmt clippy-fix + +################################################################################ +# Build targets # +################################################################################ + +build: + cargo build --release -p spicebench + +build-dev: + cargo build -p spicebench + +################################################################################ +# Install targets # +################################################################################ + +install: build + mkdir -p ~/.spice/bin + install -m 755 target/release/spicebench ~/.spice/bin/spicebench + +install-dev: build-dev + mkdir -p ~/.spice/bin + install -m 755 target/debug/spicebench ~/.spice/bin/spicebench diff --git a/src/main.rs b/src/main.rs index c9591dcc..911dd09d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,17 +64,26 @@ async fn main() -> anyhow::Result<()> { } }; - let adbc_conn = match AdbcConnection::create(&adbc_driver.driver.to_string(), adbc_driver.db_kwargs) { - Ok(conn) => { - println!("ADBC connection established (driver: {})", adbc_driver.driver); - conn - } - Err(e) => { - return Err(anyhow::anyhow!("Failed to create ADBC connection for driver {}: {e}", adbc_driver.driver)); - } - }; - - commands::load::run(&cli.args, Some(adbc_conn)).await?; + #[expect(clippy::unused_variables)] + let adbc_conn = + match AdbcConnection::create(&adbc_driver.driver.to_string(), adbc_driver.db_kwargs) { + Ok(conn) => { + println!( + "ADBC connection established (driver: {})", + adbc_driver.driver + ); + conn + } + Err(e) => { + return Err(anyhow::anyhow!( + "Failed to create ADBC connection for driver {}: {e}", + adbc_driver.driver + )); + } + }; + + // TODO: Add back when `load::run` is only responsible for running query load and measuring latency. + // commands::load::run(&cli.args, Some(adbc_conn)).await?; if let Err(e) = system_adapter_client.teardown(run_id).await { return Err(anyhow::anyhow!("Failed to teardown system adapter: {e}")); From 645b9f44cb63360abadc2972d1672d642c016787 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 18 Feb 2026 08:40:33 -0600 Subject: [PATCH 2/6] docker image name --- .github/workflows/run_spicebench.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_spicebench.yml b/.github/workflows/run_spicebench.yml index e9df6da2..be0bb723 100644 --- a/.github/workflows/run_spicebench.yml +++ b/.github/workflows/run_spicebench.yml @@ -53,9 +53,10 @@ jobs: env: SPICEAI_API_KEY: ${{ secrets.SPICEAI_API_KEY }} SPICE_CLOUD_API_URL: https://dev-api.spice.ai + RUSTFLAGS: "-A warnings" run: | ~/.spice/bin/spicebench \ --concurrency 2 \ --query-set tpch \ --system-adapter-stdio-cmd docker \ - --system-adapter-stdio-args "-e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL run stdio --verbose" + --system-adapter-stdio-args "run ghcr.io/spiceai/spidapter:latest -e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL run stdio --verbose" From 33472f218b44d904eb860b79edddf135677d66aa Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 18 Feb 2026 09:02:40 -0600 Subject: [PATCH 3/6] fix Ci stdin/stdout --- .github/workflows/run_spicebench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_spicebench.yml b/.github/workflows/run_spicebench.yml index be0bb723..28245e85 100644 --- a/.github/workflows/run_spicebench.yml +++ b/.github/workflows/run_spicebench.yml @@ -59,4 +59,4 @@ jobs: --concurrency 2 \ --query-set tpch \ --system-adapter-stdio-cmd docker \ - --system-adapter-stdio-args "run ghcr.io/spiceai/spidapter:latest -e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL run stdio --verbose" + --system-adapter-stdio-args "run -i -e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL ghcr.io/spiceai/spidapter:latest stdio --verbose" From 5ee8fbd52c1b210ca49e555da5459e4bfc7688e0 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 18 Feb 2026 09:20:09 -0600 Subject: [PATCH 4/6] env not secret --- .github/workflows/run_spicebench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_spicebench.yml b/.github/workflows/run_spicebench.yml index 28245e85..4f9d58bc 100644 --- a/.github/workflows/run_spicebench.yml +++ b/.github/workflows/run_spicebench.yml @@ -51,7 +51,7 @@ jobs: - name: Run spicebench env: - SPICEAI_API_KEY: ${{ secrets.SPICEAI_API_KEY }} + SPICEAI_API_KEY: ${{ env.SPICEAI_API_KEY }} SPICE_CLOUD_API_URL: https://dev-api.spice.ai RUSTFLAGS: "-A warnings" run: | From dd7345785ad7797fa55fb84cf0ea9d401f612f13 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 18 Feb 2026 09:27:30 -0600 Subject: [PATCH 5/6] ignore adbc error --- .github/workflows/run_spicebench.yml | 12 ++++++++++-- src/main.rs | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_spicebench.yml b/.github/workflows/run_spicebench.yml index 4f9d58bc..9436ac6e 100644 --- a/.github/workflows/run_spicebench.yml +++ b/.github/workflows/run_spicebench.yml @@ -26,9 +26,9 @@ jobs: - name: pull spidapter image run: docker pull ghcr.io/spiceai/spidapter:latest - - name: Cache spicebench binary + - name: Restore spicebench cache id: cache-spicebench - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: ~/.spice/bin/spicebench key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }} @@ -43,12 +43,20 @@ jobs: cache: false - name: Build spicebench + id: build-spicebench if: steps.cache-spicebench.outputs.cache-hit != 'true' run: | mkdir -p ~/.spice/bin cargo build -p spicebench install -m 755 target/debug/spicebench ~/.spice/bin/spicebench + - name: Save spicebench cache + if: steps.build-spicebench.outcome == 'success' + uses: actions/cache/save@v4 + with: + path: ~/.spice/bin/spicebench + key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }} + - name: Run spicebench env: SPICEAI_API_KEY: ${{ env.SPICEAI_API_KEY }} diff --git a/src/main.rs b/src/main.rs index 02dea046..412af7cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,10 +75,10 @@ async fn main() -> anyhow::Result<()> { conn } Err(e) => { - return Err(anyhow::anyhow!( + eprintln!( "Failed to create ADBC connection for driver {}: {e}", adbc_driver.driver - )); + ); } }; From d3c1c3cf7f67451046b3d26b77156e6fcb5cab76 Mon Sep 17 00:00:00 2001 From: jeadie Date: Wed, 18 Feb 2026 09:31:29 -0600 Subject: [PATCH 6/6] fix clippy --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 412af7cc..e2fad068 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,20 +65,21 @@ async fn main() -> anyhow::Result<()> { }; #[expect(unused_variables)] - let adbc_conn = + let adbc_conn: Option = match AdbcConnection::create(&adbc_driver.driver.to_string(), adbc_driver.db_kwargs) { Ok(conn) => { println!( "ADBC connection established (driver: {})", adbc_driver.driver ); - conn + Some(conn) } Err(e) => { eprintln!( "Failed to create ADBC connection for driver {}: {e}", adbc_driver.driver ); + None } };