Repository navigation
feat(mesh): fleet M2M control, owner-signed gossip policy, and fleet token metrics #3211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
6b7508b
047b74e
a39e802
6314b2f
b1506c1
cdcbb7e
e125c9c
62375a1
50217db
e49ec3d
f61773f
c0a1b57
01ddd9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| version: 2 | ||
| reviews: | ||
| auto_review: | ||
| enabled: true | ||
| drafts: true | ||
| base_branches: | ||
| - main | ||
| request_changes_workflow: false | ||
| high_level_summary: true | ||
| poem: false | ||
| review_status: true | ||
| collapse_walkthrough: false | ||
| path_instructions: | ||
| - path: "mesh/crates/**/*.rs" | ||
| instructions: "This is a Rust 2024 workspace. Focus on correctness, safety, and adherence to the project's one-way dependency rule (Skippy must not depend on Mesh crates). Note: node.proto is source of truth; node.rs is manually-maintained (no build.rs)." | ||
| - path: "mesh/crates/mesh-llm-host-runtime/src/policy/**" | ||
| instructions: "New policy module. Check PolicyStore per-owner generation tracking, PolicyApplicator self-endpoint wiring, and disk persistence atomicity." | ||
| - path: "mesh/crates/mesh-llm-host-runtime/src/api/routes/runtime.rs" | ||
| instructions: "New fleet endpoints: POST /api/runtime/control/fleet, GET /api/runtime/fleet/metrics, POST/GET/DELETE /api/runtime/control/mesh-policy. Verify auth guard coverage and filter logic." | ||
| chat: | ||
| auto_reply: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -769,11 +769,72 @@ pub enum Command { | |
| #[command(subcommand)] | ||
| command: AuthCommand, | ||
| }, | ||
| /// Manage the fleet mesh policy (fleet M2M signed config gossip). | ||
| #[command(name = "policy", hide = true)] | ||
| Policy { | ||
| #[command(subcommand)] | ||
| command: PolicyCommand, | ||
| }, | ||
| /// Run a CLI command contributed by a configured plugin. | ||
| #[command(external_subcommand)] | ||
| ExternalPlugin(Vec<OsString>), | ||
| } | ||
|
|
||
| /// Fleet mesh-policy commands. | ||
| #[derive(Subcommand, Debug)] | ||
| pub enum PolicyCommand { | ||
| /// Push a signed mesh policy to the local node. | ||
| /// | ||
| /// Auto-sign mode: provide --ensure-models / --drain-models and the node's | ||
| /// owner keypair is loaded from the default keystore to sign the policy. | ||
| /// | ||
| /// Pre-signed mode: provide --payload and --signature (advanced / external signer). | ||
| Set { | ||
| /// Models to ensure are serving (comma-separated). Auto-sign mode. | ||
| #[arg(long, value_delimiter = ',', conflicts_with = "payload")] | ||
| ensure_models: Vec<String>, | ||
| /// Models to drain (comma-separated). Auto-sign mode. | ||
| #[arg(long, value_delimiter = ',', conflicts_with = "payload")] | ||
| drain_models: Vec<String>, | ||
| /// How long (in seconds) until the policy expires. Auto-sign mode. | ||
| #[arg(long, conflicts_with = "payload")] | ||
| expires_in_secs: Option<u64>, | ||
| /// Monotonic generation counter for the policy. Auto-sign mode (default: 1). | ||
| #[arg(long, conflicts_with = "payload")] | ||
| policy_gen: Option<u32>, | ||
| /// Base64-encoded signed policy payload bytes. Pre-signed mode. | ||
| #[arg(long, conflicts_with_all = ["ensure_models", "drain_models"])] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Require With Add
|
||
| payload: Option<String>, | ||
| /// Base64-encoded Ed25519 signature over the payload. Pre-signed mode. | ||
| #[arg(long, requires = "payload")] | ||
| signature: Option<String>, | ||
| /// Console/API port of the running mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
| /// Print machine-readable JSON. | ||
| #[arg(long)] | ||
| json: bool, | ||
| }, | ||
| /// Show the current mesh policy on the local node. | ||
| Get { | ||
| /// Console/API port of the running mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
| /// Print machine-readable JSON. | ||
| #[arg(long)] | ||
| json: bool, | ||
| }, | ||
| /// Clear the current mesh policy from the local node. | ||
| Clear { | ||
| /// Console/API port of the running mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
| /// Print machine-readable JSON. | ||
| #[arg(long)] | ||
| json: bool, | ||
| }, | ||
| } | ||
|
|
||
| /// Anonymous usage reporting controls. | ||
| /// | ||
| /// Separate from `[telemetry]`, which exports OTLP metrics to an endpoint the | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,14 +117,27 @@ pub enum RuntimeCommand { | |
| /// Load a model on a remote node through owner-control. | ||
| LoadModel { | ||
| /// Explicit owner-control endpoint token for the target node. | ||
| #[arg(long)] | ||
| endpoint: String, | ||
| /// Mutually exclusive with --fleet. | ||
| #[arg(long, conflicts_with = "fleet")] | ||
| endpoint: Option<String>, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the four lifecycle dispatch arms for the new
For each arm and its
|
||
| /// Model canonical reference to load. | ||
| #[arg(long)] | ||
| model: String, | ||
| /// Optional runtime profile to apply. | ||
| #[arg(long)] | ||
| profile: Option<String>, | ||
| /// Fan out to all peers in the mesh (requires owner-control bearer). | ||
| #[arg(long, conflicts_with = "endpoint")] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] The maintained CLI guide still describes these operations as requiring an explicit endpoint and targeting one node. Document fleet mode, |
||
| fleet: bool, | ||
| /// Filter fleet targets by role (repeatable; Worker|Host). Ignored without --fleet. | ||
| #[arg(long = "role")] | ||
| fleet_role_filter: Vec<String>, | ||
| /// Filter fleet targets by node ID prefix (repeatable). Ignored without --fleet. | ||
| #[arg(long = "node")] | ||
| fleet_node_filter: Vec<String>, | ||
| /// Print targets without executing (dry run). Ignored without --fleet. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Say that The help says the flag is ignored without Also applies to: 185-185, 222-222, 263-263
|
||
| #[arg(long)] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] |
||
| dry_run: bool, | ||
| /// Console/API port of the local mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
|
|
@@ -135,18 +148,31 @@ pub enum RuntimeCommand { | |
| /// Unload a model on a remote node through owner-control. | ||
| UnloadModel { | ||
| /// Explicit owner-control endpoint token for the target node. | ||
| #[arg(long)] | ||
| endpoint: String, | ||
| /// Mutually exclusive with --fleet. | ||
| #[arg(long, conflicts_with = "fleet")] | ||
| endpoint: Option<String>, | ||
| /// Model canonical reference to unload. | ||
| #[arg( | ||
| long, | ||
| required_unless_present = "instance_id", | ||
| required_unless_present_any = ["instance_id", "fleet"], | ||
| conflicts_with = "instance_id" | ||
| )] | ||
| model: Option<String>, | ||
| /// Exact instance ID to unload. | ||
| #[arg(long, required_unless_present = "model", conflicts_with = "model")] | ||
| #[arg(long, required_unless_present_any = ["model", "fleet"], conflicts_with = "model")] | ||
| instance_id: Option<String>, | ||
| /// Fan out to all peers in the mesh (requires owner-control bearer). | ||
| #[arg(long, conflicts_with = "endpoint")] | ||
| fleet: bool, | ||
| /// Filter fleet targets by role (repeatable; Worker|Host). Ignored without --fleet. | ||
| #[arg(long = "role")] | ||
| fleet_role_filter: Vec<String>, | ||
| /// Filter fleet targets by node ID prefix (repeatable). Ignored without --fleet. | ||
| #[arg(long = "node")] | ||
| fleet_node_filter: Vec<String>, | ||
| /// Print targets without executing (dry run). Ignored without --fleet. | ||
| #[arg(long)] | ||
| dry_run: bool, | ||
| /// Console/API port of the local mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
|
|
@@ -157,14 +183,27 @@ pub enum RuntimeCommand { | |
| /// Ensure a model is loaded on a remote node through owner-control. | ||
| EnsureModel { | ||
| /// Explicit owner-control endpoint token for the target node. | ||
| #[arg(long)] | ||
| endpoint: String, | ||
| /// Mutually exclusive with --fleet. | ||
| #[arg(long, conflicts_with = "fleet")] | ||
| endpoint: Option<String>, | ||
| /// Model canonical reference to ensure loaded. | ||
| #[arg(long)] | ||
| model: String, | ||
| /// Optional runtime profile to maintain. | ||
| #[arg(long)] | ||
| profile: Option<String>, | ||
| /// Fan out to all peers in the mesh (requires owner-control bearer). | ||
| #[arg(long, conflicts_with = "endpoint")] | ||
| fleet: bool, | ||
| /// Filter fleet targets by role (repeatable; Worker|Host). Ignored without --fleet. | ||
| #[arg(long = "role")] | ||
| fleet_role_filter: Vec<String>, | ||
| /// Filter fleet targets by node ID prefix (repeatable). Ignored without --fleet. | ||
| #[arg(long = "node")] | ||
| fleet_node_filter: Vec<String>, | ||
| /// Print targets without executing (dry run). Ignored without --fleet. | ||
| #[arg(long)] | ||
| dry_run: bool, | ||
| /// Console/API port of the local mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
|
|
@@ -175,18 +214,31 @@ pub enum RuntimeCommand { | |
| /// Drain and unload a model on a remote node through owner-control. | ||
| DrainModel { | ||
| /// Explicit owner-control endpoint token for the target node. | ||
| #[arg(long)] | ||
| endpoint: String, | ||
| /// Mutually exclusive with --fleet. | ||
| #[arg(long, conflicts_with = "fleet")] | ||
| endpoint: Option<String>, | ||
| /// Model canonical reference to drain. | ||
| #[arg( | ||
| long, | ||
| required_unless_present = "instance_id", | ||
| required_unless_present_any = ["instance_id", "fleet"], | ||
| conflicts_with = "instance_id" | ||
| )] | ||
| model: Option<String>, | ||
| /// Exact instance ID to drain. | ||
| #[arg(long, required_unless_present = "model", conflicts_with = "model")] | ||
| #[arg(long, required_unless_present_any = ["model", "fleet"], conflicts_with = "model")] | ||
| instance_id: Option<String>, | ||
| /// Fan out to all peers in the mesh (requires owner-control bearer). | ||
| #[arg(long, conflicts_with = "endpoint")] | ||
| fleet: bool, | ||
| /// Filter fleet targets by role (repeatable; Worker|Host). Ignored without --fleet. | ||
| #[arg(long = "role")] | ||
| fleet_role_filter: Vec<String>, | ||
| /// Filter fleet targets by node ID prefix (repeatable). Ignored without --fleet. | ||
| #[arg(long = "node")] | ||
| fleet_node_filter: Vec<String>, | ||
| /// Print targets without executing (dry run). Ignored without --fleet. | ||
| #[arg(long)] | ||
| dry_run: bool, | ||
| /// Console/API port of the local mesh-llm instance (default: 3131) | ||
| #[arg(long, default_value = "3131")] | ||
| port: u16, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.