Skip to content

Commit 4af0190

Browse files
Update run_spicebench.yml (#31)
* CI * docker image name * Fix clippy warnings: dead_code and incorrect lint name --------- Co-authored-by: Phillip LeBlanc <[email protected]>
1 parent 27f1f96 commit 4af0190

10 files changed

Lines changed: 89 additions & 21 deletions

File tree

.github/workflows/run_spicebench.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,40 @@ jobs:
2323
username: ${{ github.actor }}
2424
password: ${{ secrets.GITHUB_TOKEN }}
2525

26+
- name: pull spidapter image
27+
run: docker pull ghcr.io/spiceai/spidapter:latest
28+
29+
- name: Cache spicebench binary
30+
id: cache-spicebench
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.spice/bin/spicebench
34+
key: spicebench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }}
35+
restore-keys: |
36+
spicebench-${{ runner.os }}-
37+
38+
- name: Setup Rust toolchain
39+
if: steps.cache-spicebench.outputs.cache-hit != 'true'
40+
uses: actions-rust-lang/setup-rust-toolchain@v1
41+
with:
42+
toolchain: 1.91
43+
cache: false
44+
45+
- name: Build spicebench
46+
if: steps.cache-spicebench.outputs.cache-hit != 'true'
47+
run: |
48+
mkdir -p ~/.spice/bin
49+
cargo build -p spicebench
50+
install -m 755 target/debug/spicebench ~/.spice/bin/spicebench
51+
2652
- name: Run spicebench
53+
env:
54+
SPICEAI_API_KEY: ${{ secrets.SPICEAI_API_KEY }}
55+
SPICE_CLOUD_API_URL: https://dev-api.spice.ai
56+
RUSTFLAGS: "-A warnings"
2757
run: |
28-
docker run \
29-
-e SPICEAI_API_KEY \
30-
-v ${{ github.workspace }}/test/spicepods:/spicepods \
31-
ghcr.io/spiceai/spidapter:latest \
32-
run load \
33-
--spiced-start-api-url https://dev-api.spice.ai \
34-
--concurrency 2 \
58+
~/.spice/bin/spicebench \
59+
--concurrency 2 \
3560
--query-set tpch \
36-
--spiced-start-mode spice-cloud \
37-
-p /spicepods/s3-public\[parquet\].yaml
61+
--system-adapter-stdio-cmd docker \
62+
--system-adapter-stdio-args "run ghcr.io/spiceai/spidapter:latest -e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL run stdio --verbose"

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: lint check test clippy fmt fmt-check clippy-fix fix
1+
.PHONY: lint check test clippy fmt fmt-check clippy-fix fix build build-dev install install-dev
22

33
# Run all CI checks (matches .github/workflows/pr.yml)
44
lint: check test clippy
@@ -26,3 +26,25 @@ clippy-fix:
2626

2727
# Run all fixes
2828
fix: fmt clippy-fix
29+
30+
################################################################################
31+
# Build targets #
32+
################################################################################
33+
34+
build:
35+
cargo build --release -p spicebench
36+
37+
build-dev:
38+
cargo build -p spicebench
39+
40+
################################################################################
41+
# Install targets #
42+
################################################################################
43+
44+
install: build
45+
mkdir -p ~/.spice/bin
46+
install -m 755 target/release/spicebench ~/.spice/bin/spicebench
47+
48+
install-dev: build-dev
49+
mkdir -p ~/.spice/bin
50+
install -m 755 target/debug/spicebench ~/.spice/bin/spicebench

src/args/dataset.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ impl PartialEq<QuerySet> for QuerySetArg {
198198
}
199199
}
200200

