GraphScope icon indicating copy to clipboard operation
GraphScope copied to clipboard

Proposal of protos for modularized GraphScope.

Open siyuan0322 opened this issue 2 years ago • 2 comments

Propose a prototype of create/patch/delete/computation protocols for the components of GraphScope.

siyuan0322 avatar May 16 '22 03:05 siyuan0322

syntax = "proto3";

////////////////////////////////////////////////////////////////////////////////
//
// Connecting coordinator request/response protos.
//
////////////////////////////////////////////////////////////////////////////////


message ConnectSessionRequest {
    string endpoint = 1;
    string version = 2;
};

message ConnectSessionResponse {
    Code status_code = 1;
    string session_id = 2;
    string message = 3;
};


////////////////////////////////////////////////////////////////////////////////
//
// Create Engine request/response protos.
//
////////////////////////////////////////////////////////////////////////////////

message NodePreference {
    map<string, string> labels = 1;
    map<string, string> affinity = 2;
};

message ResourceSpec {
    string cpu = 1;
    string memory = 2;
    string volume = 3;
}

message CreateAnalyticalInstanceRequest {
    string session_id = 1;
    int64 replicas = 2;
    NodePreference preference = 4;
    ResourceSpec resource_spec = 5;
};

message CreateAnalyticalInstanceResponse {
    string instance_id = 1;
    string endpoint = 2;
};

message CreateInteractiveInstanceRequest {
    string session_id = 1;
    int64 replicas = 2;
    NodePreference preference = 4;
    ResourceSpec resource_spec = 5;
};

message CreateInteractiveInstanceResponse {
    string instance_id = 1;
    string grpc_endpoint = 2;
    string gremlin_endpoint = 3;

};

message CreateLearningInstanceRequest {
    string session_id = 1;
    int64 replicas = 2;
    NodePreference preference = 4;
    ResourceSpec resource_spec = 5;
};

message CreateLearningInstanceResponse {
    string instance_id = 1;
    string object_id = 2;
    string handle = 3;
    string config = 4;
};

////////////////////////////////////////////////////////////////////////////////
//
// Patch Engine Status request/response protos.
//
////////////////////////////////////////////////////////////////////////////////

message PatchAnalyticalInstanceRequest {
    string session_id = 1;
    string instance_id = 2;
    int64 replicas = 3;
};

message PatchAnalyticalInstanceResponse {
    string endpoint = 1;
};

message PatchInteractiveInstanceRequest {
    string session_id = 1;
    string instance_id = 2;
    int64 replicas = 3;
};

message PatchInteractiveInstanceResponse {
    string endpoint = 2;
    string hosts = 3;
};

message PatchLearningInstanceRequest {
    string instance_id = 1;

};

message PatchLearningInstanceResponse {

};

////////////////////////////////////////////////////////////////////////////////
//
// Close Instance request/response protos.
//
////////////////////////////////////////////////////////////////////////////////

message CloseAnalyticalInstanceRequest {
    string instance_id = 1;
};

message CloseAnalyticalInstanceResponse {

};

message CloseInteractiveInstanceRequest {
    string instance_id = 1;

};

message CloseInteractiveInstanceResponse {

};

message CloseLearningInstanceRequest {
    string instance_id = 1;

};

message CloseLearningInstanceResponse {

};

////////////////////////////////////////////////////////////////////////////////
//
// RunStep request/response protos.
//
////////////////////////////////////////////////////////////////////////////////



message RunStepRequest {
    string session_id = 1;
    string instance_id = 2;
    DagDef dag_def = 3;
}

message RunStepResponse {
    Code status_code = 1;
    OpResult result = 2;
    string message = 3;
};


message LoggingRequest {
    string instance_id = 1;
};

message LoggingResponse {
    string message = 1;
};

message HeartbeatRequest {
    string instance_id = 1;
};

message HeartbeatResponse {

};



service EngineService {
    rpc CreateAnalyticalInstance (CreateAnalyticalInstanceRequest) returns (CreateAnalyticalInstanceResponse);

    rpc CreateInteractiveInstance (CreateInteractiveInstanceRequest) returns (CreateInteractiveInstanceResponse);

    rpc CreateLearningInstance (CreateLearningInstanceRequest) returns (CreateLearningInstanceResponse);

    rpc PatchAnalyticalInstance (PatchAnalyticalInstanceRequest) returns (PatchAnalyticalInstanceResponse);

    rpc PatchInteractiveInstance (PatchInteractiveInstanceRequest) returns (PatchInteractiveInstanceResponse);

    rpc PatchLearningInstance (PatchLearningInstanceRequest) returns (PatchLearningInstanceResponse);

    rpc CloseAnalyticalInstance (CloseAnalyticalInstanceRequest) returns (CloseAnalyticalInstanceResponse);

    rpc CloseInteractiveInstance (CloseInteractiveInstanceRequest) returns (CloseInteractiveInstanceResponse);

    rpc CloseLearningInstance (CloseLearningInstanceRequest) returns (CloseLearningInstanceResponse);

    // Drives the graph computation.
    rpc RunStep(stream RunStepRequest) returns (stream RunStepResponse);
  
    // Heart beat between coordinator and engines
    rpc HeartBeat(HeartbeatRequest) returns (HeartbeatResponse);

    rpc Logging(LoggingRequest) returns (LoggingResponse);
}

siyuan0322 avatar May 17 '22 02:05 siyuan0322

I have some comments:

  • Patch?
  • Logging?
  • Maybe adding detailed comments would help to understand their purpose.
  • status & meta;

yecol avatar May 18 '22 02:05 yecol