Skip to content

Commit 62b489b

Browse files
committed
feat(gateway): report compute driver status
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 709aa0f commit 62b489b

14 files changed

Lines changed: 593 additions & 100 deletions

architecture/compute-runtimes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ The capability RPC reports driver identity, version, and the default sandbox
2626
image used by the gateway. GPU availability stays driver-local and is validated
2727
when a sandbox create request asks for GPU resources.
2828

29+
The gateway records driver identity and version from the startup capability
30+
response. Authenticated gateway status reports that initialized driver snapshot
31+
instead of re-querying drivers on each status request.
32+
2933
## Runtime Summary
3034

3135
| Runtime | Best fit | Sandbox boundary | Notes |

crates/openshell-cli/src/main.rs

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,13 @@ enum Commands {
531531
command: Option<GatewayCommands>,
532532
},
533533

534-
/// Show gateway status and information.
534+
/// Show live gateway status and runtime information.
535535
#[command(help_template = LEAF_HELP_TEMPLATE, next_help_heading = "FLAGS")]
536-
Status,
536+
Status {
537+
/// Output format.
538+
#[arg(short = 'o', long = "output", value_enum, default_value_t = OutputFormat::Table)]
539+
output: OutputFormat,
540+
},
537541

538542
/// Manage inference configuration.
539543
#[command(after_help = INFERENCE_EXAMPLES, help_template = SUBCOMMAND_HELP_TEMPLATE)]
@@ -2083,20 +2087,14 @@ async fn main() -> Result<()> {
20832087
// -----------------------------------------------------------
20842088
// Top-level status
20852089
// -----------------------------------------------------------
2086-
Some(Commands::Status) => {
2090+
Some(Commands::Status { output }) => {
20872091
if let Ok(ctx) = resolve_gateway(&cli.gateway, &cli.gateway_endpoint) {
20882092
let mut tls = tls.with_gateway_name(&ctx.name);
20892093
apply_auth(&mut tls, &ctx.name);
2090-
run::gateway_status(&ctx.name, &ctx.endpoint, &tls).await?;
2094+
run::gateway_status(&ctx.name, &ctx.endpoint, &tls, output.as_str(), cli.verbose)
2095+
.await?;
20912096
} else {
2092-
println!("{}", "Gateway Status".cyan().bold());
2093-
println!();
2094-
println!(" {} No gateway configured.", "Status:".dimmed());
2095-
println!();
2096-
println!(
2097-
"Register a gateway with: {}",
2098-
"openshell gateway add <endpoint>".dimmed()
2099-
);
2097+
run::gateway_status_not_configured(output.as_str())?;
21002098
}
21012099
}
21022100

@@ -3463,7 +3461,20 @@ mod tests {
34633461
.expect("global gateway flag should parse with subcommands");
34643462

34653463
assert_eq!(cli.gateway.as_deref(), Some("demo"));
3466-
assert!(matches!(cli.command, Some(Commands::Status)));
3464+
assert!(matches!(cli.command, Some(Commands::Status { .. })));
3465+
}
3466+
3467+
#[test]
3468+
fn status_accepts_output_json() {
3469+
let cli = Cli::try_parse_from(["openshell", "status", "-o", "json"])
3470+
.expect("status -o json should parse");
3471+
3472+
assert!(matches!(
3473+
cli.command,
3474+
Some(Commands::Status {
3475+
output: OutputFormat::Json
3476+
})
3477+
));
34673478
}
34683479

34693480
#[test]

0 commit comments

Comments
 (0)