Skip to content

Commit 8894c25

Browse files
author
Michel Vocks
committed
Added proto file and small documentation on how to regenerate the gRPC server interface
1 parent 29cc36b commit 8894c25

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# cppsdk
22
C++ SDK for Gaia
3+
4+
# How to generate gRPC server interfaces
5+
If the `plugin.proto` file has been changed, it's sometimes useful to regenerate the gRPC server interfaces.
6+
You can use the command `make plugin.grpc.pb.cc plugin.pb.cc` to regenerate them.

Diff for: plugin.proto

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// plugin.proto
2+
// Defines the gRPC interface between gaia and the user defined
3+
// pipelines (plugins). All rpc Methods are called from Gaia and
4+
// executed in the plugin.
5+
6+
syntax = "proto3";
7+
8+
option java_multiple_files = true;
9+
option java_package = "io.gaiapipeline.proto";
10+
option java_outer_classname = "GRPCPlugin";
11+
12+
package proto;
13+
14+
// Job represents a single job
15+
message Job {
16+
uint32 unique_id = 1;
17+
string title = 2;
18+
string description = 3;
19+
repeated uint32 dependson = 4;
20+
repeated Argument args = 5;
21+
ManualInteraction interaction = 6;
22+
}
23+
24+
// Argument represents an argument passed from a pipeline
25+
// to gaia and/or from gaia to the pipeline.
26+
message Argument {
27+
string description = 1;
28+
string type = 2;
29+
string key = 3;
30+
string value = 4;
31+
}
32+
33+
// ManualInteraction represents a manual human interaction
34+
message ManualInteraction {
35+
string description = 1;
36+
string type = 2;
37+
string value = 3;
38+
}
39+
40+
// JobResult represents the result of an executed job
41+
message JobResult {
42+
uint32 unique_id = 1;
43+
bool failed = 2;
44+
bool exit_pipeline = 3;
45+
string message = 4;
46+
}
47+
48+
// Empty message
49+
message Empty {}
50+
51+
service Plugin {
52+
// GetJobs returns a stream of Job objects.
53+
// Used to expose jobs to gaia.
54+
rpc GetJobs(Empty) returns (stream Job);
55+
56+
// ExecuteJob signals the plugin to execute the given job.
57+
// Used to execute one job from a pipeline.
58+
rpc ExecuteJob(Job) returns (JobResult);
59+
}

0 commit comments

Comments
 (0)