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
/// Message from client to server.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
    #[prost(oneof="request::RequestType", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16")]
    pub request_type: ::std::option::Option<request::RequestType>,
}
pub mod request {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum RequestType {
        #[prost(message, tag="1")]
        Preq(super::PingRequest),
        #[prost(message, tag="2")]
        Mareq(super::MakeAvailableRequest),
        #[prost(message, tag="3")]
        Rareq(super::RemoveAvailableRequest),
        #[prost(message, tag="4")]
        Lareq(super::ListAvailableRequest),
        #[prost(message, tag="5")]
        Sumreq(super::SetUpMachineRequest),
        #[prost(message, tag="6")]
        Svreq(super::SetVarRequest),
        #[prost(message, tag="7")]
        Lvreq(super::ListVarsRequest),
        #[prost(message, tag="8")]
        Ajreq(super::AddJobRequest),
        #[prost(message, tag="9")]
        Ljreq(super::ListJobsRequest),
        #[prost(message, tag="10")]
        Cjreq(super::CancelJobRequest),
        #[prost(message, tag="11")]
        Jsreq(super::JobStatusRequest),
        #[prost(message, tag="12")]
        Cljreq(super::CloneJobRequest),
        #[prost(message, tag="13")]
        Hjreq(super::HoldJobRequest),
        #[prost(message, tag="14")]
        Ujreq(super::UnholdJobRequest),
        #[prost(message, tag="15")]
        Amreq(super::AddMatrixRequest),
        #[prost(message, tag="16")]
        Smreq(super::StatMatrixRequest),
    }
}
/// Response to a `Request`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
    #[prost(oneof="response::ResponseType", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13")]
    pub response_type: ::std::option::Option<response::ResponseType>,
}
pub mod response {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ResponseType {
        #[prost(message, tag="1")]
        Okresp(super::OkResp),
        #[prost(message, tag="2")]
        Mresp(super::MachinesResp),
        #[prost(message, tag="3")]
        Jresp(super::JobsResp),
        #[prost(message, tag="4")]
        Vresp(super::VarsResp),
        #[prost(message, tag="5")]
        Jiresp(super::JobIdResp),
        #[prost(message, tag="6")]
        Miresp(super::MatrixIdResp),
        #[prost(message, tag="7")]
        Jsresp(super::JobStatusResp),
        #[prost(message, tag="8")]
        Msresp(super::MatrixStatusResp),
        #[prost(message, tag="9")]
        Nsmresp(super::NoSuchMachineResp),
        #[prost(message, tag="10")]
        Nsjresp(super::NoSuchJobResp),
        #[prost(message, tag="11")]
        Nsmatresp(super::NoSuchMatrixResp),
        #[prost(message, tag="12")]
        Nwresp(super::NotWaitingResp),
        #[prost(message, tag="13")]
        Ierr(super::InternalError),
    }
}
/// Used for debugging.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PingRequest {
}
/// Add the given machine to the list of available machines
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MakeAvailableRequest {
    /// The IP:PORT of the machine.
    #[prost(string, tag="1")]
    pub addr: std::string::String,
    /// The class of the machine.
    #[prost(string, tag="2")]
    pub class: std::string::String,
}
/// Remove the given machine from the list of available machines
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveAvailableRequest {
    /// The IP:PORT of the machine.
    #[prost(string, tag="1")]
    pub addr: std::string::String,
}
/// List the available machines known to the server.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAvailableRequest {
}
/// Set up a machine and optionally make it available in the given class.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetUpMachineRequest {
    /// The IP:PORT of the machine.
    #[prost(string, tag="1")]
    pub addr: std::string::String,
    /// The setup commands to execute in order.
    ///
    /// The commands may use any existing variables known to the server.
    #[prost(string, repeated, tag="3")]
    pub cmds: ::std::vec::Vec<std::string::String>,
    /// The number of minutes of the timeout, or 0 if no timeout (let the job
    /// run however long it does). The timeout is taken as the total duration of
    /// all commands in the task, not each individual command.
    #[prost(uint64, tag="5")]
    pub timeout: u64,
    /// The class of the machine.
    #[prost(oneof="set_up_machine_request::Classopt", tags="2")]
    pub classopt: ::std::option::Option<set_up_machine_request::Classopt>,
}
pub mod set_up_machine_request {
    /// The class of the machine.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Classopt {
        #[prost(string, tag="2")]
        Class(std::string::String),
    }
}
/// Set the value of a variable.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetVarRequest {
    #[prost(string, tag="1")]
    pub name: std::string::String,
    #[prost(string, tag="2")]
    pub value: std::string::String,
}
/// List all set variables and their values.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListVarsRequest {
}
/// Add a job to be run on the given class of machine.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddJobRequest {
    /// The class of machine allowed to run this job.
    #[prost(string, tag="1")]
    pub class: std::string::String,
    /// The command of the job.
    ///
    /// The command may use any existing variables known to the server.
    #[prost(string, tag="2")]
    pub cmd: std::string::String,
    /// Whether to repeat the task on failure.
    #[prost(bool, tag="4")]
    pub repeat_on_fail: bool,
    /// The number of minutes of the timeout, or 0 if no timeout (let the job
    /// run however long it does).
    #[prost(uint64, tag="5")]
    pub timeout: u64,
    /// The location to copy results, if any.
    #[prost(oneof="add_job_request::CpResultsopt", tags="3")]
    pub cp_resultsopt: ::std::option::Option<add_job_request::CpResultsopt>,
}
pub mod add_job_request {
    /// The location to copy results, if any.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum CpResultsopt {
        #[prost(string, tag="3")]
        CpResults(std::string::String),
    }
}
/// Get a list of job IDs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobsRequest {
}
/// Cancel a running or scheduled job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelJobRequest {
    /// The job ID of the job to cancel.
    #[prost(uint64, tag="1")]
    pub jid: u64,
    /// The job should be garbage collected and removed from the history.
    #[prost(bool, tag="2")]
    pub remove: bool,
}
/// Get information on the status of a job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobStatusRequest {
    /// The job ID of the job.
    #[prost(uint64, tag="1")]
    pub jid: u64,
}
/// Clone a running or scheduled job. That is, create a new job with the same properties as the
/// given job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloneJobRequest {
    /// The job ID of the job to cancel.
    #[prost(uint64, tag="1")]
    pub jid: u64,
}
/// Put a job on hold.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HoldJobRequest {
    /// The job ID of the job to hold.
    #[prost(uint64, tag="1")]
    pub jid: u64,
}
/// Unhold a job on hold.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnholdJobRequest {
    /// The job ID of the job to unhold.
    #[prost(uint64, tag="1")]
    pub jid: u64,
}
/// Start a matrix with the given variables and command template.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddMatrixRequest {
    /// The variables and their values, which we take the Cartesian Product over.
    #[prost(map="string, message", tag="1")]
    pub vars: ::std::collections::HashMap<std::string::String, MatrixVarValues>,
    /// The command of the job.
    ///
    /// The command may use any existing variables known to the server and variables from the
    /// set above.
    #[prost(string, tag="2")]
    pub cmd: std::string::String,
    /// The class of machine allowed to run this job.
    #[prost(string, tag="3")]
    pub class: std::string::String,
    /// The number of times to run each task.
    #[prost(uint64, tag="5")]
    pub repeat: u64,
    /// The number of minutes for a timeout, or 0 if none.
    #[prost(uint64, tag="6")]
    pub timeout: u64,
    /// The location to copy results, if any.
    #[prost(oneof="add_matrix_request::CpResultsopt", tags="4")]
    pub cp_resultsopt: ::std::option::Option<add_matrix_request::CpResultsopt>,
}
pub mod add_matrix_request {
    /// The location to copy results, if any.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum CpResultsopt {
        #[prost(string, tag="4")]
        CpResults(std::string::String),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatMatrixRequest {
    /// The ID of the matrix.
    #[prost(uint64, tag="1")]
    pub id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatrixVarValues {
    #[prost(string, repeated, tag="1")]
    pub values: ::std::vec::Vec<std::string::String>,
}
/// Succeeded. No return value.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OkResp {
}
/// Succeeded. A list of available machines and their classes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MachinesResp {
    /// DEPRECATED map<string, string> machines = 1;
    #[prost(map="string, message", tag="2")]
    pub machine_status: ::std::collections::HashMap<std::string::String, MachineStatus>,
}
/// The status of a single machine.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MachineStatus {
    #[prost(string, tag="1")]
    pub class: std::string::String,
    #[prost(bool, tag="2")]
    pub is_free: bool,
    /// If any... check `is_free` first.
    #[prost(uint64, tag="3")]
    pub running_job: u64,
}
/// A list of job IDs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobsResp {
    #[prost(uint64, repeated, tag="1")]
    pub jobs: ::std::vec::Vec<u64>,
    #[prost(message, repeated, tag="2")]
    pub matrices: ::std::vec::Vec<MatrixStatusResp>,
    #[prost(uint64, repeated, tag="3")]
    pub running: ::std::vec::Vec<u64>,
}
/// A list of variables and their values.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VarsResp {
    #[prost(map="string, string", tag="1")]
    pub vars: ::std::collections::HashMap<std::string::String, std::string::String>,
}
/// Succeeded. The job ID of a created job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobIdResp {
    #[prost(uint64, tag="1")]
    pub jid: u64,
}
/// Succeeded. The matrix ID of a created matrix.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatrixIdResp {
    #[prost(uint64, tag="1")]
    pub id: u64,
}
/// Succeeded. The status of a job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobStatusResp {
    #[prost(string, tag="1")]
    pub class: std::string::String,
    #[prost(string, tag="2")]
    pub cmd: std::string::String,
    #[prost(uint64, tag="3")]
    pub jid: u64,
    #[prost(message, optional, tag="4")]
    pub status: ::std::option::Option<Status>,
    #[prost(map="string, string", tag="5")]
    pub variables: ::std::collections::HashMap<std::string::String, std::string::String>,
    /// The path to the job log. This will be `/dev/null` if the job has not started yet.
    #[prost(string, tag="6")]
    pub log: std::string::String,
    /// The path to which results should be copied, or "" if none.
    #[prost(string, tag="9")]
    pub cp_results: std::string::String,
    #[prost(string, tag="7")]
    pub timestamp: std::string::String,
    #[prost(oneof="job_status_resp::Matrixidopt", tags="10")]
    pub matrixidopt: ::std::option::Option<job_status_resp::Matrixidopt>,
    #[prost(oneof="job_status_resp::Donetsop", tags="8")]
    pub donetsop: ::std::option::Option<job_status_resp::Donetsop>,
}
pub mod job_status_resp {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Matrixidopt {
        #[prost(uint64, tag="10")]
        Matrix(u64),
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Donetsop {
        #[prost(string, tag="8")]
        DoneTimestamp(std::string::String),
    }
}
/// Succeeded. The status of a matrix.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatrixStatusResp {
    /// The command template.
    #[prost(string, tag="1")]
    pub cmd: std::string::String,
    /// The class of machine allowed to run this job.
    #[prost(string, tag="2")]
    pub class: std::string::String,
    /// The matrix ID
    #[prost(uint64, tag="4")]
    pub id: u64,
    /// The job IDs that comprise the matrix.
    #[prost(uint64, repeated, tag="5")]
    pub jobs: ::std::vec::Vec<u64>,
    /// The variables in the matrix
    #[prost(map="string, message", tag="6")]
    pub variables: ::std::collections::HashMap<std::string::String, MatrixVarValues>,
    /// The location to copy results, if any.
    #[prost(oneof="matrix_status_resp::CpResultsopt", tags="3")]
    pub cp_resultsopt: ::std::option::Option<matrix_status_resp::CpResultsopt>,
}
pub mod matrix_status_resp {
    /// The location to copy results, if any.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum CpResultsopt {
        #[prost(string, tag="3")]
        CpResults(std::string::String),
    }
}
/// Error. The requested machine does not exist.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoSuchMachineResp {
}
/// Error. No such job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoSuchJobResp {
}
/// Error. No such matrix.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoSuchMatrixResp {
}
/// Error. The job we tried to hold is not waiting (i.e. already running or done) or the job we
/// tried to unhold was not held.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotWaitingResp {
}
/// Error. The server has an internal error.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InternalError {
}
/// The status of a job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Status {
    #[prost(enumeration="status::Status", tag="1")]
    pub status: i32,
    /// The machine this job was scheduled on.
    ///
    /// Required for:
    /// - Running
    /// - CopyResults
    /// - Done
    /// - Failed (if possible)
    /// - Unknown (if possible)
    #[prost(oneof="status::Machineopt", tags="2")]
    pub machineopt: ::std::option::Option<status::Machineopt>,
    /// The name of the output files, if any.
    ///
    /// Required for `Done` (if possible)
    #[prost(oneof="status::Outputopt", tags="3")]
    pub outputopt: ::std::option::Option<status::Outputopt>,
    /// The error that caused the failure.
    ///
    /// Required for `Failed`
    #[prost(oneof="status::Erroropt", tags="4")]
    pub erroropt: ::std::option::Option<status::Erroropt>,
}
pub mod status {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Status {
        /// The job is an unknown state (usually due to the server being killed and restarted).
        Unknown = 0,
        /// The job is waiting to run.
        Waiting = 1,
        /// The job is currently running.
        Running = 2,
        /// Copying results after the finished running successfully.
        Copyresults = 3,
        /// The job finished runnning.
        Done = 4,
        /// Held.
        Held = 5,
        /// The job was canceled.
        Canceled = 6,
        /// The job produced an error.
        Failed = 7,
    }
    /// The machine this job was scheduled on.
    ///
    /// Required for:
    /// - Running
    /// - CopyResults
    /// - Done
    /// - Failed (if possible)
    /// - Unknown (if possible)
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Machineopt {
        #[prost(string, tag="2")]
        Machine(std::string::String),
    }
    /// The name of the output files, if any.
    ///
    /// Required for `Done` (if possible)
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Outputopt {
        #[prost(string, tag="3")]
        Output(std::string::String),
    }
    /// The error that caused the failure.
    ///
    /// Required for `Failed`
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Erroropt {
        #[prost(string, tag="4")]
        Error(std::string::String),
    }
}