Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions flare-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2417,6 +2417,43 @@ mod tests {
.is_err()
);
}

#[test]
fn debian_man_page_documents_every_visible_subcommand() {
use clap::CommandFactory;
use std::path::Path;

let man_page_path = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../packaging/debian/flare.1");
let man_page = std::fs::read_to_string(&man_page_path)
.unwrap_or_else(|e| panic!("failed to read {}: {e}", man_page_path.display()));

let mut in_commands = false;
let mut documented = Vec::new();
for line in man_page.lines() {
if line == ".SH COMMANDS" {
in_commands = true;
continue;
}
if in_commands && line.starts_with(".SH ") {
break;
}
if in_commands && let Some(command) = line.strip_prefix(".B ") {
documented.push(command.trim().to_string());
}
}

let visible: Vec<String> = Cli::command()
.get_subcommands()
.filter(|sub| !sub.is_hide_set() && sub.get_name() != "help")
.map(|sub| sub.get_name().to_string())
.collect();

assert_eq!(
documented, visible,
"packaging/debian/flare.1 .SH COMMANDS must match visible flare subcommands"
);
}
}

#[cfg(all(test, unix))]
Expand Down
5 changes: 4 additions & 1 deletion flare-cli/src/orbit/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2607,7 +2607,7 @@ fn systemd_unit(listen: &str, core_cache: Option<&Path>) -> String {
.map(|path| format!(" --core-cache {}", systemd_quote(&path.to_string_lossy())))
.unwrap_or_default();
format!(
"[Unit]\nDescription=Flare agent: runs this host's rank of a orbit's serving group\nAfter=network-online.target\n\n[Service]\nExecStart=%h/.local/lib/flare-agent/flare agent --listen {listen}{cache_flag}\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n"
"[Unit]\nDescription=Flare agent: runs this host's rank of an orbit's serving group\nAfter=network-online.target\n\n[Service]\nExecStart=%h/.local/lib/flare-agent/flare agent --listen {listen}{cache_flag}\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n"
)
}

Expand Down Expand Up @@ -4885,6 +4885,9 @@ pub mod tests {
#[test]
fn systemd_unit_quotes_core_cache_with_spaces_and_percent() {
let plain = systemd_unit("0.0.0.0:29900", None);
assert!(plain.contains(
"Description=Flare agent: runs this host's rank of an orbit's serving group\n"
));
assert!(plain.contains("ExecStart=%h/.local/lib/flare-agent/flare agent --listen 0.0.0.0:29900\n"));
assert!(!plain.contains("--core-cache"));

Expand Down
4 changes: 2 additions & 2 deletions flare-cli/src/orbit/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub struct LaunchOptions {
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum CoreReference {
Local(PathBuf),
/// A core a orbit node holds at an absolute path.
/// A core an orbit node holds at an absolute path.
Node {
node: String,
path: String,
Expand Down Expand Up @@ -1160,7 +1160,7 @@ impl Controller {
match parse_core_reference(reference, |name| self.orbit.node(name).is_some()) {
CoreReference::Local(path) => {
let primary = path.canonicalize().map_err(|e| {
format!("cannot access core {reference}: {e}; a node-held core is NODE:/ABSOLUTE/PATH with NODE a orbit node")
format!("cannot access core {reference}: {e}; a node-held core is NODE:/ABSOLUTE/PATH with NODE an orbit node")
})?;
run_args.serving.verify_weights = verify_weights;
let (authorized, publisher) = verify(&primary, run_args, origin, false)?;
Expand Down
2 changes: 1 addition & 1 deletion flare-cli/src/orbit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub type Failure = Box<dyn std::error::Error + Send + Sync>;

/// The agent's default port on every host.
pub const PORT: u16 = 29900;
/// The agent protocol every node and controller of a orbit must share.
/// The agent protocol every node and controller of an orbit must share.
pub const PROTOCOL_VERSION: u32 = 7;

/// Frame tags. A request receives OK with a body or ERROR with a message.
Expand Down
28 changes: 25 additions & 3 deletions packaging/debian/flare.1
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,35 @@ and tensor-parallel size are required for serving.
.SH COMMANDS
.TP
.B run
Load and serve a prepared model package.
Serve a local core, or download and serve a prepared core from Hugging Face.
.TP
.B download
Download a prepared core from the hardware's Hugging Face revision.
.TP
.B inspect
Summarize a core's metadata, with optional memory, graph, and frontend details.
.TP
.B doctor
Check Linux host readiness for PCIe and DGX Spark tensor-parallel serving.
.TP
.B agent
Run or install a host agent.
Run this host's agent, which pairs with controllers and supervises serving ranks,
or install and manage the agent service.
.TP
.B orbit
Pair hosts and manage multi-host serving groups.
Control an orbit of agents from this machine, pairing hosts and managing
multi-host serving groups.
.TP
.B trust
Manage remembered publisher trust.
.TP
.B models
List, inspect, and manage locally prepared models.
.TP
.B parallax
Monitor live expert-movement and persistent-worker telemetry from a serving
instance. Alias:
.BR worker .
.SH OPTIONS
.TP
.B \-\-help
Expand Down