You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/system-adapter-builder/SKILL.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: system-adapter-builder
3
-
description: Build or update a SpiceBench system adapter with JSON-RPC over stdio and HTTP, including setup/query_method/teardown/metrics support and template validation.
3
+
description: Build or update a SpiceBench system adapter with JSON-RPC over stdio and HTTP, including setup/create_tables/query_method/teardown/metrics support and template validation.
4
4
---
5
5
6
6
# SpiceBench System Adapter Builder
@@ -17,6 +17,7 @@ A JSON-RPC 2.0 adapter that supports both transports:
17
17
Required methods:
18
18
19
19
-`setup(run_id, datasets)`
20
+
-`create_tables(run_id)`
20
21
-`query_method(run_id)`
21
22
-`teardown(run_id)`
22
23
-`metrics(run_id)`
@@ -34,15 +35,17 @@ Required methods:
34
35
35
36
1. Copy the nearest template from `system-adapters/templates/<language>`.
|**1. Setup**| Connect to system adapter via JSON-RPC (stdio or HTTP). Call `setup(run_id, datasets)` to provision the SUT and return ADBC driver config. | No |
126
-
|**2. Benchmark (timed)**| Three sequential stages — warm-up (1× query set), baseline (10% of duration, 60s–600s), and load test (full duration with concurrent clients). | Yes |
127
-
|**3. Teardown**| Call `teardown(run_id)` via the adapter to deprovision resources and clean up. | No |
|**1. Setup**| Connect to system adapter via JSON-RPC (stdio or HTTP). Call `setup(run_id, datasets)` to provision the SUT, then `create_tables(run_id)`, then `query_method(run_id)` to get ADBC driver config. | No |
127
+
|**2. Benchmark (timed)**| Three sequential stages — warm-up (1× query set), baseline (10% of duration, 60s–600s), and load test (full duration with concurrent clients). | Yes |
128
+
|**3. Teardown**| Call `teardown(run_id)` via the adapter to deprovision resources and clean up. | No |
128
129
129
130
The **E2E benchmark duration** (phase 2, load test stage) is the primary ranking metric. After the load test, each query's p99 latency is compared against the baseline: >20% increase = FAIL, 10–20% = WARN, ≥3 WARNs = FAIL.
|**GitHub Actions**| Orchestrates Runs on schedule, PR, or manual dispatch. Manages the full Run lifecycle across phases. |
150
-
|**System Adapter Protocol**| JSON-RPC 2.0 interface (stdio or HTTP) for each platform. Methods: `setup`, `teardown`, `metrics`.|
151
+
|**System Adapter Protocol**| JSON-RPC 2.0 interface (stdio or HTTP) for each platform. Methods: `setup`, `create_tables`, `query_method`, `teardown`, `metrics`. |
151
152
|**Query Executors**| Pluggable query execution: ADBC direct (FlightSQL/Databricks drivers), HTTP (`/v1/sql`), or distributed (`/v1/queries` with polling). |
152
153
|**Data Generator**| Standalone binary (`data-generation`) that produces TPC-H partitioned Parquet batches and writes them to S3. |
153
154
|**Test Framework**| Core engine managing the warm-up → baseline → load test pipeline, query sets (TPC-H, TPC-DS, ClickBench, parameterized, scenario), and statistics collection. |
@@ -216,8 +217,10 @@ Results from every Run are published to [SpiceBench.com](https://spicebench.com)
216
217
To benchmark a new platform, implement the JSON-RPC 2.0 adapter with these methods:
217
218
218
219
1.**`setup(run_id, datasets)`** — Provision infrastructure and configure the target system.
219
-
2.**`teardown(run_id)`** — Clean up provisioned resources.
220
-
3.**`metrics(run_id)`***(optional)* — Return current resource usage (CPU, memory, disk, IOPS) and ingestion progress (rows, bytes, rows/s, active connections).
220
+
2.**`create_tables(run_id)`** — Create/register destination tables for the benchmark datasets.
221
+
3.**`query_method(run_id)`** — Return the ADBC driver type (`flightsql` or `databricks`) and connection kwargs so SpiceBench can establish a direct query connection.
222
+
4.**`teardown(run_id)`** — Clean up provisioned resources.
223
+
5.**`metrics(run_id)`***(optional)* — Return current resource usage (CPU, memory, disk, IOPS) and ingestion progress (rows, bytes, rows/s, active connections).
221
224
222
225
The adapter can run as a **stdio** child process or as an **HTTP** server.
223
226
@@ -236,7 +239,30 @@ The `spicebench` CLI connects to a system adapter using JSON-RPC 2.0 over either
236
239
-**stdio transport**: use `--system-adapter-stdio-cmd` (SpiceBench starts the child process).
237
240
-**HTTP transport**: use `--system-adapter-http-url` (SpiceBench connects to a remote adapter endpoint).
238
241
-**execution mode**: `adapter-command` (default) dispatches `spicebench run ...` to adapter JSON-RPC `run.load`.
239
-
-**execution mode**: `direct-query` runs the load/query path directly via ADBC, using the adapter only for setup/teardown/metrics.
242
+
-**execution mode**: `direct-query` runs the load/query path directly via ADBC, using the adapter for setup/table creation/teardown/metrics.
243
+
244
+
#### Adapter lifecycle (direct-query mode)
245
+
246
+
For each run, SpiceBench calls adapter JSON-RPC methods in this order:
247
+
248
+
1.`setup(run_id, datasets, metadata)`
249
+
2.`create_tables(run_id)`
250
+
3.`query_method(run_id)`
251
+
4. benchmark execution and optional periodic `metrics(run_id)` scraping
252
+
5.`teardown(run_id)`
253
+
254
+
Tiny `create_tables` request example:
255
+
256
+
```json
257
+
{
258
+
"jsonrpc": "2.0",
259
+
"id": 2,
260
+
"method": "create_tables",
261
+
"params": {
262
+
"run_id": "00000000-0000-0000-0000-000000000000"
263
+
}
264
+
}
265
+
```
240
266
241
267
#### Stdio example (child process started by SpiceBench)
242
268
@@ -268,7 +294,7 @@ Notes:
268
294
-`--system-adapter-stdio-args` passes CLI args to the stdio adapter command.
269
295
-`--system-adapter-env` is only valid for stdio transport.
270
296
271
-
#### Direct-query example (ADBC query path, adapter for setup/teardown only)
297
+
#### Direct-query example (ADBC query path, adapter for setup/table creation/teardown)
0 commit comments