/
message.proto
248 lines (200 loc) · 5.95 KB
/
message.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
// 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_codes.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 {
};