summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/core/jasper.proto
blob: 85a064755fb6d85dcd87ebd1d787df5ceec70372 (plain)
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
syntax = "proto3";

package jasper;
option go_package = "internal";

import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";

message LoggerConfig {
  oneof producer {
    DefaultLoggerOptions default = 1;
    FileLoggerOptions file = 2;
    InheritedLoggerOptions inherited = 3;
    SumoLogicLoggerOptions sumo = 4;
    InMemoryLoggerOptions in_memory = 5;
    SplunkLoggerOptions splunk = 6;
    BuildloggerV2Options buildloggerv2 = 7;
    BuildloggerV3Options buildloggerv3 = 8;
    RawLoggerConfig raw = 9;
  }
}

message LogLevel {
  int32 threshold = 1;
  int32 default = 2;
}

message BufferOptions {
  bool buffered = 1;
  int64 duration = 2;
  int64 max_size = 3;
}

enum LogFormat {
  LOGFORMATUNKNOWN = 0;
  LOGFORMATPLAIN = 1;
  LOGFORMATJSON = 2;
  LOGFORMATBSON = 3;
  LOGFORMATDEFAULT = 4;
}

message BaseOptions {
  LogLevel level = 1;
  BufferOptions buffer = 2;
  LogFormat format = 3;
}

message DefaultLoggerOptions {
  string prefix = 1;
  BaseOptions base = 2;
}

message FileLoggerOptions {
  string filename = 1;
  BaseOptions base = 2;
}

message InheritedLoggerOptions {
  BaseOptions base = 1;
}

message SumoLogicLoggerOptions {
  string sumo_endpoint = 1;
  BaseOptions base = 2;
}

message InMemoryLoggerOptions {
  int64 in_memory_cap = 1;
  BaseOptions base = 2;
}

message SplunkInfo {
  string url = 1;
  string token = 2;
  string channel = 3;
}

message SplunkLoggerOptions {
  SplunkInfo splunk = 1;
  BaseOptions base = 2;
}

message BuildloggerV2Info {
  bool create_test = 1;
  string url = 2;
  int64 number = 3;
  string phase = 4;
  string builder = 5;
  string test = 6;
  string command = 7;
}

message BuildloggerV2Options {
  BuildloggerV2Info buildlogger = 1;
  BaseOptions base = 2;
}

message BuildloggerV3Info {
  string project = 1;
  string version = 2;
  string variant = 3;
  string task_name = 4;
  string task_id = 5;
  int32 execution = 6;
  string test_name = 7;
  int32 trial = 8;
  string proc_name = 9;
  LogFormat format = 10;
  repeated string tags = 11;
  map<string, string> args = 12;
  bool mainline = 13;
  string prefix = 14;
  int64 max_buffer_size = 15;
  int64 flush_interval = 16;
  bool disable_new_line_check = 17;
  string base_address = 18;
  string rpc_port = 19;
  bool insecure = 20;
  string username = 21;
  string api_key = 22;
}

message BuildloggerV3Options {
  BuildloggerV3Info buildloggerv3 = 1;
  string name = 2;
  LogLevel level = 3;
}

enum RawLoggerConfigFormat {
  RAWLOGGERCONFIGFORMATJSON = 0;
  RAWLOGGERCONFIGFORMATBSON = 1;
  RAWLOGGERCONFIGFORMATUNKNOWN = 2;
}

message RawLoggerConfig {
  RawLoggerConfigFormat format = 1;
  bytes config_data = 2;
}

message OutputOptions {
  repeated LoggerConfig loggers = 1;
  bool suppress_output = 2;
  bool suppress_error = 3;
  bool redirect_output_to_error = 4;
  bool redirect_error_to_output = 5;
}

message CreateOptions {
  repeated string args = 1;
  string working_directory = 2;
  map<string, string> environment = 3;
  bool override_environ = 4;
  int64 timeout_seconds = 5;
  repeated string tags = 6;
  repeated CreateOptions on_success = 7;
  repeated CreateOptions on_failure = 8;
  repeated CreateOptions on_timeout = 9;
  OutputOptions output = 10;
  bytes standard_input_bytes = 11;
}

message IDResponse {
  string value = 1;
}

message ProcessInfo {
  string id = 1;
  int64 pid = 2;
  string host_id = 3;
  bool running = 4;
  bool successful = 5;
  bool complete = 6;
  bool timedout = 7;
  CreateOptions options = 8;
  int32 exit_code = 9;
  google.protobuf.Timestamp start_at = 10;
  google.protobuf.Timestamp end_at = 11;
}

