Add McpMasterService proto and v2 ServiceSpec fields
- New proto/mcp/v1/master.proto: McpMasterService with Deploy, Undeploy, Status, ListNodes RPCs and all message types per architecture v2 spec. - ServiceSpec gains tier (field 5), node (field 6), snapshot (field 7). - RouteSpec gains public (field 5) for edge routing. - New SnapshotConfig message (method + excludes). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
95
proto/mcp/v1/master.proto
Normal file
95
proto/mcp/v1/master.proto
Normal file
@@ -0,0 +1,95 @@
|
||||
// McpMasterService: Multi-node orchestration for the Metacircular platform.
|
||||
syntax = "proto3";
|
||||
|
||||
package mcp.v1;
|
||||
|
||||
option go_package = "git.wntrmute.dev/mc/mcp/gen/mcp/v1;mcpv1";
|
||||
|
||||
import "proto/mcp/v1/mcp.proto";
|
||||
|
||||
// McpMasterService coordinates multi-node deployments. The CLI sends
|
||||
// deploy/undeploy/status requests to the master, which places services on
|
||||
// nodes, forwards to agents, and coordinates edge routing.
|
||||
service McpMasterService {
|
||||
// CLI operations.
|
||||
rpc Deploy(MasterDeployRequest) returns (MasterDeployResponse);
|
||||
rpc Undeploy(MasterUndeployRequest) returns (MasterUndeployResponse);
|
||||
rpc Status(MasterStatusRequest) returns (MasterStatusResponse);
|
||||
rpc ListNodes(ListNodesRequest) returns (ListNodesResponse);
|
||||
}
|
||||
|
||||
// --- Deploy ---
|
||||
|
||||
message MasterDeployRequest {
|
||||
ServiceSpec service = 1;
|
||||
}
|
||||
|
||||
message MasterDeployResponse {
|
||||
string node = 1; // node the service was placed on
|
||||
bool success = 2; // true only if ALL steps succeeded
|
||||
string error = 3;
|
||||
// Per-step results for operator visibility.
|
||||
StepResult deploy_result = 4;
|
||||
StepResult edge_route_result = 5;
|
||||
StepResult dns_result = 6;
|
||||
}
|
||||
|
||||
message StepResult {
|
||||
string step = 1;
|
||||
bool success = 2;
|
||||
string error = 3;
|
||||
}
|
||||
|
||||
// --- Undeploy ---
|
||||
|
||||
message MasterUndeployRequest {
|
||||
string service_name = 1;
|
||||
}
|
||||
|
||||
message MasterUndeployResponse {
|
||||
bool success = 1;
|
||||
string error = 2;
|
||||
}
|
||||
|
||||
// --- Status ---
|
||||
|
||||
message MasterStatusRequest {
|
||||
string service_name = 1; // empty = all services
|
||||
}
|
||||
|
||||
message MasterStatusResponse {
|
||||
repeated ServiceStatus services = 1;
|
||||
}
|
||||
|
||||
message ServiceStatus {
|
||||
string name = 1;
|
||||
string node = 2;
|
||||
string tier = 3;
|
||||
string status = 4; // "running", "stopped", "unhealthy", "unknown"
|
||||
repeated EdgeRouteStatus edge_routes = 5;
|
||||
}
|
||||
|
||||
message EdgeRouteStatus {
|
||||
string hostname = 1;
|
||||
string edge_node = 2;
|
||||
string cert_expires = 3; // RFC3339
|
||||
}
|
||||
|
||||
// --- Nodes ---
|
||||
|
||||
message ListNodesRequest {}
|
||||
|
||||
message ListNodesResponse {
|
||||
repeated NodeInfo nodes = 1;
|
||||
}
|
||||
|
||||
message NodeInfo {
|
||||
string name = 1;
|
||||
string role = 2;
|
||||
string address = 3;
|
||||
string arch = 4;
|
||||
string status = 5; // "healthy", "unhealthy", "unknown"
|
||||
int32 containers = 6;
|
||||
string last_heartbeat = 7; // RFC3339
|
||||
int32 services = 8; // placement count
|
||||
}
|
||||
@@ -61,6 +61,7 @@ message RouteSpec {
|
||||
int32 port = 2; // mc-proxy listener port (e.g. 443, 8443, 9443); NOT the container internal port
|
||||
string mode = 3; // "l4" or "l7"
|
||||
string hostname = 4; // optional public hostname override
|
||||
bool public = 5; // triggers edge routing when true
|
||||
}
|
||||
|
||||
message ComponentSpec {
|
||||
@@ -76,11 +77,19 @@ message ComponentSpec {
|
||||
repeated string env = 10;
|
||||
}
|
||||
|
||||
message SnapshotConfig {
|
||||
string method = 1; // "grpc", "cli", "exec: <cmd>", "full", or "" (default)
|
||||
repeated string excludes = 2; // paths relative to /srv/<service>/ to skip
|
||||
}
|
||||
|
||||
message ServiceSpec {
|
||||
string name = 1;
|
||||
bool active = 2;
|
||||
repeated ComponentSpec components = 3;
|
||||
string comment = 4;
|
||||
string tier = 5; // "core" or "worker" (default: "worker")
|
||||
string node = 6; // explicit node pin (overrides tier)
|
||||
SnapshotConfig snapshot = 7; // snapshot method and excludes
|
||||
}
|
||||
|
||||
message DeployRequest {
|
||||
|
||||
Reference in New Issue
Block a user