proto/message.proto (200 lines of code) (raw):

// Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // syntax = "proto3"; package gs.rpc; import "error/coordinator.proto"; import "op_def.proto"; import "types.proto"; //////////////////////////////////////////////////////////////////////////////// // // ConnectSession method request/response protos. // //////////////////////////////////////////////////////////////////////////////// message ConnectSessionRequest { bool cleanup_instance = 1; int32 dangling_timeout_seconds = 2; // check version compatibility string version = 3; // Allow reusing existing session. Reusing would be useful for users when the // client, e.g., jupyter-notebook losses the connection with the backend, but // still want to reuse the _cluster_ resources, we should allow users to // establish the RPC connection to reuse, without waiting for dangling timeout. // // See also #287 for more discussion about session persistence and restore. bool reconnect = 4; } message ConnectSessionResponse { // The session handle to be used in subsequent calls for the created session. // // The client must arrange to call CloseSession with this returned // session handle to close the session. string session_id = 2; ClusterType cluster_type = 3; int32 num_workers = 6; string namespace = 7; string engine_config = 10; repeated string host_names = 11; } //////////////////////////////////////////////////////////////////////////////// // // HeartBeat method request/response protos. // //////////////////////////////////////////////////////////////////////////////// message HeartBeatRequest { string session_id = 1; } message HeartBeatResponse { } //////////////////////////////////////////////////////////////////////////////// // // RunStep method request/response protos. // // In most case only the Head is used. // When the content is very large, exceeding the hard message limit of GRPC, // It will be split into chunks and be streamed by a Head followed by 1~n Bodies. // //////////////////////////////////////////////////////////////////////////////// message RunStepRequestHead { // REQUIRED: session_id must be returned by a CreateSession call // to the same master service. string session_id = 1; // REQUIRED: A Dag with op that will be evaluated. DagDef dag_def = 2; } message RunStepRequestBody { bytes chunk = 1; string op_key = 2; bool has_next = 3; } message RunStepRequest { oneof value { RunStepRequestHead head = 1; RunStepRequestBody body = 2; } } message RunStepResponseHead { // list of result of ops in dag repeated OpResult results = 1; Code code = 2; string error_msg = 3; bytes full_exception = 4; } message RunStepResponseBody { bytes chunk = 1; bool has_next = 2; } message RunStepResponse { oneof value { RunStepResponseHead head = 1; RunStepResponseBody body = 2; } } //////////////////////////////////////////////////////////////////////////////// // // FetchLogs method request/response protos. // //////////////////////////////////////////////////////////////////////////////// message FetchLogsRequest { string session_id = 1; } message FetchLogsResponse { // log info. string info_message = 2; // log error. string error_message = 3; } //////////////////////////////////////////////////////////////////////////////// // // CloseSession method request/response protos. // //////////////////////////////////////////////////////////////////////////////// message CloseSessionRequest { // REQUIRED: session_id must be returned by a CreateSession call // to the same master service. string session_id = 1; } message CloseSessionResponse { } //////////////////////////////////////////////////////////////////////////////// // // Upload libs/jars from client to pods // //////////////////////////////////////////////////////////////////////////////// message AddLibRequest{ string session_id = 1; bytes gar = 2; } message AddLibResponse{ } message CreateAnalyticalInstanceRequest { string session_id = 1; }; message CreateAnalyticalInstanceResponse { string instance_id = 1; string engine_config = 2; repeated string host_names = 5; }; message CreateInteractiveInstanceRequest { string session_id = 1; int64 object_id = 2; string schema_path = 3; map<string, string> params = 4; bool with_cypher = 5; }; message CreateInteractiveInstanceResponse { string gremlin_endpoint = 1; string cypher_endpoint = 2; int64 object_id = 3; }; enum LearningBackend { GRAPHLEARN = 0; GRAPHLEARN_TORCH = 1; } message CreateLearningInstanceRequest { string session_id = 1; int64 object_id = 2; string handle = 3; string config = 4; LearningBackend learning_backend = 5; }; message CreateLearningInstanceResponse { int64 object_id = 1; string handle = 2; string config = 3; repeated string endpoints = 4; }; //////////////////////////////////////////////////////////////////////////////// // // Close Instance request/response protos. // //////////////////////////////////////////////////////////////////////////////// message CloseAnalyticalInstanceRequest { string session_id = 1; string instance_id = 2; }; message CloseAnalyticalInstanceResponse { }; message CloseInteractiveInstanceRequest { string session_id = 1; int64 object_id = 2; }; message CloseInteractiveInstanceResponse { }; message CloseLearningInstanceRequest { string session_id = 1; int64 object_id = 2; }; message CloseLearningInstanceResponse { };