-
Notifications
You must be signed in to change notification settings - Fork 136
/
submit.proto
382 lines (341 loc) · 10.7 KB
/
submit.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
syntax = 'proto3';
package api;
option go_package = "github.com/armadaproject/armada/pkg/api";
option csharp_namespace = "ArmadaProject.Io.Api";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/api/networking/v1/generated.proto";
import "google/api/annotations.proto";
import "pkg/api/health.proto";
message JobSubmitRequestItem {
double priority = 1;
string namespace = 3;
string client_id = 8;
map<string, string> labels = 4;
map<string, string> annotations = 5;
map<string, string> required_node_labels = 6 [deprecated = true]; // Use PodSpec.NodeSelector instead
k8s.io.api.core.v1.PodSpec pod_spec = 2 [deprecated = true]; // Use PodSpecs instead
repeated k8s.io.api.core.v1.PodSpec pod_specs = 7;
repeated IngressConfig ingress = 9;
repeated ServiceConfig services = 10;
// Indicates which scheduler should manage this job.
// If empty, the default scheduler is used.
string scheduler = 11;
// Ordinal 12 was previously used for queue_ttl_seconds
}
message IngressConfig {
IngressType type = 1 [deprecated = true];
repeated uint32 ports = 2;
map<string, string> annotations = 3;
bool tls_enabled = 4;
string cert_name = 5;
bool use_clusterIP = 6;
}
message ServiceConfig {
ServiceType type = 1;
repeated uint32 ports = 2;
}
// Ingress type is being kept here to maintain backwards compatibility for a while.
enum IngressType {
Ingress = 0;
}
enum ServiceType {
NodePort = 0;
Headless = 1;
}
// swagger:model
message JobSubmitRequest {
string queue = 1;
string job_set_id = 2;
repeated JobSubmitRequestItem job_request_items = 3;
}
// swagger:model
message JobPreemptRequest {
string queue = 1;
string job_set_id = 2;
repeated string job_ids = 3;
string reason = 4;
}
// swagger:model
message JobCancelRequest {
string job_id = 1;
string job_set_id = 2;
string queue = 3;
repeated string job_ids = 4;
string reason = 5;
}
// swagger:model
message JobSetCancelRequest {
string job_set_id = 1;
string queue = 2;
JobSetFilter filter = 3;
string reason = 4;
}
// swagger:model
message JobSetFilter {
repeated JobState states = 1;
}
// swagger:model
enum JobState {
QUEUED = 0;
PENDING = 1;
RUNNING = 2;
SUCCEEDED = 3;
FAILED = 4;
UNKNOWN = 5;
SUBMITTED = 6;
LEASED = 7;
PREEMPTED = 8;
CANCELLED = 9;
REJECTED = 10;
}
message Job {
string id = 1;
string client_id = 13;
string job_set_id = 2;
string queue = 3;
string namespace = 7;
map<string, string> labels = 9;
map<string, string> annotations = 10;
map<string, string> required_node_labels = 11 [deprecated = true];
string owner = 8;
repeated string queue_ownership_user_groups = 15;
bytes compressed_queue_ownership_user_groups = 19;
double priority = 4;
k8s.io.api.core.v1.PodSpec pod_spec = 5 [deprecated = true]; // Use PodSpecs instead
repeated k8s.io.api.core.v1.PodSpec pod_specs = 12;
// Resource requests and limits necessary for scheduling the main pod of this job.
// The requests and limits herein are set to:
//
// max(
//
// sum across all containers,
// max over all init containers,
//
// )
//
// This is because containers run in parallel, whereas initContainers run serially.
// This field is populated automatically at submission.
// Submitting a job with this field already populated results in an error.
k8s.io.api.core.v1.ResourceRequirements scheduling_resource_requirements = 21;
google.protobuf.Timestamp created = 6;
// Services can be provided either as Armada-specific config objects or as proper k8s objects.
// These options are exclusive, i.e., if either ingress or services is provided,
// then neither of k8s_ingress or k8s_service can be provided, and vice versa.
repeated IngressConfig ingress = 14;
repeated ServiceConfig services = 16;
repeated k8s.io.api.networking.v1.Ingress k8s_ingress = 17;
repeated k8s.io.api.core.v1.Service k8s_service = 18;
// Indicates which scheduler should manage this job.
// If empty, the default scheduler is used.
string scheduler = 20;
// Queuing TTL for this job in seconds. If this job queues for more than this duration it will be cancelled. Zero indicates an infinite lifetime.
int64 queue_ttl_seconds = 22;
}
// swagger:model
message JobReprioritizeRequest {
repeated string job_ids = 1;
string job_set_id = 2;
string queue = 3;
double new_priority = 4;
}
// swagger:model
message JobReprioritizeResponse {
map<string, string> reprioritization_results = 1;
}
message JobSubmitResponseItem {
string job_id = 1;
string error = 2;
}
// swagger:model
message JobSubmitResponse {
repeated JobSubmitResponseItem job_response_items = 1;
}
// swagger:model
message Queue {
message Permissions {
message Subject {
string kind = 1;
string name = 2;
}
repeated Subject subjects = 1;
repeated string verbs = 2;
}
string name = 1;
double priority_factor = 2;
repeated string user_owners = 3;
repeated string group_owners = 4;
// These are ignored and should be removed
map<string, double> resource_limits = 5 [deprecated = true];
// Map from priority class name to resource limit overrides for this queue and priority class.
// If provided for a priority class, global limits for that priority class do not apply to this queue.
map<string, PriorityClassResourceLimits> resource_limits_by_priority_class_name = 7;
repeated Permissions permissions = 6;
// Determines whether scheduling is enabled for this queue.
bool cordoned = 8;
// A list of Kubernetes-like key-value labels, e.g. armadaproject.io/priority=critical
repeated string labels_deprecated = 9 [deprecated=true];
map<string,string> labels = 10;
}
message PriorityClassResourceLimits {
// Limits resources assigned to jobs of this priority class.
// Specifically, jobs of this priority class are only scheduled if doing so does not exceed this limit.
map<string, double> maximum_resource_fraction = 1;
// Per-pool override of maximum_resource_fraction.
// If missing for a particular pool, maximum_resource_fraction is used instead for that pool.
map<string, PriorityClassPoolResourceLimits> maximum_resource_fraction_by_pool = 2;
}
message PriorityClassPoolResourceLimits {
map<string, double> maximum_resource_fraction = 1;
}
// swagger:model
message QueueList {
repeated Queue queues = 1;
}
// swagger:model
message CancellationResult {
repeated string cancelled_ids = 1;
}
//swagger:model
message QueueGetRequest {
string name = 1;
}
//swagger:model
message QueueCordonRequest {
string name = 1;
}
//swagger:model
message QueueUncordonRequest {
string name = 1;
}
//swagger:model
message StreamingQueueGetRequest {
uint32 num = 1;
}
//swagger:model
message QueueDeleteRequest {
string name = 1;
}
message JobSetInfo {
string name = 1;
int32 queued_jobs = 2;
int32 leased_jobs = 3;
}
message QueueUpdateResponse {
Queue queue = 1;
string error = 2;
}
message BatchQueueUpdateResponse {
repeated QueueUpdateResponse failed_queues = 1;
}
message QueueCreateResponse {
Queue queue = 1;
string error = 2;
}
message BatchQueueCreateResponse {
repeated QueueCreateResponse failed_queues = 1;
}
// Indicates the end of streams
message EndMarker{}
message StreamingQueueMessage{
oneof event {
Queue queue = 1;
EndMarker end = 2;
}
}
message QueuePreemptRequest {
string name = 1;
repeated string priorityClasses = 2;
}
message QueueCancelRequest {
string name = 1;
repeated string priorityClasses = 2;
// In practice jobs are only cancellable from non-terminal states
repeated JobState jobStates = 3;
}
service QueueService {
rpc CreateQueue (Queue) returns (google.protobuf.Empty) {}
rpc CreateQueues (QueueList) returns (BatchQueueCreateResponse) {}
rpc UpdateQueue (Queue) returns (google.protobuf.Empty) {}
rpc UpdateQueues (QueueList) returns (BatchQueueUpdateResponse){}
rpc DeleteQueue (QueueDeleteRequest) returns (google.protobuf.Empty) {}
rpc GetQueue (QueueGetRequest) returns (Queue) {}
rpc GetQueues (StreamingQueueGetRequest) returns (stream StreamingQueueMessage) {}
rpc CordonQueue (QueueCordonRequest) returns (google.protobuf.Empty) {}
rpc UncordonQueue (QueueUncordonRequest) returns (google.protobuf.Empty) {}
rpc PreemptOnQueue (QueuePreemptRequest) returns (google.protobuf.Empty) {}
rpc CancelOnQueue (QueueCancelRequest) returns (google.protobuf.Empty) {}
}
service Submit {
rpc SubmitJobs (JobSubmitRequest) returns (JobSubmitResponse) {
option (google.api.http) = {
post: "/v1/job/submit"
body: "*"
};
}
rpc CancelJobs (JobCancelRequest) returns (CancellationResult) {
option (google.api.http) = {
post: "/v1/job/cancel"
body: "*"
};
}
rpc CancelJobSet (JobSetCancelRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/jobset/cancel"
body: "*"
};
}
rpc ReprioritizeJobs (JobReprioritizeRequest) returns (JobReprioritizeResponse) {
option (google.api.http) = {
post: "/v1/job/reprioritize"
body: "*"
};
}
rpc PreemptJobs (JobPreemptRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/job/preempt"
body: "*"
};
}
rpc CreateQueue (Queue) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/queue"
body: "*"
};
}
rpc CreateQueues (QueueList) returns (BatchQueueCreateResponse) {
option(google.api.http) = {
post: "/v1/batched/create_queues"
body: "*"
};
}
rpc UpdateQueue (Queue) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: "/v1/queue/{name}"
body: "*"
};
}
rpc UpdateQueues (QueueList) returns (BatchQueueUpdateResponse) {
option (google.api.http) = {
put: "/v1/batched/update_queues"
body: "*"
};
}
rpc DeleteQueue (QueueDeleteRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/queue/{name}"
};
}
rpc GetQueue (QueueGetRequest) returns (Queue) {
option (google.api.http) = {
get: "/v1/queue/{name}"
};
}
rpc GetQueues (StreamingQueueGetRequest) returns (stream StreamingQueueMessage) {
option (google.api.http) = {
get: "/v1/batched/queues"
};
}
rpc Health(google.protobuf.Empty) returns (HealthCheckResponse);
}