message StatusResponse {
  string host_id = 1;
  bool active = 2;
}

message Filter {
  FilterSpecifications name = 1;
}

enum  FilterSpecifications {
  ALL = 0;
  RUNNING = 1;
  TERMINATED = 2;
  FAILED = 3;
  SUCCESSFUL = 4;
}

message SignalProcess {
  JasperProcessID ProcessID = 1;
  Signals signal = 2;
}

enum Signals {
  UNKNOWN = 0;
  TERMINATE = 1;
  KILL = 2;
  HANGUP = 3;
  INIT = 4;
  USER1 = 5;
  USER2 = 6;
  ABRT= 7;
}

message TagName {
  string value = 1;
}

message ProcessTags {
  string processID = 1;
  repeated string tags = 2;
}

message JasperProcessID {
  string value = 1;
}

message OperationOutcome {
  bool success = 1;
  string text = 2;
  int32 exit_code = 3;
}

message BuildOptions {
  string target = 1;
  string arch = 2;
  string edition = 3;
  bool debug = 4;
}

message MongoDBDownloadOptions {
  BuildOptions build_opts = 1;
  string path = 2;
  repeated string releases = 3;
}

message CacheOptions {
  bool disabled = 1;
  int64 prune_delay_seconds = 2;
  int64 max_size = 3;
}

enum ArchiveFormat {
  ARCHIVEUNKNOWN = 0;
  ARCHIVEAUTO = 1;
  ARCHIVETARGZ = 2;
  ARCHIVEZIP = 3;
}

message ArchiveOptions {
  bool should_extract = 1;
  ArchiveFormat format = 2;
  string target_path = 3;
}

message DownloadInfo {
  string url = 1;
  string path = 2;
  ArchiveOptions archive_opts = 3;
}

message WriteFileInfo {
  string path = 1;
  bytes content = 2;
  bool append = 4;
  uint32 perm = 3;
}

message BuildloggerURLs {
  repeated string urls = 1;
}

message LogRequest {
  JasperProcessID id = 1;
  int64 count = 2;
}
message LogStream {
  repeated string logs = 1;
  bool done = 2;
}

enum SignalTriggerID {
  NONE = 0;
  CLEANTERMINATION = 1;
}

message SignalTriggerParams {
  JasperProcessID processID = 1;
  SignalTriggerID signalTriggerID = 2;
}

message EventName {
  string value = 1;
}

message ScriptingHarnessID {
  string id = 1;
}

message ScriptingOptionsGolang {
  string gopath = 1;
  string goroot = 2;
  repeated string packages = 3;
  string directory = 4;
  bool update_packages = 5;
}

message ScriptingOptionsPython {
  string virtual_env_path = 1;
  string requirements_path = 2;
  string interpreter_binary = 3;
  repeated string packages = 4;
  bool legacy_python = 5;
  bool add_test_reqs = 6;
}

message ScriptingOptionsRoswell {
  string path = 1;
  repeated string systems = 2;
  string lisp = 3;
}

message ScriptingOptions {
  oneof value {
    ScriptingOptionsGolang golang = 1;
    ScriptingOptionsPython python = 2;
    ScriptingOptionsRoswell roswell = 3;
  }
  map<string, string> environment = 4;
  OutputOptions output = 5;
  int64 duration = 6;
}

message ScriptingHarnessRunArgs {
  string id = 1;
  repeated string args = 2;
}

message ScriptingHarnessBuildArgs {
  string id = 1;
  string directory = 2;
  repeated string args = 3;
}

message ScriptingHarnessBuildResponse {
  OperationOutcome outcome = 1;
  string path = 2;
}

message ScriptingHarnessRunScriptArgs {
  string id = 1;
  string script = 2;
}

message ScriptingHarnessTestArgs {
  string id = 1;
  string directory = 2;
  repeated ScriptingHarnessTestOptions options = 3;
}

message ScriptingHarnessTestOptions {
  string name = 1;
  repeated string args = 2;
  string pattern = 3;
  google.protobuf.Duration timeout = 4;
  int32 count = 5;
}

message ScriptingHarnessTestResult {
  string name = 1;
  google.protobuf.Timestamp start_at = 2;
  google.protobuf.Duration duration = 3;
  string outcome = 4;
}

message ScriptingHarnessTestResponse {
  OperationOutcome outcome = 1;
  repeated ScriptingHarnessTestResult results = 2;
}

