Skip to content

Commit 3bdc5f2

Browse files
authored
Add --version flag to runner (#814)
This changeset adds the `--version` flag to the `runner` binary. Further, the version is also printed out at startup. The `runner` and `api` are released in lockstep versions, so the version definition is now shared as well.
1 parent b1e72f9 commit 3bdc5f2

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

plus/bencher_runner/src/up/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ impl Up {
8484
pub fn run(mut self) -> Result<(), UpError> {
8585
install_signal_handlers();
8686

87-
println!("Bencher Runner starting...");
87+
println!(
88+
"Bencher Runner v{} starting...",
89+
bencher_json::BENCHER_API_VERSION
90+
);
8891
println!(" Host: {}", self.config.host);
8992
println!(" Runner: {}", self.config.runner);
9093
println!(" Poll timeout: {}s", self.config.poll_timeout_secs);
@@ -142,7 +145,7 @@ fn run_driver(config: &UpConfig, channel_url: &Url, key: &str) -> Result<(), UpE
142145
.map(|(os, arch)| bencher_json::runner::JsonRunnerMetadata {
143146
os,
144147
arch,
145-
version: env!("CARGO_PKG_VERSION").to_owned(),
148+
version: bencher_json::BENCHER_API_VERSION.to_owned(),
146149
})
147150
};
148151
let mut sm = ChannelStateMachine::new(config.poll_timeout_secs, runner_metadata);

plus/bencher_runner/src/up/state_machine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ mod tests {
647647
Some(JsonRunnerMetadata {
648648
os: OperatingSystem::Linux,
649649
arch: Architecture::X86_64,
650-
version: env!("CARGO_PKG_VERSION").to_owned(),
650+
version: bencher_json::BENCHER_API_VERSION.to_owned(),
651651
}),
652652
)
653653
}
@@ -1244,7 +1244,7 @@ mod tests {
12441244
Some(JsonRunnerMetadata {
12451245
os: OperatingSystem::Linux,
12461246
arch: Architecture::X86_64,
1247-
version: env!("CARGO_PKG_VERSION").to_owned(),
1247+
version: bencher_json::BENCHER_API_VERSION.to_owned(),
12481248
}),
12491249
);
12501250
let effects = sm.step(Input::Connected);

services/runner/src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use tuning::CliTuning;
1717
pub use up::CliUp;
1818

1919
#[derive(Parser, Debug)]
20-
#[command(name = "runner")]
20+
#[command(name = "runner", version)]
2121
#[command(about = "Execute benchmarks in isolated Firecracker microVMs", long_about = None)]
2222
pub struct CliRunner {
2323
#[command(subcommand)]

0 commit comments

Comments
 (0)