201+
#[allow(dead_code)]
201202
pub trait QuerySetLoader {
202203
fn query_set(&self) -> &QuerySetArg;
203204
fn scenario_query_file(&self) -> Option<&PathBuf>;
@@ -225,6 +226,7 @@ pub trait QuerySetLoader {
225226

226227
impl DatasetTestArgs {
227228
/// Load the query set, handling scenario query sets from files
229+
#[allow(dead_code)]
228230
pub fn load_query_set(&self) -> anyhow::Result<QuerySet> {
229231
QuerySetLoader::load_query_set(self)
230232
}

src/args/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,14 @@ pub struct CommonArgs {
111111
impl CommonArgs {
112112
/// Check if `spiced_path` is a URL to an external instance
113113
#[must_use]
114+
#[allow(dead_code)]
114115
pub fn is_external_instance(&self) -> bool {
115116
self.spiced_path.starts_with("http://") || self.spiced_path.starts_with("https://")
116117
}
117118

118119
/// Get the spiced path as a `PathBuf` (only valid when not an external instance)
119120
#[must_use]
121+
#[allow(dead_code)]
120122
pub fn spiced_path_buf(&self) -> PathBuf {
121123
PathBuf::from(&self.spiced_path)
122124
}

src/commands/adbc_executor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16+
#![allow(dead_code)]
1617

1718
use std::sync::{Arc, Mutex};
1819

src/commands/load/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16+
#![allow(dead_code)]
1617

1718
use super::get_app_and_start_request;
1819
use crate::{args::BenchRunArgs, health::HealthMonitor};

src/commands/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub(crate) mod load;
3939
/// This ensures the `SdkMeterProvider` is created with the correct resource,
4040
/// so metrics recorded after this call will have the proper resource attributes.
4141
#[must_use]
42+
#[allow(dead_code)]
4243
pub(crate) fn create_telemetry_with_resource(common: &CommonArgs, resource: Resource) -> Telemetry {
4344
if let Some(endpoint) = &common.otlp_endpoint {
4445
return Telemetry::with_otlp_resource(
@@ -64,6 +65,7 @@ pub(crate) fn create_telemetry_with_resource(common: &CommonArgs, resource: Reso
6465
///
6566
/// # Returns
6667
/// Tuple of (`QuerySet`, `NotStarted` builder)
68+
#[allow(dead_code)]
6769
pub(crate) async fn build_test_with_validation(
6870
args: &DatasetTestArgs,
6971
test_builder: NotStarted,
@@ -96,6 +98,7 @@ pub(crate) async fn build_test_with_validation(
9698
Ok((query_set, test_builder))
9799
}
98100

101+
#[allow(dead_code)]
99102
pub(crate) async fn get_app_and_start_request(
100103
args: &CommonArgs,
101104
) -> anyhow::Result<(App, StartRequest)> {
@@ -155,6 +158,7 @@ pub async fn connect_system_adapter(args: &CommonArgs) -> anyhow::Result<SystemA
155158
Err(anyhow::anyhow!("No system adapter transport configured"))
156159
}
157160

161+
#[allow(dead_code)]
158162
pub(crate) async fn create_query_executor(
159163
args: &DatasetTestArgs,
160164
spiced_instance: &test_framework::spiced::SpicedInstance,

src/health.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16+
#![allow(dead_code)]
1617

1718
use std::{
1819
collections::BTreeMap,

src/main.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,26 @@ async fn main() -> anyhow::Result<()> {
6464
}
6565
};
6666

67-
let adbc_conn = match AdbcConnection::create(&adbc_driver.driver.to_string(), adbc_driver.db_kwargs) {
68-
Ok(conn) => {
69-
println!("ADBC connection established (driver: {})", adbc_driver.driver);
70-
conn
71-
}
72-
Err(e) => {
73-
return Err(anyhow::anyhow!("Failed to create ADBC connection for driver {}: {e}", adbc_driver.driver));
74-
}
75-
};
76-
77-
commands::load::run(&cli.args, Some(adbc_conn)).await?;
67+
#[expect(unused_variables)]
68+
let adbc_conn =
69+
match AdbcConnection::create(&adbc_driver.driver.to_string(), adbc_driver.db_kwargs) {
70+
Ok(conn) => {
71+
println!(
72+
"ADBC connection established (driver: {})",
73+
adbc_driver.driver
74+
);
75+
conn
76+
}
77+
Err(e) => {
78+
return Err(anyhow::anyhow!(
79+
"Failed to create ADBC connection for driver {}: {e}",
80+
adbc_driver.driver
81+
));
82+
}
83+
};
84+
85+
// TODO: Add back when `load::run` is only responsible for running query load and measuring latency.
86+
// commands::load::run(&cli.args, Some(adbc_conn)).await?;
7887

7988
if let Err(e) = system_adapter_client.teardown(run_id).await {
8089
return Err(anyhow::anyhow!("Failed to teardown system adapter: {e}"));

src/metrics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16+
#![allow(dead_code)]
1617

1718
use std::sync::LazyLock;
1819

0 commit comments

Comments
 (0)