Skip to content

Commit a3ab795

Browse files
Do not build binaries within cargo ci keynote-bench
1 parent 620fabe commit a3ab795

4 files changed

Lines changed: 12 additions & 42 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ jobs:
302302
save-if: false
303303
prefix-key: v1
304304

305+
- name: Build keynote benchmark binaries
306+
run: cargo build --release -p spacetimedb-cli -p spacetimedb-standalone
307+
305308
# Node 24 is the current Active LTS line.
306309
- name: Set up Node.js
307310
uses: actions/setup-node@v4
@@ -312,6 +315,10 @@ jobs:
312315
with:
313316
run_install: true
314317

318+
- name: Build TypeScript SDK
319+
run: pnpm build
320+
working-directory: crates/bindings-typescript
321+
315322
- name: Run keynote-2 benchmark regression check
316323
run: cargo ci keynote-bench
317324

tools/ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Usage: help [COMMAND]...
147147

148148
Runs the keynote benchmark as a CI performance regression gate.
149149

150-
Builds release SpacetimeDB binaries, runs the keynote SpacetimeDB benchmark for 60 seconds against the TypeScript and Rust modules, and fails if throughput is below 275K TPS for TypeScript or 300K TPS for Rust.
150+
Assumes release SpacetimeDB binaries and the TypeScript SDK are already built, runs the keynote SpacetimeDB benchmark for 60 seconds against the TypeScript and Rust modules, and fails if throughput is below 275K TPS for TypeScript or 300K TPS for Rust.
151151

152152
**Usage:**
153153
```bash

tools/ci/src/keynote_bench.rs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anyhow::{bail, ensure, Context, Result};
44
use serde_json::Value;
55
use spacetimedb_guard::{ensure_binaries_built, SpacetimeDbGuard};
66
use std::{
7-
env, fs,
7+
fs,
88
path::{Path, PathBuf},
99
process::Command,
1010
};
@@ -38,9 +38,6 @@ const BENCHMARK_MODULES: &[BenchmarkModule] = &[
3838
];
3939

4040
pub fn run() -> Result<()> {
41-
build_typescript_sdk()?;
42-
build_release_binaries()?;
43-
4441
let cli_path = ensure_binaries_built();
4542
let server = SpacetimeDbGuard::spawn_in_temp_data_dir();
4643
let cli_config_dir = tempfile::tempdir().context("failed to create temporary CLI config directory")?;
@@ -90,40 +87,6 @@ fn run_module_benchmark(module: &BenchmarkModule, cli_path: &Path, config_path:
9087
Ok(())
9188
}
9289

93-
fn build_typescript_sdk() -> Result<()> {
94-
let mut cmd = Command::new("pnpm");
95-
cmd.arg("build").current_dir("crates/bindings-typescript");
96-
run_command(&mut cmd, "pnpm build in crates/bindings-typescript")
97-
}
98-
99-
fn build_release_binaries() -> Result<()> {
100-
eprintln!("Building spacetimedb-cli and spacetimedb-standalone (release)...");
101-
let mut cmd = Command::new("cargo");
102-
cmd.args([
103-
"build",
104-
"--release",
105-
"-p",
106-
"spacetimedb-cli",
107-
"-p",
108-
"spacetimedb-standalone",
109-
"--features",
110-
"spacetimedb-standalone/allow_loopback_http_for_tests",
111-
]);
112-
remove_cargo_env_vars(&mut cmd);
113-
run_command(&mut cmd, "cargo build --release spacetimedb-cli spacetimedb-standalone")
114-
}
115-
116-
fn remove_cargo_env_vars(cmd: &mut Command) {
117-
for (key, _) in env::vars() {
118-
let should_remove = (key.starts_with("CARGO") && key != "CARGO_HOME" && key != "CARGO_TARGET_DIR")
119-
|| key.starts_with("RUST")
120-
|| key == "__CARGO_FIX_YOLO";
121-
if should_remove {
122-
cmd.env_remove(key);
123-
}
124-
}
125-
}
126-
12790
fn publish_module(module: &BenchmarkModule, cli_path: &Path, config_path: &Path, server_url: &str) -> Result<()> {
12891
let label = format!("spacetime publish keynote {} module", module.label);
12992
run_cli(

tools/ci/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ enum CiCmd {
318318
Smoketests(smoketest::SmoketestsArgs),
319319
/// Runs the keynote benchmark as a CI performance regression gate.
320320
///
321-
/// Builds release SpacetimeDB binaries, runs the keynote SpacetimeDB benchmark for 60 seconds
322-
/// against the TypeScript and Rust modules, and fails if throughput is below 275K TPS for
323-
/// TypeScript or 300K TPS for Rust.
321+
/// Assumes release SpacetimeDB binaries and the TypeScript SDK are already built, runs the
322+
/// keynote SpacetimeDB benchmark for 60 seconds against the TypeScript and Rust modules, and
323+
/// fails if throughput is below 275K TPS for TypeScript or 300K TPS for Rust.
324324
KeynoteBench,
325325
/// Tests the update flow
326326
///

0 commit comments

Comments
 (0)