Skip to content

Commit a11459f

Browse files
authored
Add no teardown arg to spicebench and an option to debug_spice_cloud (#222)
workflow, to keep spidapter instance after the run
1 parent 609c31a commit a11459f

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/run_spicebench_debug_spice_cloud.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ on:
4343
required: false
4444
default: false
4545
type: boolean
46+
disable_teardown:
47+
description: 'Skip the teardown RPC call to the system adapter'
48+
required: false
49+
default: false
50+
type: boolean
4651
jobs:
4752
run-spicebench:
4853
name: Run spicebench
@@ -128,6 +133,7 @@ jobs:
128133
S3_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
129134
SPIDAPTER_ICEBERG_REGION: us-west-1
130135
SPIDAPTER_ICEBERG_CATALOG_FROM: iceberg:https://glue.us-west-1.amazonaws.com/iceberg/v1/catalogs/211125479522/namespaces
136+
DISABLE_TEARDOWN: ${{ github.event.inputs.disable_teardown || 'false' }}
131137
run: |
132138
set -euo pipefail
133139
if [ "${ENABLE_MODULE_DEBUG_LOGGING}" = "true" ]; then
@@ -173,6 +179,11 @@ jobs:
173179
ADAPTER_ARGS="run -i -e SPICEAI_API_KEY -e SPICE_CLOUD_API_URL -e AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID} -e AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY} -e SPIDAPTER_ICEBERG_REGION -e SPIDAPTER_ICEBERG_CATALOG_FROM -e SCHEDULER_STATE_LOCATION ghcr.io/spiceai/spidapter:${{ github.event.inputs.spidapter_version || 'latest' }} stdio --verbose --channel nightly"
174180
ADAPTER_ENVS=""
175181
182+
NO_TEARDOWN_ARG=""
183+
if [ "${DISABLE_TEARDOWN}" = "true" ]; then
184+
NO_TEARDOWN_ARG="--no-teardown"
185+
fi
186+
176187
~/.spice/bin/spicebench run \
177188
--concurrency "${NUM_QUERY_CLIENTS}" \
178189
--scenario "${SCENARIO}" \
@@ -185,3 +196,4 @@ jobs:
185196
--system-adapter-stdio-args "${ADAPTER_ARGS}" \
186197
${ADAPTER_ENVS} \
187198
${SCHEDULER_STATE_ADAPTER_ENV} \
199+
${NO_TEARDOWN_ARG} \

src/args/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ pub struct RunArgs {
181181
/// when individual query latency is high.
182182
#[arg(long, default_value_t = 5)]
183183
pub(crate) checkpoint_validation_period: u64,
184+
185+
/// Skip the teardown RPC call to the system adapter after the benchmark completes.
186+
///
187+
/// Useful when you want to inspect the system state after a run without
188+
/// triggering adapter-side cleanup (e.g. for debugging spice_cloud deployments).
189+
#[arg(long, default_value_t = false)]
190+
pub(crate) no_teardown: bool,
184191
}
185192

186193
fn parse_key_val(s: &str) -> Result<(String, String), String> {

src/commands/run.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,11 @@ pub async fn execute(args: &RunArgs) -> anyhow::Result<()> {
390390
)
391391
.await;
392392

393-
// After successful setup, always teardown even if there are errors in between.
394-
if let Err(e) = system_adapter_client.lock().await.teardown(run_id).await {
393+
// After successful setup, always teardown even if there are errors in between,
394+
// unless --no-teardown was requested (e.g. to inspect cloud state after a run).
395+
if args.no_teardown {
396+
tracing::info!("Skipping teardown (--no-teardown flag is set).");
397+
} else if let Err(e) = system_adapter_client.lock().await.teardown(run_id).await {
395398
tracing::error!("Failed to teardown system adapter: {e}");
396399
}
397400

0 commit comments

Comments
 (0)