Debian Codegraph @

api/v0/mesosproto/mesos.proto

raw
1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package mesosproto;
20
21 import "github.com/gogo/protobuf/gogoproto/gogo.proto";
22
23 option (gogoproto.gostring_all) = true;
24 option (gogoproto.equal_all) = true;
25 option (gogoproto.verbose_equal_all) = true;
26 option (gogoproto.goproto_stringer_all) = false;
27 option (gogoproto.stringer_all) = true;
28 option (gogoproto.populate_all) = true;
29 option (gogoproto.testgen_all) = true;
30 option (gogoproto.benchgen_all) = true;
31 option (gogoproto.marshaler_all) = true;
32 option (gogoproto.sizer_all) = true;
33 option (gogoproto.unmarshaler_all) = true;
34
35 /**
36 * Status is used to indicate the state of the scheduler and executor
37 * driver after function calls.
38 */
39 enum Status {
40 DRIVER_NOT_STARTED = 1;
41 DRIVER_RUNNING = 2;
42 DRIVER_ABORTED = 3;
43 DRIVER_STOPPED = 4;
44 }
45
46
47 /**
48 * A unique ID assigned to a framework. A framework can reuse this ID
49 * in order to do failover (see MesosSchedulerDriver).
50 */
51 message FrameworkID {
52 required string value = 1;
53 }
54
55
56 /**
57 * A unique ID assigned to an offer.
58 */
59 message OfferID {
60 required string value = 1;
61 }
62
63
64 /**
65 * A unique ID assigned to a slave. Currently, a slave gets a new ID
66 * whenever it (re)registers with Mesos. Framework writers shouldn't
67 * assume any binding between a slave ID and and a hostname.
68 */
69 message SlaveID {
70 required string value = 1;
71 }
72
73
74 /**
75 * A framework generated ID to distinguish a task. The ID must remain
76 * unique while the task is active. However, a framework can reuse an
77 * ID _only_ if a previous task with the same ID has reached a
78 * terminal state (e.g., TASK_FINISHED, TASK_LOST, TASK_KILLED, etc.).
79 */
80 message TaskID {
81 required string value = 1;
82 }
83
84
85 /**
86 * A framework generated ID to distinguish an executor. Only one
87 * executor with the same ID can be active on the same slave at a
88 * time.
89 */
90 message ExecutorID {
91 required string value = 1;
92 }
93
94
95 /**
96 * A slave generated ID to distinguish a container. The ID must be unique
97 * between any active or completed containers on the slave. In particular,
98 * containers for different runs of the same (framework, executor) pair must be
99 * unique.
100 */
101 message ContainerID {
102 required string value = 1;
103 }
104
105
106 /**
107 * Represents time since the epoch, in nanoseconds.
108 */
109 message TimeInfo {
110 required int64 nanoseconds = 1;
111
112 // TODO(josephw): Add time zone information, if necessary.
113 }
114
115
116 /**
117 * Represents duration in nanoseconds.
118 */
119 message DurationInfo {
120 required int64 nanoseconds = 1;
121 }
122
123
124 /**
125 * A network address.
126 *
127 * TODO(bmahler): Use this more widely.
128 */
129 message Address {
130 // May contain a hostname, IP address, or both.
131 optional string hostname = 1;
132 optional string ip = 2;
133
134 required int32 port = 3;
135 }
136
137
138 /**
139 * Represents a URL.
140 */
141 message URL {
142 required string scheme = 1;
143 required Address address = 2;
144 optional string path = 3;
145 repeated Parameter query = 4;
146 optional string fragment = 5;
147 }
148
149
150 /**
151 * Represents an interval, from a given start time over a given duration.
152 * This interval pertains to an unavailability event, such as maintenance,
153 * and is not a generic interval.
154 */
155 message Unavailability {
156 required TimeInfo start = 1;
157
158 // When added to `start`, this represents the end of the interval.
159 // If unspecified, the duration is assumed to be infinite.
160 optional DurationInfo duration = 2;
161
162 // TODO(josephw): Add additional fields for expressing the purpose and
163 // urgency of the unavailability event.
164 }
165
166
167 /**
168 * Represents a single machine, which may hold one or more slaves.
169 *
170 * NOTE: In order to match a slave to a machine, both the `hostname` and
171 * `ip` must match the values advertised by the slave to the master.
172 * Hostname is not case-sensitive.
173 */
174 message MachineID {
175 optional string hostname = 1;
176 optional string ip = 2;
177 }
178
179
180 /**
181 * Holds information about a single machine, its `mode`, and any other
182 * relevant information which may affect the behavior of the machine.
183 */
184 message MachineInfo {
185 // Describes the several states that a machine can be in. A `Mode`
186 // applies to a machine and to all associated slaves on the machine.
187 enum Mode {
188 // In this mode, a machine is behaving normally;
189 // offering resources, executing tasks, etc.
190 UP = 1;
191
192 // In this mode, all slaves on the machine are expected to cooperate with
193 // frameworks to drain resources. In general, draining is done ahead of
194 // a pending `unavailability`. The resources should be drained so as to
195 // maximize utilization prior to the maintenance but without knowingly
196 // violating the frameworks' requirements.
197 DRAINING = 2;
198
199 // In this mode, a machine is not running any tasks and will not offer
200 // any of its resources. Slaves on the machine will not be allowed to
201 // register with the master.
202 DOWN = 3;
203 }
204
205 required MachineID id = 1;
206 optional Mode mode = 2;
207
208 // Signifies that the machine may be unavailable during the given interval.
209 // See comments in `Unavailability` and for the `unavailability` fields
210 // in `Offer` and `InverseOffer` for more information.
211 optional Unavailability unavailability = 3;
212 }
213
214
215 /**
216 * Describes a framework.
217 */
218 message FrameworkInfo {
219 // Used to determine the Unix user that an executor or task should
220 // be launched as. If the user field is set to an empty string Mesos
221 // will automagically set it to the current user.
222 required string user = 1;
223
224 // Name of the framework that shows up in the Mesos Web UI.
225 required string name = 2;
226
227 // Note that 'id' is only available after a framework has
228 // registered, however, it is included here in order to facilitate
229 // scheduler failover (i.e., if it is set then the
230 // MesosSchedulerDriver expects the scheduler is performing
231 // failover).
232 optional FrameworkID id = 3;
233
234 // The amount of time that the master will wait for the scheduler to
235 // failover before it tears down the framework by killing all its
236 // tasks/executors. This should be non-zero if a framework expects
237 // to reconnect after a failover and not lose its tasks/executors.
238 optional double failover_timeout = 4 [default = 0.0];
239
240 // If set, framework pid, executor pids and status updates are
241 // checkpointed to disk by the slaves. Checkpointing allows a
242 // restarted slave to reconnect with old executors and recover
243 // status updates, at the cost of disk I/O.
244 optional bool checkpoint = 5 [default = false];
245
246 // Used to group frameworks for allocation decisions, depending on
247 // the allocation policy being used.
248 optional string role = 6 [default = "*"];
249
250 // Used to indicate the current host from which the scheduler is
251 // registered in the Mesos Web UI. If set to an empty string Mesos
252 // will automagically set it to the current hostname if one is
253 // available.
254 optional string hostname = 7;
255
256 // This field should match the credential's principal the framework
257 // uses for authentication. This field is used for framework API
258 // rate limiting and dynamic reservations. It should be set even
259 // if authentication is not enabled if these features are desired.
260 optional string principal = 8;
261
262 // This field allows a framework to advertise its web UI, so that
263 // the Mesos web UI can link to it. It is expected to be a full URL,
264 // for example http://my-scheduler.example.com:8080/.
265 optional string webui_url = 9;
266
267 message Capability {
268 enum Type {
269 // Receive offers with revocable resources. See 'Resource'
270 // message for details.
271 // TODO(vinod): This is currently a no-op.
272 REVOCABLE_RESOURCES = 1;
273 }
274
275 required Type type = 1;
276 }
277
278 // This field allows a framework to advertise its set of
279 // capabilities (e.g., ability to receive offers for revocable
280 // resources).
281 repeated Capability capabilities = 10;
282
283 // Labels are free-form key value pairs supplied by the framework
284 // scheduler (e.g., to describe additional functionality offered by
285 // the framework). These labels are not interpreted by Mesos itself.
286 optional Labels labels = 11;
287 }
288
289
290 /**
291 * Describes a health check for a task or executor (or any arbitrary
292 * process/command). A "strategy" is picked by specifying one of the
293 * optional fields; currently only 'command' is supported.
294 * Specifying more than one strategy is an error.
295 */
296 message HealthCheck {
297 // Describes an HTTP health check. This is not fully implemented and not
298 // recommended for use - see MESOS-2533.
299 message HTTP {
300 // Port to send the HTTP request.
301 required uint32 port = 1;
302
303 // HTTP request path.
304 optional string path = 2 [default = "/"];
305
306 // TODO(benh): Implement:
307 // Whether or not to use HTTPS.
308 // optional bool ssl = 3 [default = false];
309
310 // Expected response statuses. Not specifying any statuses implies
311 // that any returned status is acceptable.
312 repeated uint32 statuses = 4;
313
314 // TODO(benh): Include an 'optional bytes data' field for checking
315 // for specific data in the response.
316 }
317
318 // HTTP health check - not yet recommended for use, see MESOS-2533.
319 optional HTTP http = 1;
320
321 // TODO(benh): Consider adding a URL health check strategy which
322 // allows doing something similar to the HTTP strategy but
323 // encapsulates all the details in a single string field.
324
325 // TODO(benh): Other possible health check strategies could include
326 // one for TCP/UDP.
327
328 // Amount of time to wait until starting the health checks.
329 optional double delay_seconds = 2 [default = 15.0];
330
331 // Interval between health checks.
332 optional double interval_seconds = 3 [default = 10.0];
333
334 // Amount of time to wait for the health check to complete.
335 optional double timeout_seconds = 4 [default = 20.0];
336
337 // Number of consecutive failures until considered unhealthy.
338 optional uint32 consecutive_failures = 5 [default = 3];
339
340 // Amount of time to allow failed health checks since launch.
341 optional double grace_period_seconds = 6 [default = 10.0];
342
343 // Command health check.
344 optional CommandInfo command = 7;
345 }
346
347
348 /**
349 * Describes a command, executed via: '/bin/sh -c value'. Any URIs specified
350 * are fetched before executing the command. If the executable field for an
351 * uri is set, executable file permission is set on the downloaded file.
352 * Otherwise, if the downloaded file has a recognized archive extension
353 * (currently [compressed] tar and zip) it is extracted into the executor's
354 * working directory. This extraction can be disabled by setting `extract` to
355 * false. In addition, any environment variables are set before executing
356 * the command (so they can be used to "parameterize" your command).
357 */
358 message CommandInfo {
359 message URI {
360 required string value = 1;
361 optional bool executable = 2;
362
363 // In case the fetched file is recognized as an archive, extract
364 // its contents into the sandbox. Note that a cached archive is
365 // not copied from the cache to the sandbox in case extraction
366 // originates from an archive in the cache.
367 optional bool extract = 3 [default = true];
368
369 // If this field is "true", the fetcher cache will be used. If not,
370 // fetching bypasses the cache and downloads directly into the
371 // sandbox directory, no matter whether a suitable cache file is
372 // available or not. The former directs the fetcher to download to
373 // the file cache, then copy from there to the sandbox. Subsequent
374 // fetch attempts with the same URI will omit downloading and copy
375 // from the cache as long as the file is resident there. Cache files
376 // may get evicted at any time, which then leads to renewed
377 // downloading. See also "docs/fetcher.md" and
378 // "docs/fetcher-cache-internals.md".
379 optional bool cache = 4;
380 }
381
382 // Describes a container.
383 // Not all containerizers currently implement ContainerInfo, so it
384 // is possible that a launched task will fail due to supplying this
385 // attribute.
386 // NOTE: The containerizer API is currently in an early beta or
387 // even alpha state. Some details, like the exact semantics of an
388 // "image" or "options" are not yet hardened.
389 // TODO(tillt): Describe the exact scheme and semantics of "image"
390 // and "options".
391 message ContainerInfo {
392 // URI describing the container image name.
393 required string image = 1;
394
395 // Describes additional options passed to the containerizer.
396 repeated string options = 2;
397 }
398
399 // NOTE: MesosContainerizer does currently not support this
400 // attribute and tasks supplying a 'container' will fail.
401 optional ContainerInfo container = 4;
402
403 repeated URI uris = 1;
404
405 optional Environment environment = 2;
406
407 // There are two ways to specify the command:
408 // 1) If 'shell == true', the command will be launched via shell
409 // (i.e., /bin/sh -c 'value'). The 'value' specified will be
410 // treated as the shell command. The 'arguments' will be ignored.
411 // 2) If 'shell == false', the command will be launched by passing
412 // arguments to an executable. The 'value' specified will be
413 // treated as the filename of the executable. The 'arguments'
414 // will be treated as the arguments to the executable. This is
415 // similar to how POSIX exec families launch processes (i.e.,
416 // execlp(value, arguments(0), arguments(1), ...)).
417 // NOTE: The field 'value' is changed from 'required' to 'optional'
418 // in 0.20.0. It will only cause issues if a new framework is
419 // connecting to an old master.
420 optional bool shell = 6 [default = true];
421 optional string value = 3;
422 repeated string arguments = 7;
423
424 // Enables executor and tasks to run as a specific user. If the user
425 // field is present both in FrameworkInfo and here, the CommandInfo
426 // user value takes precedence.
427 optional string user = 5;
428 }
429
430
431 /**
432 * Describes information about an executor. The 'data' field can be
433 * used to pass arbitrary bytes to an executor.
434 */
435 message ExecutorInfo {
436 required ExecutorID executor_id = 1;
437 optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
438 required CommandInfo command = 7;
439 // Executor provided with a container will launch the container
440 // with the executor's CommandInfo and we expect the container to
441 // act as a Mesos executor.
442 optional ContainerInfo container = 11;
443 repeated Resource resources = 5;
444 optional string name = 9;
445
446 // Source is an identifier style string used by frameworks to track
447 // the source of an executor. This is useful when it's possible for
448 // different executor ids to be related semantically.
449 // NOTE: Source is exposed alongside the resource usage of the
450 // executor via JSON on the slave. This allows users to import
451 // usage information into a time series database for monitoring.
452 optional string source = 10;
453 optional bytes data = 4;
454
455 // Service discovery information for the executor. It is not
456 // interpreted or acted upon by Mesos. It is up to a service
457 // discovery system to use this information as needed and to handle
458 // executors without service discovery information.
459 optional DiscoveryInfo discovery = 12;
460 }
461
462
463 /**
464 * Describes a master. This will probably have more fields in the
465 * future which might be used, for example, to link a framework webui
466 * to a master webui.
467 */
468 message MasterInfo {
469 required string id = 1;
470
471 // The IP address (only IPv4) as a packed 4-bytes integer,
472 // stored in network order. Deprecated, use `address.ip` instead.
473 required uint32 ip = 2;
474
475 // The TCP port the Master is listening on for incoming
476 // HTTP requests; deprecated, use `address.port` instead.
477 required uint32 port = 3 [default = 5050];
478
479 // In the default implementation, this will contain information
480 // about both the IP address, port and Master name; it should really
481 // not be relied upon by external tooling/frameworks and be
482 // considered an "internal" implementation field.
483 optional string pid = 4;
484
485 // The server's hostname, if available; it may be unreliable
486 // in environments where the DNS configuration does not resolve
487 // internal hostnames (eg, some public cloud providers).
488 // Deprecated, use `address.hostname` instead.
489 optional string hostname = 5;
490
491 // The running Master version, as a string; taken from the
492 // generated "master/version.hpp".
493 optional string version = 6;
494
495 // The full IP address (supports both IPv4 and IPv6 formats)
496 // and supersedes the use of `ip`, `port` and `hostname`.
497 // Since Mesos 0.24.
498 optional Address address = 7;
499 }
500
501
502 /**
503 * Describes a slave. Note that the 'id' field is only available after
504 * a slave is registered with the master, and is made available here
505 * to facilitate re-registration. If checkpoint is set, the slave is
506 * checkpointing its own information and potentially frameworks'
507 * information (if a framework has checkpointing enabled).
508 */
509 message SlaveInfo {
510 required string hostname = 1;
511 optional int32 port = 8 [default = 5051];
512 repeated Resource resources = 3;
513 repeated Attribute attributes = 5;
514 optional SlaveID id = 6;
515 // TODO(joerg84): Remove checkpoint field as with 0.22.0
516 // slave checkpointing is enabled for all slaves (MESOS-2317).
517 optional bool checkpoint = 7 [default = false];
518 }
519
520
521 /**
522 * Describes an Attribute or Resource "value". A value is described
523 * using the standard protocol buffer "union" trick.
524 */
525 message Value {
526 enum Type {
527 SCALAR = 0;
528 RANGES = 1;
529 SET = 2;
530 TEXT = 3;
531 }
532
533 message Scalar {
534 required double value = 1;
535 }
536
537 message Range {
538 required uint64 begin = 1;
539 required uint64 end = 2;
540 }
541
542 message Ranges {
543 repeated Range range = 1;
544 }
545
546 message Set {
547 repeated string item = 1;
548 }
549
550 message Text {
551 required string value = 1;
552 }
553
554 required Type type = 1;
555 optional Scalar scalar = 2;
556 optional Ranges ranges = 3;
557 optional Set set = 4;
558 optional Text text = 5;
559 }
560
561
562 /**
563 * Describes an attribute that can be set on a machine. For now,
564 * attributes and resources share the same "value" type, but this may
565 * change in the future and attributes may only be string based.
566 */
567 message Attribute {
568 required string name = 1;
569 required Value.Type type = 2;
570 optional Value.Scalar scalar = 3;
571 optional Value.Ranges ranges = 4;
572 optional Value.Set set = 6;
573 optional Value.Text text = 5;
574 }
575
576
577 /**
578 * Describes a resource on a machine. A resource can take on one of
579 * three types: scalar (double), a list of finite and discrete ranges
580 * (e.g., [1-10, 20-30]), or a set of items. A resource is described
581 * using the standard protocol buffer "union" trick.
582 *
583 * TODO(benh): Add better support for "expected" resources (e.g.,
584 * cpus, memory, disk, network).
585 */
586 message Resource {
587 required string name = 1;
588 required Value.Type type = 2;
589 optional Value.Scalar scalar = 3;
590 optional Value.Ranges ranges = 4;
591 optional Value.Set set = 5;
592 optional string role = 6 [default = "*"];
593
594 message ReservationInfo {
595 // Describes a dynamic reservation. A dynamic reservation is
596 // acquired by an operator via the '/reserve' HTTP endpoint or by
597 // a framework via the offer cycle by sending back an
598 // 'Offer::Operation::Reserve' message.
599 // NOTE: We currently do not allow frameworks with role "*" to
600 // make dynamic reservations.
601
602 // This field indicates the principal of the operator or framework
603 // that reserved this resource. It is used in conjunction with the
604 // "unreserve" ACL to determine whether the entity attempting to
605 // unreserve this resource is permitted to do so.
606 // NOTE: This field should match the FrameworkInfo.principal of
607 // the framework that reserved this resource.
608 required string principal = 1;
609 }
610
611 // If this is set, this resource was dynamically reserved by an
612 // operator or a framework. Otherwise, this resource is either unreserved
613 // or statically reserved by an operator via the --resources flag.
614 optional ReservationInfo reservation = 8;
615
616 message DiskInfo {
617 // Describes a persistent disk volume.
618 // A persistent disk volume will not be automatically garbage
619 // collected if the task/executor/slave terminates, but is
620 // re-offered to the framework(s) belonging to the 'role'.
621 // A framework can set the ID (if it is not set yet) to express
622 // the intention to create a new persistent disk volume from a
623 // regular disk resource. To reuse a previously created volume, a
624 // framework can launch a task/executor when it receives an offer
625 // with a persistent volume, i.e., ID is set.
626 // NOTE: Currently, we do not allow a persistent disk volume
627 // without a reservation (i.e., 'role' should not be '*').
628 message Persistence {
629 // A unique ID for the persistent disk volume.
630 // NOTE: The ID needs to be unique per role on each slave.
631 required string id = 1;
632 }
633
634 optional Persistence persistence = 1;
635
636 // Describes how this disk resource will be mounted in the
637 // container. If not set, the disk resource will be used as the
638 // sandbox. Otherwise, it will be mounted according to the
639 // 'container_path' inside 'volume'. The 'host_path' inside
640 // 'volume' is ignored.
641 // NOTE: If 'volume' is set but 'persistence' is not set, the
642 // volume will be automatically garbage collected after
643 // task/executor terminates. Currently, if 'persistence' is set,
644 // 'volume' must be set.
645 optional Volume volume = 2;
646 }
647
648 optional DiskInfo disk = 7;
649
650 message RevocableInfo {}
651
652 // If this is set, the resources are revocable, i.e., any tasks or
653 // executors launched using these resources could get preempted or
654 // throttled at any time. This could be used by frameworks to run
655 // best effort tasks that do not need strict uptime or performance
656 // guarantees. Note that if this is set, 'disk' or 'reservation'
657 // cannot be set.
658 optional RevocableInfo revocable = 9;
659 }
660
661 /**
662 * When the network bandwidth caps are enabled and the container
663 * is over its limit, outbound packets may be either delayed or
664 * dropped completely either because it exceeds the maximum bandwidth
665 * allocation for a single container (the cap) or because the combined
666 * network traffic of multiple containers on the host exceeds the
667 * transmit capacity of the host (the share). We can report the
668 * following statistics for each of these conditions exported directly
669 * from the Linux Traffic Control Queueing Discipline.
670 *
671 * id : name of the limiter, e.g. 'tx_bw_cap'
672 * backlog : number of packets currently delayed
673 * bytes : total bytes seen
674 * drops : number of packets dropped in total
675 * overlimits : number of packets which exceeded allocation
676 * packets : total packets seen
677 * qlen : number of packets currently queued
678 * rate_bps : throughput in bytes/sec
679 * rate_pps : throughput in packets/sec
680 * requeues : number of times a packet has been delayed due to
681 * locking or device contention issues
682 *
683 * More information on the operation of Linux Traffic Control can be
684 * found at http://www.lartc.org/lartc.html.
685 */
686 message TrafficControlStatistics {
687 required string id = 1;
688 optional uint64 backlog = 2;
689 optional uint64 bytes = 3;
690 optional uint64 drops = 4;
691 optional uint64 overlimits = 5;
692 optional uint64 packets = 6;
693 optional uint64 qlen = 7;
694 optional uint64 ratebps = 8;
695 optional uint64 ratepps = 9;
696 optional uint64 requeues = 10;
697 }
698
699
700 /**
701 * A snapshot of resource usage statistics.
702 */
703 message ResourceStatistics {
704 required double timestamp = 1; // Snapshot time, in seconds since the Epoch.
705
706 optional uint32 processes = 30;
707 optional uint32 threads = 31;
708
709 // CPU Usage Information:
710 // Total CPU time spent in user mode, and kernel mode.
711 optional double cpus_user_time_secs = 2;
712 optional double cpus_system_time_secs = 3;
713
714 // Number of CPUs allocated.
715 optional double cpus_limit = 4;
716
717 // cpu.stat on process throttling (for contention issues).
718 optional uint32 cpus_nr_periods = 7;
719 optional uint32 cpus_nr_throttled = 8;
720 optional double cpus_throttled_time_secs = 9;
721
722 // Memory Usage Information:
723
724 // mem_total_bytes was added in 0.23.0 to represent the total memory
725 // of a process in RAM (as opposed to in Swap). This was previously
726 // reported as mem_rss_bytes, which was also changed in 0.23.0 to
727 // represent only the anonymous memory usage, to keep in sync with
728 // Linux kernel's (arguably erroneous) use of terminology.
729 optional uint64 mem_total_bytes = 36;
730
731 // Total memory + swap usage. This is set if swap is enabled.
732 optional uint64 mem_total_memsw_bytes = 37;
733
734 // Hard memory limit for a container.
735 optional uint64 mem_limit_bytes = 6;
736
737 // Soft memory limit for a container.
738 optional uint64 mem_soft_limit_bytes = 38;
739
740 // Broken out memory usage information: pagecache, rss (anonymous),
741 // mmaped files and swap.
742
743 // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in
744 // 0.23.0 and will be removed in 0.24.0.
745 optional uint64 mem_file_bytes = 10;
746 optional uint64 mem_anon_bytes = 11;
747
748 // mem_cache_bytes is added in 0.23.0 to represent page cache usage.
749 optional uint64 mem_cache_bytes = 39;
750
751 // Since 0.23.0, mem_rss_bytes is changed to represent only
752 // anonymous memory usage. Note that neither its requiredness, type,
753 // name nor numeric tag has been changed.
754 optional uint64 mem_rss_bytes = 5;
755
756 optional uint64 mem_mapped_file_bytes = 12;
757 // This is only set if swap is enabled.
758 optional uint64 mem_swap_bytes = 40;
759 optional uint64 mem_unevictable_bytes = 41;
760
761 // Number of occurrences of different levels of memory pressure
762 // events reported by memory cgroup. Pressure listening (re)starts
763 // with these values set to 0 when slave (re)starts. See
764 // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for
765 // more details.
766 optional uint64 mem_low_pressure_counter = 32;
767 optional uint64 mem_medium_pressure_counter = 33;
768 optional uint64 mem_critical_pressure_counter = 34;
769
770 // Disk Usage Information for executor working directory.
771 optional uint64 disk_limit_bytes = 26;
772 optional uint64 disk_used_bytes = 27;
773
774 // Perf statistics.
775 optional PerfStatistics perf = 13;
776
777 // Network Usage Information:
778 optional uint64 net_rx_packets = 14;
779 optional uint64 net_rx_bytes = 15;
780 optional uint64 net_rx_errors = 16;
781 optional uint64 net_rx_dropped = 17;
782 optional uint64 net_tx_packets = 18;
783 optional uint64 net_tx_bytes = 19;
784 optional uint64 net_tx_errors = 20;
785 optional uint64 net_tx_dropped = 21;
786
787 // The kernel keeps track of RTT (round-trip time) for its TCP
788 // sockets. RTT is a way to tell the latency of a container.
789 optional double net_tcp_rtt_microsecs_p50 = 22;
790 optional double net_tcp_rtt_microsecs_p90 = 23;
791 optional double net_tcp_rtt_microsecs_p95 = 24;
792 optional double net_tcp_rtt_microsecs_p99 = 25;
793
794 optional double net_tcp_active_connections = 28;
795 optional double net_tcp_time_wait_connections = 29;
796
797 // Network traffic flowing into or out of a container can be delayed
798 // or dropped due to congestion or policy inside and outside the
799 // container.
800 repeated TrafficControlStatistics net_traffic_control_statistics = 35;
801 }
802
803
804 /**
805 * Describes a snapshot of the resource usage for executors.
806 */
807 message ResourceUsage {
808 message Executor {
809 required ExecutorInfo executor_info = 1;
810
811 // This includes resources used by the executor itself
812 // as well as its active tasks.
813 repeated Resource allocated = 2;
814
815 // Current resource usage. If absent, the containerizer
816 // cannot provide resource usage.
817 optional ResourceStatistics statistics = 3;
818
819 // The container id for the executor specified in the executor_info field.
820 required ContainerID container_id = 4;
821 }
822
823 repeated Executor executors = 1;
824
825 // Slave's total resources including checkpointed dynamic
826 // reservations and persistent volumes.
827 repeated Resource total = 2;
828 }
829
830
831 /**
832 * Describes a sample of events from "perf stat". Only available on
833 * Linux.
834 *
835 * NOTE: Each optional field matches the name of a perf event (see
836 * "perf list") with the following changes:
837 * 1. Names are downcased.
838 * 2. Hyphens ('-') are replaced with underscores ('_').
839 * 3. Events with alternate names use the name "perf stat" returns,
840 * e.g., for the event "cycles OR cpu-cycles" perf always returns
841 * cycles.
842 */
843 message PerfStatistics {
844 required double timestamp = 1; // Start of sample interval, in seconds since the Epoch.
845 required double duration = 2; // Duration of sample interval, in seconds.
846
847 // Hardware event.
848 optional uint64 cycles = 3;
849 optional uint64 stalled_cycles_frontend = 4;
850 optional uint64 stalled_cycles_backend = 5;
851 optional uint64 instructions = 6;
852 optional uint64 cache_references = 7;
853 optional uint64 cache_misses = 8;
854 optional uint64 branches = 9;
855 optional uint64 branch_misses = 10;
856 optional uint64 bus_cycles = 11;
857 optional uint64 ref_cycles = 12;
858
859 // Software event.
860 optional double cpu_clock = 13;
861 optional double task_clock = 14;
862 optional uint64 page_faults = 15;
863 optional uint64 minor_faults = 16;
864 optional uint64 major_faults = 17;
865 optional uint64 context_switches = 18;
866 optional uint64 cpu_migrations = 19;
867 optional uint64 alignment_faults = 20;
868 optional uint64 emulation_faults = 21;
869
870 // Hardware cache event.
871 optional uint64 l1_dcache_loads = 22;
872 optional uint64 l1_dcache_load_misses = 23;
873 optional uint64 l1_dcache_stores = 24;
874 optional uint64 l1_dcache_store_misses = 25;
875 optional uint64 l1_dcache_prefetches = 26;
876 optional uint64 l1_dcache_prefetch_misses = 27;
877 optional uint64 l1_icache_loads = 28;
878 optional uint64 l1_icache_load_misses = 29;
879 optional uint64 l1_icache_prefetches = 30;
880 optional uint64 l1_icache_prefetch_misses = 31;
881 optional uint64 llc_loads = 32;
882 optional uint64 llc_load_misses = 33;
883 optional uint64 llc_stores = 34;
884 optional uint64 llc_store_misses = 35;
885 optional uint64 llc_prefetches = 36;
886 optional uint64 llc_prefetch_misses = 37;
887 optional uint64 dtlb_loads = 38;
888 optional uint64 dtlb_load_misses = 39;
889 optional uint64 dtlb_stores = 40;
890 optional uint64 dtlb_store_misses = 41;
891 optional uint64 dtlb_prefetches = 42;
892 optional uint64 dtlb_prefetch_misses = 43;
893 optional uint64 itlb_loads = 44;
894 optional uint64 itlb_load_misses = 45;
895 optional uint64 branch_loads = 46;
896 optional uint64 branch_load_misses = 47;
897 optional uint64 node_loads = 48;
898 optional uint64 node_load_misses = 49;
899 optional uint64 node_stores = 50;
900 optional uint64 node_store_misses = 51;
901 optional uint64 node_prefetches = 52;
902 optional uint64 node_prefetch_misses = 53;
903 }
904
905
906 /**
907 * Describes a request for resources that can be used by a framework
908 * to proactively influence the allocator. If 'slave_id' is provided
909 * then this request is assumed to only apply to resources on that
910 * slave.
911 */
912 message Request {
913 optional SlaveID slave_id = 1;
914 repeated Resource resources = 2;
915 }
916
917
918 /**
919 * Describes some resources available on a slave. An offer only
920 * contains resources from a single slave.
921 */
922 message Offer {
923 required OfferID id = 1;
924 required FrameworkID framework_id = 2;
925 required SlaveID slave_id = 3;
926 required string hostname = 4;
927
928 // URL for reaching the slave running on the host.
929 optional URL url = 8;
930
931 repeated Resource resources = 5;
932 repeated Attribute attributes = 7;
933 repeated ExecutorID executor_ids = 6;
934
935 // Signifies that the resources in this Offer may be unavailable during
936 // the given interval. Any tasks launched using these resources may be
937 // killed when the interval arrives. For example, these resources may be
938 // part of a planned maintenance schedule.
939 //
940 // This field only provides information about a planned unavailability.
941 // The unavailability interval may not necessarily start at exactly this
942 // interval, nor last for exactly the duration of this interval.
943 // The unavailability may also be forever! See comments in
944 // `Unavailability` for more details.
945 optional Unavailability unavailability = 9;
946
947 // Defines an operation that can be performed against offers.
948 message Operation {
949 enum Type {
950 LAUNCH = 1;
951 RESERVE = 2;
952 UNRESERVE = 3;
953 CREATE = 4;
954 DESTROY = 5;
955 }
956
957 message Launch {
958 repeated TaskInfo task_infos = 1;
959 }
960
961 message Reserve {
962 repeated Resource resources = 1;
963 }
964
965 message Unreserve {
966 repeated Resource resources = 1;
967 }
968
969 message Create {
970 repeated Resource volumes = 1;
971 }
972
973 message Destroy {
974 repeated Resource volumes = 1;
975 }
976
977 required Type type = 1;
978 optional Launch launch = 2;
979 optional Reserve reserve = 3;
980 optional Unreserve unreserve = 4;
981 optional Create create = 5;
982 optional Destroy destroy = 6;
983 }
984 }
985
986
987 /**
988 * A request to return some resources occupied by a framework.
989 */
990 message InverseOffer {
991 // This is the same OfferID as found in normal offers, which allows
992 // re-use of some of the OfferID-only messages.
993 required OfferID id = 1;
994
995 // URL for reaching the slave running on the host. This enables some
996 // optimizations as described in MESOS-3012, such as allowing the
997 // scheduler driver to bypass the master and talk directly with a slave.
998 optional URL url = 2;
999
1000 // The framework that should release its resources.
1001 // If no specifics are provided (i.e. which slave), all the framework's
1002 // resources are requested back.
1003 required FrameworkID framework_id = 3;
1004
1005 // Specified if the resources need to be released from a particular slave.
1006 // All the framework's resources on this slave are requested back,
1007 // unless further qualified by the `resources` field.
1008 optional SlaveID slave_id = 4;
1009
1010 // This InverseOffer represents a planned unavailability event in the
1011 // specified interval. Any tasks running on the given framework or slave
1012 // may be killed when the interval arrives. Therefore, frameworks should
1013 // aim to gracefully terminate tasks prior to the arrival of the interval.
1014 //
1015 // For reserved resources, the resources are expected to be returned to the
1016 // framework after the unavailability interval. This is an expectation,
1017 // not a guarantee. For example, if the unavailability duration is not set,
1018 // the resources may be removed permanently.
1019 //
1020 // For other resources, there is no guarantee that requested resources will
1021 // be returned after the unavailability interval. The allocator has no
1022 // obligation to re-offer these resources to the prior framework after
1023 // the unavailability.
1024 required Unavailability unavailability = 5;
1025
1026 // A list of resources being requested back from the framework,
1027 // on the slave identified by `slave_id`. If no resources are specified
1028 // then all resources are being requested back. For the purpose of
1029 // maintenance, this field is always empty (maintenance always requests
1030 // all resources back).
1031 repeated Resource resources = 6;
1032
1033 // TODO(josephw): Add additional options for narrowing down the resources
1034 // being requested back. Such as specific executors, tasks, etc.
1035 }
1036
1037
1038 /**
1039 * Describes a task. Passed from the scheduler all the way to an
1040 * executor (see SchedulerDriver::launchTasks and
1041 * Executor::launchTask). Either ExecutorInfo or CommandInfo should be set.
1042 * A different executor can be used to launch this task, and subsequent tasks
1043 * meant for the same executor can reuse the same ExecutorInfo struct.
1044 */
1045 message TaskInfo {
1046 required string name = 1;
1047 required TaskID task_id = 2;
1048 required SlaveID slave_id = 3;
1049 repeated Resource resources = 4;
1050 optional ExecutorInfo executor = 5;
1051 optional CommandInfo command = 7;
1052 // Task provided with a container will launch the container as part
1053 // of this task paired with the task's CommandInfo.
1054 optional ContainerInfo container = 9;
1055 optional bytes data = 6;
1056 // A health check for the task (currently in *alpha* and initial
1057 // support will only be for TaskInfo's that have a CommandInfo).
1058 optional HealthCheck health_check = 8;
1059
1060 // Labels are free-form key value pairs which are exposed through
1061 // master and slave endpoints. Labels will not be interpreted or
1062 // acted upon by Mesos itself. As opposed to the data field, labels
1063 // will be kept in memory on master and slave processes. Therefore,
1064 // labels should be used to tag tasks with light-weight meta-data.
1065 optional Labels labels = 10;
1066
1067 // Service discovery information for the task. It is not interpreted
1068 // or acted upon by Mesos. It is up to a service discovery system
1069 // to use this information as needed and to handle tasks without
1070 // service discovery information.
1071 optional DiscoveryInfo discovery = 11;
1072 }
1073
1074
1075 /**
1076 * Describes possible task states. IMPORTANT: Mesos assumes tasks that
1077 * enter terminal states (see below) imply the task is no longer
1078 * running and thus clean up any thing associated with the task
1079 * (ultimately offering any resources being consumed by that task to
1080 * another task).
1081 */
1082 enum TaskState {
1083 TASK_STAGING = 6; // Initial state. Framework status updates should not use.
1084 TASK_STARTING = 0;
1085 TASK_RUNNING = 1;
1086 TASK_FINISHED = 2; // TERMINAL. The task finished successfully.
1087 TASK_FAILED = 3; // TERMINAL. The task failed to finish successfully.
1088 TASK_KILLED = 4; // TERMINAL. The task was killed by the executor.
1089 TASK_LOST = 5; // TERMINAL. The task failed but can be rescheduled.
1090 TASK_ERROR = 7; // TERMINAL. The task description contains an error.
1091 }
1092
1093
1094 /**
1095 * Describes the current status of a task.
1096 */
1097 message TaskStatus {
1098 // Describes the source of the task status update.
1099 enum Source {
1100 SOURCE_MASTER = 0;
1101 SOURCE_SLAVE = 1;
1102 SOURCE_EXECUTOR = 2;
1103 }
1104
1105 // Detailed reason for the task status update.
1106 //
1107 // TODO(bmahler): Differentiate between slave removal reasons
1108 // (e.g. unhealthy vs. unregistered for maintenance).
1109 enum Reason {
1110 // TODO(jieyu): The default value when a caller doesn't check for
1111 // presence is 0 and so ideally the 0 reason is not a valid one.
1112 // Since this is not used anywhere, consider removing this reason.
1113 REASON_COMMAND_EXECUTOR_FAILED = 0;
1114
1115 REASON_CONTAINER_LAUNCH_FAILED = 21;
1116 REASON_CONTAINER_LIMITATION = 19;
1117 REASON_CONTAINER_LIMITATION_DISK = 20;
1118 REASON_CONTAINER_LIMITATION_MEMORY = 8;
1119 REASON_CONTAINER_PREEMPTED = 17;
1120 REASON_CONTAINER_UPDATE_FAILED = 22;
1121 REASON_EXECUTOR_REGISTRATION_TIMEOUT = 23;
1122 REASON_EXECUTOR_REREGISTRATION_TIMEOUT = 24;
1123 REASON_EXECUTOR_TERMINATED = 1;
1124 REASON_EXECUTOR_UNREGISTERED = 2;
1125 REASON_FRAMEWORK_REMOVED = 3;
1126 REASON_GC_ERROR = 4;
1127 REASON_INVALID_FRAMEWORKID = 5;
1128 REASON_INVALID_OFFERS = 6;
1129 REASON_MASTER_DISCONNECTED = 7;
1130 REASON_RECONCILIATION = 9;
1131 REASON_RESOURCES_UNKNOWN = 18;
1132 REASON_SLAVE_DISCONNECTED = 10;
1133 REASON_SLAVE_REMOVED = 11;
1134 REASON_SLAVE_RESTARTED = 12;
1135 REASON_SLAVE_UNKNOWN = 13;
1136 REASON_TASK_INVALID = 14;
1137 REASON_TASK_UNAUTHORIZED = 15;
1138 REASON_TASK_UNKNOWN = 16;
1139 }
1140
1141 required TaskID task_id = 1;
1142 required TaskState state = 2;
1143 optional string message = 4; // Possible message explaining state.
1144 optional Source source = 9;
1145 optional Reason reason = 10;
1146 optional bytes data = 3;
1147 optional SlaveID slave_id = 5;
1148 optional ExecutorID executor_id = 7; // TODO(benh): Use in master/slave.
1149 optional double timestamp = 6;
1150
1151 // Statuses that are delivered reliably to the scheduler will
1152 // include a 'uuid'. The status is considered delivered once
1153 // it is acknowledged by the scheduler. Schedulers can choose
1154 // to either explicitly acknowledge statuses or let the scheduler
1155 // driver implicitly acknowledge (default).
1156 //
1157 // TODO(bmahler): This is currently overwritten in the scheduler
1158 // driver and executor driver, but executors will need to set this
1159 // to a valid RFC-4122 UUID if using the HTTP API.
1160 optional bytes uuid = 11;
1161
1162 // Describes whether the task has been determined to be healthy
1163 // (true) or unhealthy (false) according to the HealthCheck field in
1164 // the command info.
1165 optional bool healthy = 8;
1166
1167 // Labels are free-form key value pairs which are exposed through
1168 // master and slave endpoints. Labels will not be interpreted or
1169 // acted upon by Mesos itself. As opposed to the data field, labels
1170 // will be kept in memory on master and slave processes. Therefore,
1171 // labels should be used to tag TaskStatus message with light-weight
1172 // meta-data.
1173 optional Labels labels = 12;
1174
1175 // Container related information that is resolved dynamically such as
1176 // network address.
1177 optional ContainerStatus container_status = 13;
1178 }
1179
1180
1181 /**
1182 * Describes possible filters that can be applied to unused resources
1183 * (see SchedulerDriver::launchTasks) to influence the allocator.
1184 */
1185 message Filters {
1186 // Time to consider unused resources refused. Note that all unused
1187 // resources will be considered refused and use the default value
1188 // (below) regardless of whether Filters was passed to
1189 // SchedulerDriver::launchTasks. You MUST pass Filters with this
1190 // field set to change this behavior (i.e., get another offer which
1191 // includes unused resources sooner or later than the default).
1192 optional double refuse_seconds = 1 [default = 5.0];
1193 }
1194
1195
1196 /**
1197 * Describes a collection of environment variables. This is used with
1198 * CommandInfo in order to set environment variables before running a
1199 * command.
1200 */
1201 message Environment {
1202 message Variable {
1203 required string name = 1;
1204 required string value = 2;
1205 }
1206
1207 repeated Variable variables = 1;
1208 }
1209
1210
1211 /**
1212 * A generic (key, value) pair used in various places for parameters.
1213 */
1214 message Parameter {
1215 required string key = 1;
1216 required string value = 2;
1217 }
1218
1219
1220 /**
1221 * Collection of Parameter.
1222 */
1223 message Parameters {
1224 repeated Parameter parameter = 1;
1225 }
1226
1227
1228 /**
1229 * Credential used in various places for authentication and
1230 * authorization.
1231 *
1232 * NOTE: A 'principal' is different from 'FrameworkInfo.user'. The
1233 * former is used for authentication and authorization while the
1234 * latter is used to determine the default user under which the
1235 * framework's executors/tasks are run.
1236 */
1237 message Credential {
1238 required string principal = 1;
1239 optional string secret = 2;
1240 }
1241
1242
1243 /**
1244 * Credentials used for framework authentication, HTTP authentication
1245 * (where the common 'username' and 'password' are captured as
1246 * 'principal' and 'secret' respectively), etc.
1247 */
1248 message Credentials {
1249 repeated Credential credentials = 1;
1250 }
1251
1252
1253 /**
1254 * Rate (queries per second, QPS) limit for messages from a framework to master.
1255 * Strictly speaking they are the combined rate from all frameworks of the same
1256 * principal.
1257 */
1258 message RateLimit {
1259 // Leaving QPS unset gives it unlimited rate (i.e., not throttled),
1260 // which also implies unlimited capacity.
1261 optional double qps = 1;
1262
1263 // Principal of framework(s) to be throttled. Should match
1264 // FrameworkInfo.principal and Credential.principal (if using authentication).
1265 required string principal = 2;
1266
1267 // Max number of outstanding messages from frameworks of this principal
1268 // allowed by master before the next message is dropped and an error is sent
1269 // back to the sender. Messages received before the capacity is reached are
1270 // still going to be processed after the error is sent.
1271 // If unspecified, this principal is assigned unlimited capacity.
1272 // NOTE: This value is ignored if 'qps' is not set.
1273 optional uint64 capacity = 3;
1274 }
1275
1276
1277 /**
1278 * Collection of RateLimit.
1279 * Frameworks without rate limits defined here are not throttled unless
1280 * 'aggregate_default_qps' is specified.
1281 */
1282 message RateLimits {
1283 // Items should have unique principals.
1284 repeated RateLimit limits = 1;
1285
1286 // All the frameworks not specified in 'limits' get this default rate.
1287 // This rate is an aggregate rate for all of them, i.e., their combined
1288 // traffic is throttled together at this rate.
1289 optional double aggregate_default_qps = 2;
1290
1291 // All the frameworks not specified in 'limits' get this default capacity.
1292 // This is an aggregate value similar to 'aggregate_default_qps'.
1293 optional uint64 aggregate_default_capacity = 3;
1294 }
1295
1296
1297 /**
1298 * Describe an image used by tasks or executors. Note that it's only
1299 * for tasks or executors launched by MesosContainerizer currently.
1300 * TODO(jieyu): This feature not fully supported in 0.24.0. Please do
1301 * not use it until this feature is announced.
1302 */
1303 message Image {
1304 enum Type {
1305 APPC = 1;
1306 DOCKER = 2;
1307 }
1308
1309 // Protobuf for specifying an Appc container image. See:
1310 // https://github.com/appc/spec/blob/master/spec/aci.md
1311 message Appc {
1312 // The name of the image.
1313 required string name = 1;
1314
1315 // An image ID is a string of the format "hash-value", where
1316 // "hash" is the hash algorithm used and "value" is the hex
1317 // encoded string of the digest. Currently the only permitted
1318 // hash algorithm is sha512.
1319 optional string id = 2;
1320
1321 // Optional labels. Suggested labels: "version", "os", and "arch".
1322 optional Labels labels = 3;
1323 }
1324
1325 message Docker {
1326 // The name of the image. Expected format:
1327 // [REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG|@TYPE:DIGEST]
1328 //
1329 // See: https://docs.docker.com/reference/commandline/pull/
1330 required string name = 1;
1331 }
1332
1333 required Type type = 1;
1334
1335 // Only one of the following image messages should be set to match
1336 // the type.
1337 optional Appc appc = 2;
1338 optional Docker docker = 3;
1339 }
1340
1341
1342 /**
1343 * Describes a volume mapping either from host to container or vice
1344 * versa. Both paths can either refer to a directory or a file.
1345 */
1346 message Volume {
1347 enum Mode {
1348 RW = 1; // read-write.
1349 RO = 2; // read-only.
1350 }
1351
1352 required Mode mode = 3;
1353
1354 // Path pointing to a directory or file in the container. If the
1355 // path is a relative path, it is relative to the container work
1356 // directory. If the path is an absolute path, that path must
1357 // already exist.
1358 required string container_path = 1;
1359
1360 // The following specifies the source of this volume. At most one of
1361 // the following should be set.
1362
1363 // Absolute path pointing to a directory or file on the host or a
1364 // path relative to the container work directory.
1365 optional string host_path = 2;
1366
1367 // The source of the volume is an Image which describes a root
1368 // filesystem which will be provisioned by Mesos.
1369 optional Image image = 4;
1370 }
1371
1372
1373 /**
1374 * Describes a network request from a framework as well as network resolution
1375 * provided by Mesos.
1376 *
1377 * A Framework may request the network isolator on the Agent to isolate the
1378 * container in a network namespace and create a virtual network interface.
1379 * The `NetworkInfo` message describes the properties of that virtual
1380 * interface, including the IP addresses and network isolation policy
1381 * (network group membership).
1382 *
1383 * The NetworkInfo message is not interpreted by the Master or Agent and is
1384 * intended to be used by Agent and Master modules implementing network
1385 * isolation. If the modules are missing, the message is simply ignored. In
1386 * future, the task launch will fail if there is no module providing the
1387 * network isolation capabilities (MESOS-3390).
1388 *
1389 * An executor, Agent, or an Agent module may append NetworkInfos inside
1390 * TaskStatus::container_status to provide information such as the container IP
1391 * address and isolation groups.
1392 */
1393 message NetworkInfo {
1394 enum Protocol {
1395 IPv4 = 1;
1396 IPv6 = 2;
1397 }
1398
1399 // Specifies a request for an IP address, or reports the assigned container
1400 // IP address.
1401 //
1402 // Users can request an automatically assigned IP (for example, via an
1403 // IPAM service) or a specific IP by adding a NetworkInfo to the
1404 // ContainerInfo for a task. On a request, specifying neither `protocol`
1405 // nor `ip_address` means that any available address may be assigned.
1406 message IPAddress {
1407 // Specify IP address requirement. Set protocol to the desired value to
1408 // request the network isolator on the Agent to assign an IP address to the
1409 // container being launched. If a specific IP address is specified in
1410 // ip_address, this field should not be set.
1411 optional Protocol protocol = 1;
1412
1413 // Statically assigned IP provided by the Framework. This IP will be
1414 // assigned to the container by the network isolator module on the Agent.
1415 // This field should not be used with the protocol field above.
1416 //
1417 // If an explicit address is requested but is unavailable, the network
1418 // isolator should fail the task.
1419 optional string ip_address = 2;
1420 }
1421
1422 // When included in a ContainerInfo, each of these represent a
1423 // request for an IP address. Each request can specify an explicit address
1424 // or the IP protocol to use.
1425 //
1426 // When included in a TaskStatus message, these inform the framework
1427 // scheduler about the IP addresses that are bound to the container
1428 // interface. When there are no custom network isolator modules installed,
1429 // this field is filled in automatically with the Agent IP address.
1430 repeated IPAddress ip_addresses = 5;
1431
1432 // Specify IP address requirement. Set protocol to the desired value to
1433 // request the network isolator on the Agent to assign an IP address to the
1434 // container being launched. If a specific IP address is specified in
1435 // ip_address, this field should not be set.
1436 optional Protocol protocol = 1 [deprecated = true]; // Since 0.26.0
1437
1438 // Statically assigned IP provided by the Framework. This IP will be assigned
1439 // to the container by the network isolator module on the Agent. This field
1440 // should not be used with the protocol field above.
1441 // NOTE: It is up to the networking 'provider' (IPAM/Isolator) to interpret
1442 // this either as a hint of as a requirement for assigning the IP.
1443 optional string ip_address = 2 [deprecated = true]; // Since 0.26.0
1444
1445 // A group is the name given to a set of logically-related interfaces that
1446 // are allowed to communicate among themselves. Network traffic is allowed
1447 // between two container interfaces that share at least one network group.
1448 // For example, one might want to create separate groups for isolating dev,
1449 // testing, qa and prod deployment environments.
1450 repeated string groups = 3;
1451
1452 // To tag certain metadata to be used by Isolator/IPAM, e.g., rack, etc.
1453 optional Labels labels = 4;
1454 };
1455
1456
1457 /**
1458 * Describes a container configuration and allows extensible
1459 * configurations for different container implementations.
1460 */
1461 message ContainerInfo {
1462 // All container implementation types.
1463 enum Type {
1464 DOCKER = 1;
1465 MESOS = 2;
1466 }
1467
1468 message DockerInfo {
1469 // The docker image that is going to be passed to the registry.
1470 required string image = 1;
1471
1472 // Network options.
1473 enum Network {
1474 HOST = 1;
1475 BRIDGE = 2;
1476 NONE = 3;
1477 }
1478
1479 optional Network network = 2 [default = HOST];
1480
1481 message PortMapping {
1482 required uint32 host_port = 1;
1483 required uint32 container_port = 2;
1484 // Protocol to expose as (ie: tcp, udp).
1485 optional string protocol = 3;
1486 }
1487
1488 repeated PortMapping port_mappings = 3;
1489
1490 optional bool privileged = 4 [default = false];
1491
1492 // Allowing arbitrary parameters to be passed to docker CLI.
1493 // Note that anything passed to this field is not guaranteed
1494 // to be supported moving forward, as we might move away from
1495 // the docker CLI.
1496 repeated Parameter parameters = 5;
1497
1498 // With this flag set to true, the docker containerizer will
1499 // pull the docker image from the registry even if the image
1500 // is already downloaded on the slave.
1501 optional bool force_pull_image = 6;
1502 }
1503
1504 message MesosInfo {
1505 optional Image image = 1;
1506 }
1507
1508 required Type type = 1;
1509 repeated Volume volumes = 2;
1510 optional string hostname = 4;
1511
1512 // Only one of the following *Info messages should be set to match
1513 // the type.
1514 optional DockerInfo docker = 3;
1515 optional MesosInfo mesos = 5;
1516
1517 // A list of network requests. A framework can request multiple IP addresses
1518 // for the container.
1519 repeated NetworkInfo network_infos = 7;
1520 }
1521
1522
1523 /**
1524 * Container related information that is resolved during container setup. The
1525 * information is sent back to the framework as part of the TaskStatus message.
1526 */
1527 message ContainerStatus {
1528 // This field can be reliably used to identify the container IP address.
1529 repeated NetworkInfo network_infos = 1;
1530 }
1531
1532
1533 /**
1534 * Collection of labels.
1535 */
1536 message Labels {
1537 repeated Label labels = 1;
1538 }
1539
1540
1541 /**
1542 * Key, value pair used to store free form user-data.
1543 */
1544 message Label {
1545 required string key = 1;
1546 optional string value = 2;
1547 }
1548
1549
1550 /**
1551 * Named port used for service discovery.
1552 */
1553 message Port {
1554 required uint32 number = 1;
1555 optional string name = 2;
1556 optional string protocol = 3;
1557 optional DiscoveryInfo.Visibility visibility = 4;
1558 }
1559
1560
1561 /**
1562 * Collection of ports.
1563 */
1564 message Ports {
1565 repeated Port ports = 1;
1566 }
1567
1568
1569 /**
1570 * Service discovery information.
1571 * The visibility field restricts discovery within a framework (FRAMEWORK),
1572 * within a Mesos cluster (CLUSTER), or places no restrictions (EXTERNAL).
1573 * Each port in the ports field also has an optional visibility field.
1574 * If visibility is specified for a port, it overrides the default service-wide
1575 * DiscoveryInfo.visibility for that port.
1576 * The environment, location, and version fields provide first class support for
1577 * common attributes used to differentiate between similar services. The
1578 * environment may receive values such as PROD/QA/DEV, the location field may
1579 * receive values like EAST-US/WEST-US/EUROPE/AMEA, and the version field may
1580 * receive values like v2.0/v0.9. The exact use of these fields is up to each
1581 * service discovery system.
1582 */
1583 message DiscoveryInfo {
1584 enum Visibility {
1585 FRAMEWORK = 0;
1586 CLUSTER = 1;
1587 EXTERNAL = 2;
1588 }
1589
1590 required Visibility visibility = 1;
1591 optional string name = 2;
1592 optional string environment = 3;
1593 optional string location = 4;
1594 optional string version = 5;
1595 optional Ports ports = 6;
1596 optional Labels labels = 7;
1597 }
1598
1599
1600 /**
1601 * Protobuf for the Appc image manifest JSON schema:
1602 * https://github.com/appc/spec/blob/master/spec/aci.md#image-manifest-schema
1603 * Where possible, any field required in the schema is required in the protobuf
1604 * but some cannot be expressed, e.g., a repeated string that has at least one
1605 * element. Further validation should be performed after parsing the JSON into
1606 * the protobuf.
1607 * This version of Appc protobuf is based on Appc spec version 0.6.1.
1608 * TODO(xujyan): This protobuf currently defines a subset of fields in the spec
1609 * that Mesos makes use of to avoid confusion. New fields are going to be added
1610 * when Mesos starts to support them.
1611 */
1612 message AppcImageManifest {
1613 required string acKind = 1;
1614 required string acVersion = 2;
1615 required string name = 3;
1616
1617 message Label {
1618 required string name = 1;
1619 required string value = 2;
1620 }
1621
1622 repeated Label labels = 4;
1623
1624 message Annotation {
1625 required string name = 1;
1626 required string value = 2;
1627 }
1628
1629 repeated Annotation annotations = 5;
1630 }