-
Notifications
You must be signed in to change notification settings - Fork 1
/
rainbow.proto
140 lines (113 loc) · 3.61 KB
/
rainbow.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
syntax = "proto3";
package convergedcomputing.org.grpc.v1;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/converged-computing/rainbow/pkg/api/v1";
// RainbowSchedulerService provides API endpoints for interacting with the central scheduler service
service RainbowScheduler {
// Register cluster - request to register a new cluster
rpc Register(RegisterRequest) returns (RegisterResponse);
// Job Submission - request for submitting a job to a named cluster
rpc SubmitJob(SubmitJobRequest) returns (SubmitJobResponse);
// Request Job - ask the rainbow scheduler for up to max jobs
rpc RequestJobs(RequestJobsRequest) returns (RequestJobsResponse);
// Accept Jobs - accept some number of jobs
rpc AcceptJobs(AcceptJobsRequest) returns (AcceptJobsResponse);
}
// RegisterRequest registers a cluster to the scheduler service
// The shared secret is required to validate the request
message RegisterRequest {
string name = 1;
string secret = 2;
// JGF json of nodes (needs to be read in with jsongraph-go)
string nodes = 3;
string subsystem = 4;
google.protobuf.Timestamp sent = 5;
}
// SubmitJobRequest takes a job name, cluster name
// and requires the cluster token. Since we want to be generic,
// we currently accept nodes, tasks, and the command
message SubmitJobRequest {
string name = 1;
repeated Cluster clusters = 2;
string jobspec = 3;
google.protobuf.Timestamp sent = 4;
message Cluster {
string name = 1;
string token = 2;
}
}
// RequestJobsRequest is used by a cluster (or other entity that can run jobs)
// to get back a maximum of N jobs. This will (and should) eventually
// support filters / sorting criteria, but now we just take the top
// N from a query. The response includes the ids that are accepted
message RequestJobsRequest {
string cluster = 1;
// cluster secret given on registration
// No other cluster or user can take a cluster's jobs!
string secret = 2;
// Max jobs to request
int32 maxJobs = 3;
google.protobuf.Timestamp sent = 7;
}
// N from a query. The response includes the ids that are accepted
message AcceptJobsRequest {
string cluster = 1;
string secret = 2;
repeated int32 jobids = 3;
google.protobuf.Timestamp sent = 4;
}
// Register Response
message RegisterResponse {
// Registration statuses
enum ResultType {
REGISTER_UNSPECIFIED = 0;
REGISTER_SUCCESS = 1;
REGISTER_ERROR = 2;
REGISTER_DENIED = 3;
REGISTER_EXISTS = 4;
}
string request_id = 1;
// The "token" is given to clients (or this cluster) to submit jobs
// In the future this should be able to be refreshed
string token = 2;
// The "secret" is for this cluster to receive them.
string secret = 3;
ResultType status = 4;
}
// Submit Job Response
message SubmitJobResponse {
// Enum to represent the result types of the operation.
enum ResultType {
SUBMIT_UNSPECIFIED = 0;
SUBMIT_SUCCESS = 1;
SUBMIT_ERROR = 2;
SUBMIT_DENIED = 3;
}
string request_id = 1;
int32 jobid = 2;
ResultType status = 3;
}
// RequestJobsResponse
message RequestJobsResponse {
// Enum to represent the result types of the operation.
enum ResultType {
REQUEST_JOBS_NORESULTS = 0;
REQUEST_JOBS_SUCCESS = 1;
REQUEST_JOBS_ERROR = 2;
REQUEST_JOBS_DENIED = 3;
}
string request_id = 1;
map<int32, string> jobs = 2;
// repeated int32 accepted_jobids = 2;
ResultType status = 3;
}
// Accept Jobs Response
message AcceptJobsResponse {
enum ResultType {
RESULT_TYPE_UNSPECIFIED = 0;
RESULT_TYPE_PARTIAL = 1;
RESULT_TYPE_SUCCESS = 2;
RESULT_TYPE_ERROR = 3;
}
ResultType status = 1;
}