-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
mesos.proto
2384 lines (2000 loc) · 78.6 KB
/
mesos.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
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package mesos;
option java_package = "org.apache.mesos";
option java_outer_classname = "Protos";
/**
* Status is used to indicate the state of the scheduler and executor
* driver after function calls.
*/
enum Status {
DRIVER_NOT_STARTED = 1;
DRIVER_RUNNING = 2;
DRIVER_ABORTED = 3;
DRIVER_STOPPED = 4;
}
/**
* A unique ID assigned to a framework. A framework can reuse this ID
* in order to do failover (see MesosSchedulerDriver).
*/
message FrameworkID {
required string value = 1;
}
/**
* A unique ID assigned to an offer.
*/
message OfferID {
required string value = 1;
}
/**
* A unique ID assigned to a slave. Currently, a slave gets a new ID
* whenever it (re)registers with Mesos. Framework writers shouldn't
* assume any binding between a slave ID and and a hostname.
*/
message SlaveID {
required string value = 1;
}
/**
* A framework-generated ID to distinguish a task. The ID must remain
* unique while the task is active. A framework can reuse an ID _only_
* if the previous task with the same ID has reached a terminal state
* (e.g., TASK_FINISHED, TASK_LOST, TASK_KILLED, etc.). However,
* reusing task IDs is strongly discouraged (MESOS-2198).
*/
message TaskID {
required string value = 1;
}
/**
* A framework-generated ID to distinguish an executor. Only one
* executor with the same ID can be active on the same slave at a
* time. However, reusing executor IDs is discouraged.
*/
message ExecutorID {
required string value = 1;
}
/**
* ID used to uniquely identify a container. If the `parent` is not
* specified, the ID is a UUID generated by the agent to uniquely
* identify the container of an executor run. If the `parent` field is
* specified, it represents a nested container.
*/
message ContainerID {
required string value = 1;
optional ContainerID parent = 2;
}
/**
* Represents time since the epoch, in nanoseconds.
*/
message TimeInfo {
required int64 nanoseconds = 1;
// TODO(josephw): Add time zone information, if necessary.
}
/**
* Represents duration in nanoseconds.
*/
message DurationInfo {
required int64 nanoseconds = 1;
}
/**
* A network address.
*
* TODO(bmahler): Use this more widely.
*/
message Address {
// May contain a hostname, IP address, or both.
optional string hostname = 1;
optional string ip = 2;
required int32 port = 3;
}
/**
* Represents a URL.
*/
message URL {
required string scheme = 1;
required Address address = 2;
optional string path = 3;
repeated Parameter query = 4;
optional string fragment = 5;
}
/**
* Represents an interval, from a given start time over a given duration.
* This interval pertains to an unavailability event, such as maintenance,
* and is not a generic interval.
*/
message Unavailability {
required TimeInfo start = 1;
// When added to `start`, this represents the end of the interval.
// If unspecified, the duration is assumed to be infinite.
optional DurationInfo duration = 2;
// TODO(josephw): Add additional fields for expressing the purpose and
// urgency of the unavailability event.
}
/**
* Represents a single machine, which may hold one or more slaves.
*
* NOTE: In order to match a slave to a machine, both the `hostname` and
* `ip` must match the values advertised by the slave to the master.
* Hostname is not case-sensitive.
*/
message MachineID {
optional string hostname = 1;
optional string ip = 2;
}
/**
* Holds information about a single machine, its `mode`, and any other
* relevant information which may affect the behavior of the machine.
*/
message MachineInfo {
// Describes the several states that a machine can be in. A `Mode`
// applies to a machine and to all associated slaves on the machine.
enum Mode {
// In this mode, a machine is behaving normally;
// offering resources, executing tasks, etc.
UP = 1;
// In this mode, all slaves on the machine are expected to cooperate with
// frameworks to drain resources. In general, draining is done ahead of
// a pending `unavailability`. The resources should be drained so as to
// maximize utilization prior to the maintenance but without knowingly
// violating the frameworks' requirements.
DRAINING = 2;
// In this mode, a machine is not running any tasks and will not offer
// any of its resources. Slaves on the machine will not be allowed to
// register with the master.
DOWN = 3;
}
required MachineID id = 1;
optional Mode mode = 2;
// Signifies that the machine may be unavailable during the given interval.
// See comments in `Unavailability` and for the `unavailability` fields
// in `Offer` and `InverseOffer` for more information.
optional Unavailability unavailability = 3;
}
/**
* Describes a framework.
*/
message FrameworkInfo {
// Used to determine the Unix user that an executor or task should be
// launched as.
//
// When using the MesosSchedulerDriver, if the field is set to an
// empty string, it will automagically set it to the current user.
//
// When using the HTTP Scheduler API, the user has to be set
// explicitly.
required string user = 1;
// Name of the framework that shows up in the Mesos Web UI.
required string name = 2;
// Note that 'id' is only available after a framework has
// registered, however, it is included here in order to facilitate
// scheduler failover (i.e., if it is set then the
// MesosSchedulerDriver expects the scheduler is performing
// failover).
optional FrameworkID id = 3;
// The amount of time (in seconds) that the master will wait for the
// scheduler to failover before it tears down the framework by
// killing all its tasks/executors. This should be non-zero if a
// framework expects to reconnect after a failure and not lose its
// tasks/executors.
//
// NOTE: To avoid accidental destruction of tasks, production
// frameworks typically set this to a large value (e.g., 1 week).
optional double failover_timeout = 4 [default = 0.0];
// If set, agents running tasks started by this framework will write
// the framework pid, executor pids and status updates to disk. If
// the agent exits (e.g., due to a crash or as part of upgrading
// Mesos), this checkpointed data allows the restarted agent to
// reconnect to executors that were started by the old instance of
// the agent. Enabling checkpointing improves fault tolerance, at
// the cost of a (usually small) increase in disk I/O.
optional bool checkpoint = 5 [default = false];
// Used to group frameworks for allocation decisions, depending on
// the allocation policy being used.
optional string role = 6 [default = "*"];
// Used to indicate the current host from which the scheduler is
// registered in the Mesos Web UI. If set to an empty string Mesos
// will automagically set it to the current hostname if one is
// available.
optional string hostname = 7;
// This field should match the credential's principal the framework
// uses for authentication. This field is used for framework API
// rate limiting and dynamic reservations. It should be set even
// if authentication is not enabled if these features are desired.
optional string principal = 8;
// This field allows a framework to advertise its web UI, so that
// the Mesos web UI can link to it. It is expected to be a full URL,
// for example http://my-scheduler.example.com:8080/.
optional string webui_url = 9;
message Capability {
enum Type {
// This must be the first enum value in this list, to
// ensure that if 'type' is not set, the default value
// is UNKNOWN. This enables enum values to be added
// in a backwards-compatible way. See: MESOS-4997.
UNKNOWN = 0;
// Receive offers with revocable resources. See 'Resource'
// message for details.
REVOCABLE_RESOURCES = 1;
// Receive the TASK_KILLING TaskState when a task is being
// killed by an executor. The executor will examine this
// capability to determine whether it can send TASK_KILLING.
TASK_KILLING_STATE = 2;
// Indicates whether the framework is aware of GPU resources.
// Frameworks that are aware of GPU resources are expected to
// avoid placing non-GPU workloads on GPU agents, in order
// to avoid occupying a GPU agent and preventing GPU workloads
// from running! Currently, if a framework is unaware of GPU
// resources, it will not be offered *any* of the resources on
// an agent with GPUs. This restriction is in place because we
// do not have a revocation mechanism that ensures GPU workloads
// can evict GPU agent occupants if necessary.
//
// TODO(bmahler): As we add revocation we can relax the
// restriction here. See MESOS-5634 for more information.
GPU_RESOURCES = 3;
// Receive offers with resources that are shared.
SHARED_RESOURCES = 4;
// Indicates that (1) the framework is prepared to handle the
// following TaskStates: TASK_UNREACHABLE, TASK_DROPPED,
// TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN, and (2)
// the framework will assume responsibility for managing
// partitioned tasks that reregister with the master.
//
// Frameworks that enable this capability can define how they
// would like to handle partitioned tasks. Frameworks will
// receive TASK_UNREACHABLE for tasks on agents that are
// partitioned from the master. If/when a partitioned agent
// reregisters, tasks on the agent that were started by
// PARTITION_AWARE frameworks will not killed.
//
// Without this capability, frameworks will receive TASK_LOST
// for tasks on partitioned agents; such tasks will be killed by
// Mesos when the agent reregisters (unless the master has
// failed over).
PARTITION_AWARE = 5;
}
// Enum fields should be optional, see: MESOS-4997.
optional Type type = 1;
}
// This field allows a framework to advertise its set of
// capabilities (e.g., ability to receive offers for revocable
// resources).
repeated Capability capabilities = 10;
// Labels are free-form key value pairs supplied by the framework
// scheduler (e.g., to describe additional functionality offered by
// the framework). These labels are not interpreted by Mesos itself.
// Labels should not contain duplicate key-value pairs.
optional Labels labels = 11;
}
/**
* Describes a health check for a task or executor (or any arbitrary
* process/command). A type is picked by specifying one of the
* optional fields. Specifying more than one type is an error.
*/
message HealthCheck {
enum Type {
UNKNOWN = 0;
COMMAND = 1;
HTTP = 2;
TCP = 3;
}
// Describes an HTTP health check. Sends a GET request to
// scheme://<host>:port/path. Note that <host> is not configurable and is
// resolved automatically, in most cases to 127.0.0.1. Default executors
// treat return codes between 200 and 399 as success; custom executors
// may employ a different strategy, e.g. leveraging the `statuses` field.
message HTTPCheckInfo {
// Currently "http" and "https" are supported.
optional string scheme = 3;
// Port to send the HTTP request.
required uint32 port = 1;
// HTTP request path.
optional string path = 2;
// TODO(alexr): Add support for HTTP method. While adding POST
// and PUT is simple, supporting payload is more involved.
// TODO(alexr): Add support for custom HTTP headers.
// TODO(alexr): Add support for success and possibly failure
// statuses.
// NOTE: It is up to the custom executor to interpret and act on this
// field. Setting this field has no effect on the default executors.
//
// TODO(haosdent): Deprecate this field when we add better support for
// success and possibly failure statuses, e.g. ranges of success and
// failure statuses.
repeated uint32 statuses = 4;
// TODO(haosdent): Consider adding a flag to enable task's certificate
// validation for HTTPS health checks, see MESOS-5997.
// TODO(benh): Include an 'optional bytes data' field for checking
// for specific data in the response.
}
// Describes a TCP health check, i.e. based on establishing
// a TCP connection to the specified port.
message TCPCheckInfo {
// Port expected to be open.
required uint32 port = 1;
}
// TODO(benh): Consider adding a URL health check strategy which
// allows doing something similar to the HTTP strategy but
// encapsulates all the details in a single string field.
// Amount of time to wait until starting the health checks.
optional double delay_seconds = 2 [default = 15.0];
// Interval between health checks.
optional double interval_seconds = 3 [default = 10.0];
// Amount of time to wait for the health check to complete.
optional double timeout_seconds = 4 [default = 20.0];
// Number of consecutive failures until signaling kill task.
optional uint32 consecutive_failures = 5 [default = 3];
// Amount of time to allow failed health checks since launch.
optional double grace_period_seconds = 6 [default = 10.0];
// TODO(alexr): Add an optional `KillPolicy` that should be used
// if the task is killed because of a health check failure.
// The type of health check.
optional Type type = 8;
// Command health check.
optional CommandInfo command = 7;
// HTTP health check.
optional HTTPCheckInfo http = 1;
// TCP health check.
optional TCPCheckInfo tcp = 9;
}
/**
* Describes a kill policy for a task. Currently does not express
* different policies (e.g. hitting HTTP endpoints), only controls
* how long to wait between graceful and forcible task kill:
*
* graceful kill --------------> forcible kill
* grace_period
*
* Kill policies are best-effort, because machine failures / forcible
* terminations may occur.
*
* NOTE: For executor-less command-based tasks, the kill is performed
* via sending a signal to the task process: SIGTERM for the graceful
* kill and SIGKILL for the forcible kill. For the docker executor-less
* tasks the grace period is passed to 'docker stop --time'.
*/
message KillPolicy {
// The grace period specifies how long to wait before forcibly
// killing the task. It is recommended to attempt to gracefully
// kill the task (and send TASK_KILLING) to indicate that the
// graceful kill is in progress. Once the grace period elapses,
// if the task has not terminated, a forcible kill should occur.
// The task should not assume that it will always be allotted
// the full grace period. For example, the executor may be
// shutdown more quickly by the agent, or failures / forcible
// terminations may occur.
optional DurationInfo grace_period = 1;
}
/**
* Describes a command, executed via: '/bin/sh -c value'. Any URIs specified
* are fetched before executing the command. If the executable field for an
* uri is set, executable file permission is set on the downloaded file.
* Otherwise, if the downloaded file has a recognized archive extension
* (currently [compressed] tar and zip) it is extracted into the executor's
* working directory. This extraction can be disabled by setting `extract` to
* false. In addition, any environment variables are set before executing
* the command (so they can be used to "parameterize" your command).
*/
message CommandInfo {
message URI {
required string value = 1;
optional bool executable = 2;
// In case the fetched file is recognized as an archive, extract
// its contents into the sandbox. Note that a cached archive is
// not copied from the cache to the sandbox in case extraction
// originates from an archive in the cache.
optional bool extract = 3 [default = true];
// If this field is "true", the fetcher cache will be used. If not,
// fetching bypasses the cache and downloads directly into the
// sandbox directory, no matter whether a suitable cache file is
// available or not. The former directs the fetcher to download to
// the file cache, then copy from there to the sandbox. Subsequent
// fetch attempts with the same URI will omit downloading and copy
// from the cache as long as the file is resident there. Cache files
// may get evicted at any time, which then leads to renewed
// downloading. See also "docs/fetcher.md" and
// "docs/fetcher-cache-internals.md".
optional bool cache = 4;
// The fetcher's default behavior is to use the URI string's basename to
// name the local copy. If this field is provided, the local copy will be
// named with its value instead. If there is a directory component (which
// must be a relative path), the local copy will be stored in that
// subdirectory inside the sandbox.
optional string output_file = 5;
}
repeated URI uris = 1;
optional Environment environment = 2;
// There are two ways to specify the command:
// 1) If 'shell == true', the command will be launched via shell
// (i.e., /bin/sh -c 'value'). The 'value' specified will be
// treated as the shell command. The 'arguments' will be ignored.
// 2) If 'shell == false', the command will be launched by passing
// arguments to an executable. The 'value' specified will be
// treated as the filename of the executable. The 'arguments'
// will be treated as the arguments to the executable. This is
// similar to how POSIX exec families launch processes (i.e.,
// execlp(value, arguments(0), arguments(1), ...)).
// NOTE: The field 'value' is changed from 'required' to 'optional'
// in 0.20.0. It will only cause issues if a new framework is
// connecting to an old master.
optional bool shell = 6 [default = true];
optional string value = 3;
repeated string arguments = 7;
// Enables executor and tasks to run as a specific user. If the user
// field is present both in FrameworkInfo and here, the CommandInfo
// user value takes precedence.
optional string user = 5;
}
/**
* Describes information about an executor.
*/
message ExecutorInfo {
enum Type {
UNKNOWN = 0;
// Mesos provides a simple built-in default executor that frameworks can
// leverage to run shell commands and containers.
//
// NOTES:
//
// 1) `command` must not be set when using a default executor.
//
// 2) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
// offer operation.
DEFAULT = 1;
// For frameworks that need custom functionality to run tasks, a `CUSTOM`
// executor can be used. Note that `command` must be set when using a
// `CUSTOM` executor.
CUSTOM = 2;
}
// For backwards compatibility, if this field is not set when using `LAUNCH`
// offer operation, Mesos will infer the type by checking if `command` is
// set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
// `LAUNCH_GROUP` offer operation.
//
// TODO(vinod): Add support for explicitly setting `type` to `DEFAULT `
// in `LAUNCH` offer operation.
optional Type type = 15;
required ExecutorID executor_id = 1;
optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
optional CommandInfo command = 7;
// Executor provided with a container will launch the container
// with the executor's CommandInfo and we expect the container to
// act as a Mesos executor.
optional ContainerInfo container = 11;
repeated Resource resources = 5;
optional string name = 9;
// 'source' is an identifier style string used by frameworks to
// track the source of an executor. This is useful when it's
// possible for different executor ids to be related semantically.
//
// NOTE: 'source' is exposed alongside the resource usage of the
// executor via JSON on the slave. This allows users to import usage
// information into a time series database for monitoring.
//
// This field is deprecated since 1.0. Please use labels for
// free-form metadata instead.
optional string source = 10 [deprecated = true]; // Since 1.0.
// This field can be used to pass arbitrary bytes to an executor.
optional bytes data = 4;
// Service discovery information for the executor. It is not
// interpreted or acted upon by Mesos. It is up to a service
// discovery system to use this information as needed and to handle
// executors without service discovery information.
optional DiscoveryInfo discovery = 12;
// When shutting down an executor the agent will wait in a
// best-effort manner for the grace period specified here
// before forcibly destroying the container. The executor
// must not assume that it will always be allotted the full
// grace period, as the agent may decide to allot a shorter
// period and failures / forcible terminations may occur.
optional DurationInfo shutdown_grace_period = 13;
// Labels are free-form key value pairs which are exposed through
// master and slave endpoints. Labels will not be interpreted or
// acted upon by Mesos itself. As opposed to the data field, labels
// will be kept in memory on master and slave processes. Therefore,
// labels should be used to tag executors with lightweight metadata.
// Labels should not contain duplicate key-value pairs.
optional Labels labels = 14;
}
/**
* Describes a master. This will probably have more fields in the
* future which might be used, for example, to link a framework webui
* to a master webui.
*/
message MasterInfo {
required string id = 1;
// The IP address (only IPv4) as a packed 4-bytes integer,
// stored in network order. Deprecated, use `address.ip` instead.
required uint32 ip = 2;
// The TCP port the Master is listening on for incoming
// HTTP requests; deprecated, use `address.port` instead.
required uint32 port = 3 [default = 5050];
// In the default implementation, this will contain information
// about both the IP address, port and Master name; it should really
// not be relied upon by external tooling/frameworks and be
// considered an "internal" implementation field.
optional string pid = 4;
// The server's hostname, if available; it may be unreliable
// in environments where the DNS configuration does not resolve
// internal hostnames (eg, some public cloud providers).
// Deprecated, use `address.hostname` instead.
optional string hostname = 5;
// The running Master version, as a string; taken from the
// generated "master/version.hpp".
optional string version = 6;
// The full IP address (supports both IPv4 and IPv6 formats)
// and supersedes the use of `ip`, `port` and `hostname`.
// Since Mesos 0.24.
optional Address address = 7;
}
/**
* Describes a slave. Note that the 'id' field is only available after
* a slave is registered with the master, and is made available here
* to facilitate re-registration.
*/
message SlaveInfo {
required string hostname = 1;
optional int32 port = 8 [default = 5051];
repeated Resource resources = 3;
repeated Attribute attributes = 5;
optional SlaveID id = 6;
// Slave checkpointing is always enabled in recent Mesos versions;
// the value of this field is ignored.
// TODO(joerg84): Remove checkpoint field after deprecation cycle starting
// with 0.27 (MESOS-2317).
optional bool checkpoint = 7 [default = false];
}
/**
* Describes an Attribute or Resource "value". A value is described
* using the standard protocol buffer "union" trick.
*/
message Value {
enum Type {
SCALAR = 0;
RANGES = 1;
SET = 2;
TEXT = 3;
}
message Scalar {
// Scalar values are represented using floating point. To reduce
// the chance of unpredictable floating point behavior due to
// roundoff error, Mesos only supports three decimal digits of
// precision for scalar resource values. That is, floating point
// values are converted to a fixed point format that supports
// three decimal digits of precision, and then converted back to
// floating point on output. Any additional precision in scalar
// resource values is discarded (via rounding).
required double value = 1;
}
message Range {
required uint64 begin = 1;
required uint64 end = 2;
}
message Ranges {
repeated Range range = 1;
}
message Set {
repeated string item = 1;
}
message Text {
required string value = 1;
}
required Type type = 1;
optional Scalar scalar = 2;
optional Ranges ranges = 3;
optional Set set = 4;
optional Text text = 5;
}
/**
* Describes an attribute that can be set on a machine. For now,
* attributes and resources share the same "value" type, but this may
* change in the future and attributes may only be string based.
*/
message Attribute {
required string name = 1;
required Value.Type type = 2;
optional Value.Scalar scalar = 3;
optional Value.Ranges ranges = 4;
optional Value.Set set = 6;
optional Value.Text text = 5;
}
/**
* Describes a resource on a machine. The `name` field is a string
* like "cpus" or "mem" that indicates which kind of resource this is;
* the rest of the fields describe the properties of the resource. A
* resource can take on one of three types: scalar (double), a list of
* finite and discrete ranges (e.g., [1-10, 20-30]), or a set of
* items. A resource is described using the standard protocol buffer
* "union" trick.
*
* Note that "disk" and "mem" resources are scalar values expressed in
* megabytes. Fractional "cpus" values are allowed (e.g., "0.5"),
* which correspond to partial shares of a CPU.
*/
message Resource {
required string name = 1;
required Value.Type type = 2;
optional Value.Scalar scalar = 3;
optional Value.Ranges ranges = 4;
optional Value.Set set = 5;
// The role that this resource is reserved for. If "*", this indicates
// that the resource is unreserved. Otherwise, the resource will only
// be offered to frameworks that belong to this role.
optional string role = 6 [default = "*"];
message ReservationInfo {
// Describes a dynamic reservation. A dynamic reservation is
// acquired by an operator via the '/reserve' HTTP endpoint or by
// a framework via the offer cycle by sending back an
// 'Offer::Operation::Reserve' message.
// NOTE: We currently do not allow frameworks with role "*" to
// make dynamic reservations.
// Indicates the principal, if any, of the framework or operator
// that reserved this resource. If reserved by a framework, the
// field should match the `FrameworkInfo.principal`. It is used in
// conjunction with the `UnreserveResources` ACL to determine
// whether the entity attempting to unreserve this resource is
// permitted to do so.
optional string principal = 1;
// Labels are free-form key value pairs that can be used to
// associate arbitrary metadata with a reserved resource. For
// example, frameworks can use labels to identify the intended
// purpose for a portion of the resources the framework has
// reserved at a given slave. Labels should not contain duplicate
// key-value pairs.
optional Labels labels = 2;
}
// If this is set, this resource was dynamically reserved by an
// operator or a framework. Otherwise, this resource is either unreserved
// or statically reserved by an operator via the --resources flag.
optional ReservationInfo reservation = 8;
message DiskInfo {
// Describes a persistent disk volume.
//
// A persistent disk volume will not be automatically garbage
// collected if the task/executor/slave terminates, but will be
// re-offered to the framework(s) belonging to the 'role'.
//
// NOTE: Currently, we do not allow persistent disk volumes
// without a reservation (i.e., 'role' cannot be '*').
message Persistence {
// A unique ID for the persistent disk volume. This ID must be
// unique per role on each slave. Although it is possible to use
// the same ID on different slaves in the cluster and to reuse
// IDs after a volume with that ID has been destroyed, both
// practices are discouraged.
required string id = 1;
// This field indicates the principal of the operator or
// framework that created this volume. It is used in conjunction
// with the "destroy" ACL to determine whether an entity
// attempting to destroy the volume is permitted to do so.
//
// NOTE: This field should match the FrameworkInfo.principal of
// the framework that created the volume.
optional string principal = 2;
}
optional Persistence persistence = 1;
// Describes how this disk resource will be mounted in the
// container. If not set, the disk resource will be used as the
// sandbox. Otherwise, it will be mounted according to the
// 'container_path' inside 'volume'. The 'host_path' inside
// 'volume' is ignored.
// NOTE: If 'volume' is set but 'persistence' is not set, the
// volume will be automatically garbage collected after
// task/executor terminates. Currently, if 'persistence' is set,
// 'volume' must be set.
optional Volume volume = 2;
// Describes where a disk originates from.
// TODO(jmlvanre): Add support for BLOCK devices.
message Source {
enum Type {
PATH = 1;
MOUNT = 2;
}
// A folder that can be located on a separate disk device. This
// can be shared and carved up as necessary between frameworks.
message Path {
// Path to the folder (e.g., /mnt/raid/disk0).
required string root = 1;
}
// A mounted file-system set up by the Agent administrator. This
// can only be used exclusively: a framework cannot accept a
// partial amount of this disk.
message Mount {
// Path to mount point (e.g., /mnt/raid/disk0).
required string root = 1;
}
required Type type = 1;
optional Path path = 2;
optional Mount mount = 3;
}
optional Source source = 3;
}
optional DiskInfo disk = 7;
message RevocableInfo {}
// If this is set, the resources are revocable, i.e., any tasks or
// executors launched using these resources could get preempted or
// throttled at any time. This could be used by frameworks to run
// best effort tasks that do not need strict uptime or performance
// guarantees. Note that if this is set, 'disk' or 'reservation'
// cannot be set.
optional RevocableInfo revocable = 9;
// Allow the resource to be shared across tasks.
message SharedInfo {}
// If this is set, the resources are shared, i.e. multiple tasks
// can be launched using this resource and all of them shall refer
// to the same physical resource on the cluster. Note that only
// persistent volumes can be shared currently.
optional SharedInfo shared = 10;
}
/**
* When the network bandwidth caps are enabled and the container
* is over its limit, outbound packets may be either delayed or
* dropped completely either because it exceeds the maximum bandwidth
* allocation for a single container (the cap) or because the combined
* network traffic of multiple containers on the host exceeds the
* transmit capacity of the host (the share). We can report the
* following statistics for each of these conditions exported directly
* from the Linux Traffic Control Queueing Discipline.
*
* id : name of the limiter, e.g. 'tx_bw_cap'
* backlog : number of packets currently delayed
* bytes : total bytes seen
* drops : number of packets dropped in total
* overlimits : number of packets which exceeded allocation
* packets : total packets seen
* qlen : number of packets currently queued
* rate_bps : throughput in bytes/sec
* rate_pps : throughput in packets/sec
* requeues : number of times a packet has been delayed due to
* locking or device contention issues
*
* More information on the operation of Linux Traffic Control can be
* found at http://www.lartc.org/lartc.html.
*/
message TrafficControlStatistics {
required string id = 1;
optional uint64 backlog = 2;
optional uint64 bytes = 3;
optional uint64 drops = 4;
optional uint64 overlimits = 5;
optional uint64 packets = 6;
optional uint64 qlen = 7;
optional uint64 ratebps = 8;
optional uint64 ratepps = 9;
optional uint64 requeues = 10;
}
message IpStatistics {
optional int64 Forwarding = 1;
optional int64 DefaultTTL = 2;
optional int64 InReceives = 3;
optional int64 InHdrErrors = 4;
optional int64 InAddrErrors = 5;
optional int64 ForwDatagrams = 6;
optional int64 InUnknownProtos = 7;
optional int64 InDiscards = 8;
optional int64 InDelivers = 9;
optional int64 OutRequests = 10;
optional int64 OutDiscards = 11;
optional int64 OutNoRoutes = 12;
optional int64 ReasmTimeout = 13;
optional int64 ReasmReqds = 14;
optional int64 ReasmOKs = 15;
optional int64 ReasmFails = 16;
optional int64 FragOKs = 17;
optional int64 FragFails = 18;
optional int64 FragCreates = 19;
}
message IcmpStatistics {
optional int64 InMsgs = 1;
optional int64 InErrors = 2;
optional int64 InCsumErrors = 3;
optional int64 InDestUnreachs = 4;
optional int64 InTimeExcds = 5;
optional int64 InParmProbs = 6;
optional int64 InSrcQuenchs = 7;
optional int64 InRedirects = 8;
optional int64 InEchos = 9;
optional int64 InEchoReps = 10;
optional int64 InTimestamps = 11;
optional int64 InTimestampReps = 12;
optional int64 InAddrMasks = 13;
optional int64 InAddrMaskReps = 14;
optional int64 OutMsgs = 15;
optional int64 OutErrors = 16;
optional int64 OutDestUnreachs = 17;
optional int64 OutTimeExcds = 18;
optional int64 OutParmProbs = 19;
optional int64 OutSrcQuenchs = 20;
optional int64 OutRedirects = 21;
optional int64 OutEchos = 22;
optional int64 OutEchoReps = 23;
optional int64 OutTimestamps = 24;
optional int64 OutTimestampReps = 25;
optional int64 OutAddrMasks = 26;
optional int64 OutAddrMaskReps = 27;
}
message TcpStatistics {
optional int64 RtoAlgorithm = 1;
optional int64 RtoMin = 2;
optional int64 RtoMax = 3;
optional int64 MaxConn = 4;
optional int64 ActiveOpens = 5;
optional int64 PassiveOpens = 6;
optional int64 AttemptFails = 7;
optional int64 EstabResets = 8;
optional int64 CurrEstab = 9;
optional int64 InSegs = 10;
optional int64 OutSegs = 11;
optional int64 RetransSegs = 12;
optional int64 InErrs = 13;
optional int64 OutRsts = 14;
optional int64 InCsumErrors = 15;
}
message UdpStatistics {