message LoggingCacheCreateArgs {
  string id = 1;
  OutputOptions options = 2;
}

message LoggingCacheArgs {
  string id = 1;
}

message LoggingCacheInstance {
  OperationOutcome outcome = 1 ;
  string id = 2;
  string managerID = 3;
  google.protobuf.Timestamp accessed = 4;
}

message LoggingCacheSize {
  OperationOutcome outcome = 1 ;
  string id = 2;
  int64 size = 3;
}

enum LoggingPayloadFormat {
  FORMATUNKNONW = 0;
  FORMATBSON = 1;
  FORMATJSON = 2;
  FORMATSTRING = 3;
}

message LoggingPayloadData {
  oneof data {
    string msg = 1;
    bytes raw = 2;
  }
}

message LoggingPayload {
  string LoggerID = 1;
  int32 priority = 2;
  LoggingPayloadFormat format = 3;
  bool is_multi = 4;
  bool prefer_send_to_error = 5;
  bool add_metadata = 6;
  repeated LoggingPayloadData data = 7;
}

service JasperProcessManager {
  // Manager functions
  rpc ID(google.protobuf.Empty) returns (IDResponse);
  rpc Create(CreateOptions) returns (ProcessInfo);
  rpc List(Filter) returns (stream ProcessInfo);
  rpc Group(TagName) returns (stream ProcessInfo);
  rpc Get(JasperProcessID) returns (ProcessInfo);
  rpc Signal(SignalProcess) returns (OperationOutcome);
  rpc Clear(google.protobuf.Empty) returns (OperationOutcome);
  rpc Close(google.protobuf.Empty) returns (OperationOutcome);
  rpc WriteFile(stream WriteFileInfo) returns (OperationOutcome);

  // Process functions
  rpc TagProcess(ProcessTags) returns (OperationOutcome);
  rpc ResetTags(JasperProcessID) returns (OperationOutcome);
  rpc GetTags(JasperProcessID) returns (ProcessTags);
  rpc RegisterSignalTriggerID(SignalTriggerParams) returns (OperationOutcome);
  rpc Wait(JasperProcessID) returns (OperationOutcome);
  rpc Respawn(JasperProcessID) returns (ProcessInfo);

  // scripting.Harness functions
  rpc ScriptingHarnessSetup(ScriptingHarnessID) returns (OperationOutcome);
  rpc ScriptingHarnessCleanup(ScriptingHarnessID) returns (OperationOutcome);
  rpc ScriptingHarnessRun(ScriptingHarnessRunArgs) returns (OperationOutcome);
  rpc ScriptingHarnessBuild(ScriptingHarnessBuildArgs) returns (ScriptingHarnessBuildResponse);
  rpc ScriptingHarnessRunScript(ScriptingHarnessRunScriptArgs) returns (OperationOutcome);
  rpc ScriptingHarnessTest(ScriptingHarnessTestArgs) returns (ScriptingHarnessTestResponse);

  // LoggingCache functions
  rpc LoggingCacheCreate(LoggingCacheCreateArgs) returns (LoggingCacheInstance);
  rpc LoggingCacheGet(LoggingCacheArgs) returns (LoggingCacheInstance);
  rpc LoggingCacheRemove(LoggingCacheArgs) returns (OperationOutcome);
  rpc LoggingCacheCloseAndRemove(LoggingCacheArgs) returns (OperationOutcome);
  rpc LoggingCacheClear(google.protobuf.Empty) returns (OperationOutcome);
  rpc LoggingCacheLen(google.protobuf.Empty) returns (LoggingCacheSize);
  rpc LoggingCachePrune(google.protobuf.Timestamp) returns (OperationOutcome);

  // Remote specific functions
  rpc ScriptingHarnessCreate(ScriptingOptions) returns (ScriptingHarnessID);
  rpc ScriptingHarnessGet(ScriptingHarnessID) returns (OperationOutcome);
  rpc Status(google.protobuf.Empty) returns (StatusResponse);
  rpc ConfigureCache(CacheOptions) returns (OperationOutcome);
  rpc DownloadFile(DownloadInfo) returns (OperationOutcome);
  rpc DownloadMongoDB(MongoDBDownloadOptions) returns (OperationOutcome);
  rpc GetLogStream(LogRequest) returns (LogStream);
  rpc GetBuildloggerURLs(JasperProcessID) returns (BuildloggerURLs);
  rpc SignalEvent(EventName) returns (OperationOutcome);
  rpc SendMessages(LoggingPayload) returns (OperationOutcome);
}