notapipeline / tiyo

Tiyo is a Kubernetes application designer and flow executor written in Go and JointJS
Mozilla Public License 2.0
0 stars 0 forks source link

gRPC Assemble and flow #3

Open mproffitt opened 2 years ago

mproffitt commented 2 years ago

Following on from #2, in order to rip out the rest api from flow, we need to define a proto interface for handling communication between flow and assemble.

This is likely to require a number of different RPC calls over time and I'm not quite seeing the full requirements but for the moment we at least require:

service Assemble {
    rpc Deploy (Pipeline) returns (stream DeploymentStatus);
    rpc Rollback (Pipeline) returns (stream DeploymentStatus);
    rpc StartQueue (PipelineName) returns (stream QueueStatus);
    rpc StopQueue (PipelineName) returns (QueueStatus);
    rpc NodeDetails returns (stream NodeStatus);
}

message PipelineName {
    string name = 1;
}

message Pipeline {
    string name = 1;

    // contents is the base64 encoded json map
    string contents = 2;
}

message DeploymentStatus {
    repeated Container containers = 1;
    NodeStatus nodestatus = 2;
}

message Container {
    string name = 1;
    int32 requested = 2;
    int32 running = 3;
    int32 failed = 4;
    repeated Pod pods = 5;
}

message Pod {
    string name = 1;
    int32 cpu = 2;
    int32 memory = 3;
    string status = 4;
    string reason = 5;
    Graph cpugraph = 6;
    Graph memorygraph = 7;
}

message Graph {
    repeated float values;
}

message NodeStatus {
    repeated Node nodes = 1;
}

message Node {
    int32 cpu = 1;
    int32 memory = 2;
    repeated Pod pods = 3;
    Graph cpugraph = 4;
    Graph memorygraph = 5;
}

message QueueStatus {
    int32 queued = 1;
    int32 active = 2;
    int32 completed = 3;
}