Skip to content

Commit 7d4afdc

Browse files
daria.malkovagravicapailya-kozyrevpavel-avilov
authored
Merge pull request #15614 from [BEAM-12953] [Playground] Create protobuf file for front-back communication
* Add protofile * Fix typos. * add proto/grpc as dependencies * Change protobuf file * Renamed some fields and inserted SDK_UNSPECIFIED status * Refactoring proto file * Change int32 pipeline_id to string pipeline_uuid * Edit comments for some messages. Co-authored-by: gravicapa <dasha.m91@gmail.com> Co-authored-by: Ilya Kozyrev <ilya.kozyrev@akvelon.com> Co-authored-by: Pavel Avilov <avilovpavel6@gmail.com>
1 parent 476efbb commit 7d4afdc

2 files changed

Lines changed: 101 additions & 1 deletion

File tree

playground/backend/go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@
1515

1616
module beam.apache.org/playground/backend
1717

18-
go 1.16
18+
go 1.16
19+
20+
require (
21+
google.golang.org/grpc v1.41.0
22+
google.golang.org/protobuf v1.27.1
23+
)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
syntax = "proto3";
20+
21+
option go_package = "github.com/apache/beam/playground/v1;playground";
22+
package playground.v1;
23+
24+
enum Sdk {
25+
SDK_UNSPECIFIED = 0;
26+
SDK_JAVA = 1;
27+
SDK_GO = 2;
28+
SDK_PYTHON = 3;
29+
SDK_SCIO = 4;
30+
}
31+
32+
enum Status {
33+
STATUS_UNSPECIFIED = 0;
34+
STATUS_EXECUTING = 1;
35+
STATUS_FINISHED = 2;
36+
STATUS_ERROR = 3;
37+
}
38+
39+
// RunCodeRequest represents a code text and options of SDK which executes the code.
40+
message RunCodeRequest {
41+
string code = 1;
42+
Sdk sdk = 2;
43+
}
44+
45+
// RunCodeResponse contains information of the pipeline uuid.
46+
message RunCodeResponse {
47+
string pipeline_uuid = 1;
48+
}
49+
50+
// CheckStatusRequest contains information of the pipeline uuid.
51+
message CheckStatusRequest {
52+
string pipeline_uuid = 1;
53+
}
54+
55+
// StatusInfo contains information about the status of the code execution.
56+
message CheckStatusResponse {
57+
Status status = 1;
58+
}
59+
60+
// GetCompileOutputRequest contains information of the pipeline uuid.
61+
message GetCompileOutputRequest {
62+
string pipeline_uuid = 1;
63+
}
64+
65+
// GetCompileOutputResponse represents the result of the compiled code.
66+
message GetCompileOutputResponse {
67+
string output = 1;
68+
Status compilation_status = 2;
69+
}
70+
71+
// GetRunOutputRequest contains information of the pipeline uuid.
72+
message GetRunOutputRequest {
73+
string pipeline_uuid = 1;
74+
}
75+
76+
// RunOutputResponse represents the result of the executed code.
77+
message GetRunOutputResponse {
78+
string output = 1;
79+
Status compilation_status = 2;
80+
}
81+
82+
service PlaygroundService {
83+
84+
// Submit the job for an execution and get the pipeline uuid.
85+
rpc RunCode(RunCodeRequest) returns (RunCodeResponse);
86+
87+
// Get the status of pipeline execution.
88+
rpc CheckStatus(CheckStatusRequest) returns (CheckStatusResponse);
89+
90+
// Get the result of pipeline execution.
91+
rpc GetRunOutput(GetRunOutputRequest) returns (GetRunOutputResponse);
92+
93+
// Get the result of pipeline compilation.
94+
rpc GetCompileOutput(GetCompileOutputRequest) returns (GetCompileOutputResponse);
95+
}

0 commit comments

Comments
 (0)