/
mesos.proto
3552 lines (3000 loc) · 123 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.
syntax = "proto2";
package mesos;
option cc_enable_arenas = true;
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_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;
}
/**
* A unique ID assigned to a resource provider. Currently, a resource
* provider gets a new ID whenever it (re)registers with Mesos.
*/
message ResourceProviderID {
required string value = 1;
}
/**
* A framework-generated ID to distinguish an operation. The ID
* must be unique within the framework.
*/
message OperationID {
required string value = 1;
}
/**
* Represents time since the epoch, in nanoseconds.
*/
message TimeInfo {
required int64 nanoseconds = 1;
}
/**
* 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];
// Roles are the entities to which allocations are made.
// The framework must have at least one role in order to
// be offered resources. Note that `role` is deprecated
// in favor of `roles` and only one of these fields must
// be used. Since we cannot distinguish between empty
// `roles` and the default unset `role`, we require that
// frameworks set the `MULTI_ROLE` capability if
// setting the `roles` field.
optional string role = 6 [default = "*", deprecated=true];
repeated string roles = 12;
// 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.
//
// Without this capability, frameworks will receive TASK_LOST
// for tasks on partitioned agents.
// NOTE: Prior to Mesos 1.5, such tasks will be killed by Mesos
// when the agent reregisters (unless the master has failed over).
// However due to the lack of benefit in maintaining different
// behaviors depending on whether the master has failed over
// (see MESOS-7215), as of 1.5, Mesos will not kill these
// tasks in either case.
PARTITION_AWARE = 5;
// This expresses the ability for the framework to be
// "multi-tenant" via using the newly introduced `roles`
// field, and examining `Offer.allocation_info` to determine
// which role the offers are being made to. We also
// expect that "single-tenant" schedulers eventually
// provide this and move away from the deprecated
// `role` field.
MULTI_ROLE = 6;
// This capability has two effects for a framework.
//
// (1) The framework is offered resources in a new format.
//
// The offered resources have the `Resource.reservations` field set
// rather than `Resource.role` and `Resource.reservation`. In short,
// an empty `reservations` field denotes unreserved resources, and
// each `ReservationInfo` in the `reservations` field denotes a
// reservation that refines the previous one.
//
// See the 'Resource Format' section for more details.
//
// (2) The framework can create refined reservations.
//
// A framework can refine an existing reservation via the
// `Resource.reservations` field. For example, a reservation for role
// `eng` can be refined to `eng/front_end`.
//
// See `ReservationInfo.reservations` for more details.
//
// NOTE: Without this capability, a framework is not offered resources
// that have refined reservations. A resource is said to have refined
// reservations if it uses the `Resource.reservations` field, and
// `Resource.reservations_size() > 1`.
RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
// Indicates that the framework is prepared to receive offers
// for agents whose region is different from the master's
// region. Network links between hosts in different regions
// typically have higher latency and lower bandwidth than
// network links within a region, so frameworks should be
// careful to only place suitable workloads in remote regions.
// Frameworks that are not region-aware will never receive
// offers for remote agents; region-aware frameworks are assumed
// to implement their own logic to decide which workloads (if
// any) are suitable for placement on remote agents.
REGION_AWARE = 8;
}
// 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 general non-interpreting non-killing 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.
*
* NOTE: This API is subject to change and the related feature is experimental.
*/
message CheckInfo {
enum Type {
UNKNOWN = 0;
COMMAND = 1;
HTTP = 2;
TCP = 3;
// TODO(alexr): Consider supporting custom user checks. They should
// probably be paired with a `data` field and complemented by a
// `data` response in `CheckStatusInfo`.
}
// Describes a command check. If applicable, enters mount and/or network
// namespaces of the task.
message Command {
required CommandInfo command = 1;
}
// Describes an HTTP check. Sends a GET request to
// http://<host>:port/path. Note that <host> is not configurable and is
// resolved automatically to 127.0.0.1.
message Http {
// 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): Consider adding an optional message to describe TLS
// options and thus enabling https. Such message might contain certificate
// validation, TLS version.
}
// Describes a TCP check, i.e. based on establishing a TCP connection to
// the specified port. Note that <host> is not configurable and is resolved
// automatically to 127.0.0.1.
message Tcp {
required uint32 port = 1;
}
// The type of the check.
optional Type type = 1;
// Command check.
optional Command command = 2;
// HTTP check.
optional Http http = 3;
// TCP check.
optional Tcp tcp = 7;
// Amount of time to wait to start checking the task after it
// transitions to `TASK_RUNNING` or `TASK_STARTING` if the latter
// is used by the executor.
optional double delay_seconds = 4 [default = 15.0];
// Interval between check attempts, i.e., amount of time to wait after
// the previous check finished or timed out to start the next check.
optional double interval_seconds = 5 [default = 10.0];
// Amount of time to wait for the check to complete. Zero means infinite
// timeout.
//
// After this timeout, the check attempt is aborted and no result is
// reported. Note that this may be considered a state change and hence
// may trigger a check status change delivery to the corresponding
// scheduler. See `CheckStatusInfo` for more details.
optional double timeout_seconds = 6 [default = 20.0];
}
/**
* 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 {
optional NetworkInfo.Protocol protocol = 5 [default = IPv4];
// 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 {
optional NetworkInfo.Protocol protocol = 2 [default = IPv4];
// 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 to start health checking the task after it
// transitions to `TASK_RUNNING` or `TASK_STATING` if the latter is
// used by the executor.
optional double delay_seconds = 2 [default = 15.0];
// Interval between health checks, i.e., amount of time to wait after
// the previous health check finished or timed out to start the next
// health check.
optional double interval_seconds = 3 [default = 10.0];
// Amount of time to wait for the health check to complete. After this
// timeout, the health check is aborted and treated as a failure. Zero
// means infinite timeout.
optional double timeout_seconds = 4 [default = 20.0];
// Number of consecutive failures until the task is killed by the executor.
optional uint32 consecutive_failures = 5 [default = 3];
// Amount of time after the task is launched during which health check
// failures are ignored. Once a check succeeds for the first time,
// the grace period does not apply anymore. Note that it includes
// `delay_seconds`, i.e., setting `grace_period_seconds` < `delay_seconds`
// has no effect.
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`
// operation.
//
// 3) If `container` is set, `container.type` must be `MESOS`
// and `container.mesos.image` must not be set.
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`
// operation, Mesos will infer the type by checking if `command` is set
// (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
// `LAUNCH_GROUP` operation.
//
// TODO(vinod): Add support for explicitly setting `type` to `DEFAULT` in
// `LAUNCH` 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 domain. A domain is a collection of hosts that have
* similar characteristics. Mesos currently only supports "fault
* domains", which identify groups of hosts with similar failure
* characteristics.
*
* Frameworks can generally assume that network links between hosts in
* the same fault domain have lower latency, higher bandwidth, and better
* availability than network links between hosts in different domains.
* Schedulers may prefer to place network-intensive workloads in the
* same domain, as this may improve performance. Conversely, a single
* failure that affects a host in a domain may be more likely to
* affect other hosts in the same domain; hence, schedulers may prefer
* to place workloads that require high availability in multiple
* domains. (For example, all the hosts in a single rack might lose
* power or network connectivity simultaneously.)
*
* There are two kinds of fault domains: regions and zones. Regions
* offer the highest degree of fault isolation, but network latency
* between regions is typically high (typically >50 ms). Zones offer a
* modest degree of fault isolation along with reasonably low network
* latency (typically <10 ms).
*
* The mapping from fault domains to physical infrastructure is up to
* the operator to configure. In cloud environments, regions and zones
* can be mapped to the "region" and "availability zone" concepts
* exposed by most cloud providers, respectively. In on-premise
* deployments, regions and zones can be mapped to data centers and
* racks, respectively.
*
* Both masters and agents can be configured with domains. Frameworks
* can compare the domains of two hosts to determine if the hosts are
* in the same zone, in different zones in the same region, or in
* different regions. Note that all masters in a given Mesos cluster
* must be in the same region.
*/
message DomainInfo {
message FaultDomain {
message RegionInfo {
required string name = 1;
}
message ZoneInfo {
required string name = 1;
}
required RegionInfo region = 1;
required ZoneInfo zone = 2;
}
optional FaultDomain fault_domain = 1;
}
/**
* 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;
// The domain that this master belongs to. All masters in a Mesos
// cluster should belong to the same region.
optional DomainInfo domain = 8;
message Capability {
enum Type {
UNKNOWN = 0;
// The master can handle slaves whose state
// changes after reregistering.
AGENT_UPDATE = 1;
}
optional Type type = 1;
}
repeated Capability capabilities = 9;
}
/**
* 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];
// The configured resources at the agent. This does not include any
// dynamic reservations or persistent volumes that may currently
// exist at the agent.
repeated Resource resources = 3;
repeated Attribute attributes = 5;
optional SlaveID id = 6;
// The domain that this slave belongs to. If the slave's region
// differs from the master's region, it will not appear in resource
// offers to frameworks that have not enabled the REGION_AWARE
// capability.
optional DomainInfo domain = 10;
// 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];
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;
// This expresses the ability for the agent to be able
// to launch tasks of a 'multi-role' framework.
MULTI_ROLE = 1;
// This expresses the ability for the agent to be able to launch
// tasks, reserve resources, and create volumes using resources
// allocated to a 'hierarchical-role'.
// NOTE: This capability is required specifically for creating
// volumes because a hierchical role includes '/' (slashes) in them.
// Agents with this capability know to transform the '/' (slashes)
// into ' ' (spaces).
HIERARCHICAL_ROLE = 2;
// This capability has three effects for an agent.
//
// (1) The format of the checkpointed resources, and
// the resources reported to master.
//
// These resources are reported in the "pre-reservation-refinement"
// format if none of the resources have refined reservations. If any
// of the resources have refined reservations, they are reported in
// the "post-reservation-refinement" format. The purpose is to allow
// downgrading of an agent as well as communication with a pre-1.4.0
// master until the reservation refinement feature is actually used.
//
// See the 'Resource Format' section for more details.
//
// (2) The format of the resources reported by the HTTP endpoints.
//
// For resources reported by agent endpoints, the
// "pre-reservation-refinement" format is "injected" if possible.
// That is, resources without refined reservations will have the
// `Resource.role` and `Resource.reservation` set, whereas
// resources with refined reservations will not.
//
// See the 'Resource Format' section for more details.
//
// (3) The ability for the agent to launch tasks, reserve resources, and
// create volumes using resources that have refined reservations.
//
// See `ReservationInfo.reservations` section for more details.
//
// NOTE: Resources are said to have refined reservations if it uses the
// `Resource.reservations` field, and `Resource.reservations_size() > 1`.
RESERVATION_REFINEMENT = 3;
// This expresses the ability for the agent to handle resource
// provider related operations. This includes the following:
//
// (1) The ability to report resources that are provided by some
// local resource providers through the resource provider API.
//
// (2) The ability to provide operation feedback.
RESOURCE_PROVIDER = 4;
// This expresses the capability for the agent to handle persistent volume
// resize operations safely. This capability is turned on by default.
RESIZE_VOLUME = 5;
}