| 1 |
// Licensed to the Apache Software Foundation (ASF) under one |
| 2 |
// or more contributor license agreements. See the NOTICE file |
| 3 |
// distributed with this work for additional information |
| 4 |
// regarding copyright ownership. The ASF licenses this file |
| 5 |
// to you under the Apache License, Version 2.0 (the |
| 6 |
// "License"); you may not use this file except in compliance |
| 7 |
// with the License. You may obtain a copy of the License at |
| 8 |
// |
| 9 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
// |
| 11 |
// Unless required by applicable law or agreed to in writing, software |
| 12 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
// See the License for the specific language governing permissions and |
| 15 |
// limitations under the License. |
| 16 |
|
| 17 |
syntax = "proto2"; |
| 18 |
|
| 19 |
package mesos; |
| 20 |
|
| 21 |
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; |
| 22 |
|
| 23 |
option go_package = "mesos"; |
| 24 |
option (gogoproto.benchgen_all) = true; |
| 25 |
option (gogoproto.enum_stringer_all) = true; |
| 26 |
option (gogoproto.equal_all) = true; |
| 27 |
option (gogoproto.goproto_enum_prefix_all) = false; |
| 28 |
option (gogoproto.goproto_enum_stringer_all) = false; |
| 29 |
option (gogoproto.goproto_stringer_all) = false; |
| 30 |
option (gogoproto.goproto_unrecognized_all) = false; |
| 31 |
option (gogoproto.gostring_all) = true; |
| 32 |
option (gogoproto.marshaler_all) = true; |
| 33 |
option (gogoproto.populate_all) = true; |
| 34 |
option (gogoproto.protosizer_all) = true; |
| 35 |
option (gogoproto.stringer_all) = true; |
| 36 |
option (gogoproto.testgen_all) = true; |
| 37 |
option (gogoproto.unmarshaler_all) = true; |
| 38 |
option (gogoproto.verbose_equal_all) = true; |
| 39 |
|
| 40 |
// NOTES: (gogogo protobuf for idiomatic Golang) |
| 41 |
// - enum fields may be nullable if the default enum value is 0, otherwise the Golang zero-value of the enum isn't valid. |
| 42 |
// - enums that declare UNKNOWN or other commonly used tokens should specify the goproto_enum_prefix option. |
| 43 |
// - required fields are generally marked nullable |
| 44 |
// - arrays of non-native types are generally marked nullable |
| 45 |
// - fields w/ acronyms are generally renamed (via customname) to be idiomatic w/ respect to Golang |
| 46 |
// - fields w/ glued acronyms are also renamed at the author's discretion w/ respect to legibility |
| 47 |
|
| 48 |
/** |
| 49 |
* Status is used to indicate the state of the scheduler and executor |
| 50 |
* driver after function calls. |
| 51 |
*/ |
| 52 |
enum Status { |
| 53 |
DRIVER_NOT_STARTED = 1; |
| 54 |
DRIVER_RUNNING = 2; |
| 55 |
DRIVER_ABORTED = 3; |
| 56 |
DRIVER_STOPPED = 4; |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
/** |
| 61 |
* A unique ID assigned to a framework. A framework can reuse this ID |
| 62 |
* in order to do failover (see MesosSchedulerDriver). |
| 63 |
*/ |
| 64 |
message FrameworkID { |
| 65 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
/** |
| 70 |
* A unique ID assigned to an offer. |
| 71 |
*/ |
| 72 |
message OfferID { |
| 73 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
/** |
| 78 |
* A unique ID assigned to an agent. Currently, an agent gets a new ID |
| 79 |
* whenever it (re)registers with Mesos. Framework writers shouldn't |
| 80 |
* assume any binding between an agent ID and and a hostname. |
| 81 |
*/ |
| 82 |
message AgentID { |
| 83 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 84 |
} |
| 85 |
|
| 86 |
|
| 87 |
/** |
| 88 |
* A framework-generated ID to distinguish a task. The ID must remain |
| 89 |
* unique while the task is active. A framework can reuse an ID _only_ |
| 90 |
* if the previous task with the same ID has reached a terminal state |
| 91 |
* (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs |
| 92 |
* is strongly discouraged (MESOS-2198). |
| 93 |
*/ |
| 94 |
message TaskID { |
| 95 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
/** |
| 100 |
* A framework-generated ID to distinguish an executor. Only one |
| 101 |
* executor with the same ID can be active on the same agent at a |
| 102 |
* time. However, reusing executor IDs is discouraged. |
| 103 |
*/ |
| 104 |
message ExecutorID { |
| 105 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 106 |
} |
| 107 |
|
| 108 |
|
| 109 |
/** |
| 110 |
* ID used to uniquely identify a container. If the `parent` is not |
| 111 |
* specified, the ID is a UUID generated by the agent to uniquely |
| 112 |
* identify the container of an executor run. If the `parent` field is |
| 113 |
* specified, it represents a nested container. |
| 114 |
*/ |
| 115 |
message ContainerID { |
| 116 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 117 |
optional ContainerID parent = 2; |
| 118 |
} |
| 119 |
|
| 120 |
|
| 121 |
/** |
| 122 |
* A unique ID assigned to a resource provider. Currently, a resource |
| 123 |
* provider gets a new ID whenever it (re)registers with Mesos. |
| 124 |
*/ |
| 125 |
message ResourceProviderID { |
| 126 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 127 |
} |
| 128 |
|
| 129 |
|
| 130 |
/** |
| 131 |
* Represents time since the epoch, in nanoseconds. |
| 132 |
*/ |
| 133 |
message TimeInfo { |
| 134 |
required int64 nanoseconds = 1 [(gogoproto.nullable) = false]; |
| 135 |
} |
| 136 |
|
| 137 |
|
| 138 |
/** |
| 139 |
* Represents duration in nanoseconds. |
| 140 |
*/ |
| 141 |
message DurationInfo { |
| 142 |
required int64 nanoseconds = 1 [(gogoproto.nullable) = false]; |
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
/** |
| 147 |
* A network address. |
| 148 |
* |
| 149 |
* TODO(bmahler): Use this more widely. |
| 150 |
*/ |
| 151 |
message Address { |
| 152 |
// May contain a hostname, IP address, or both. |
| 153 |
optional string hostname = 1; |
| 154 |
optional string ip = 2 [(gogoproto.customname) = "IP"]; |
| 155 |
|
| 156 |
required int32 port = 3 [(gogoproto.nullable) = false]; |
| 157 |
} |
| 158 |
|
| 159 |
|
| 160 |
/** |
| 161 |
* Represents a URL. |
| 162 |
*/ |
| 163 |
message URL { |
| 164 |
required string scheme = 1 [(gogoproto.nullable) = false]; |
| 165 |
required Address address = 2 [(gogoproto.nullable) = false]; |
| 166 |
optional string path = 3; |
| 167 |
repeated Parameter query = 4 [(gogoproto.nullable) = false]; |
| 168 |
optional string fragment = 5; |
| 169 |
} |
| 170 |
|
| 171 |
|
| 172 |
/** |
| 173 |
* Represents an interval, from a given start time over a given duration. |
| 174 |
* This interval pertains to an unavailability event, such as maintenance, |
| 175 |
* and is not a generic interval. |
| 176 |
*/ |
| 177 |
message Unavailability { |
| 178 |
required TimeInfo start = 1 [(gogoproto.nullable) = false]; |
| 179 |
|
| 180 |
// When added to `start`, this represents the end of the interval. |
| 181 |
// If unspecified, the duration is assumed to be infinite. |
| 182 |
optional DurationInfo duration = 2; |
| 183 |
|
| 184 |
// TODO(josephw): Add additional fields for expressing the purpose and |
| 185 |
// urgency of the unavailability event. |
| 186 |
} |
| 187 |
|
| 188 |
|
| 189 |
/** |
| 190 |
* Represents a single machine, which may hold one or more agents. |
| 191 |
* |
| 192 |
* NOTE: In order to match an agent to a machine, both the `hostname` and |
| 193 |
* `ip` must match the values advertised by the agent to the master. |
| 194 |
* Hostname is not case-sensitive. |
| 195 |
*/ |
| 196 |
message MachineID { |
| 197 |
optional string hostname = 1; |
| 198 |
optional string ip = 2 [(gogoproto.customname) = "IP"]; |
| 199 |
} |
| 200 |
|
| 201 |
|
| 202 |
/** |
| 203 |
* Holds information about a single machine, its `mode`, and any other |
| 204 |
* relevant information which may affect the behavior of the machine. |
| 205 |
*/ |
| 206 |
message MachineInfo { |
| 207 |
// Describes the several states that a machine can be in. A `Mode` |
| 208 |
// applies to a machine and to all associated agents on the machine. |
| 209 |
enum Mode { |
| 210 |
// In this mode, a machine is behaving normally; |
| 211 |
// offering resources, executing tasks, etc. |
| 212 |
UP = 1; |
| 213 |
|
| 214 |
// In this mode, all agents on the machine are expected to cooperate with |
| 215 |
// frameworks to drain resources. In general, draining is done ahead of |
| 216 |
// a pending `unavailability`. The resources should be drained so as to |
| 217 |
// maximize utilization prior to the maintenance but without knowingly |
| 218 |
// violating the frameworks' requirements. |
| 219 |
DRAINING = 2; |
| 220 |
|
| 221 |
// In this mode, a machine is not running any tasks and will not offer |
| 222 |
// any of its resources. Agents on the machine will not be allowed to |
| 223 |
// register with the master. |
| 224 |
DOWN = 3; |
| 225 |
} |
| 226 |
|
| 227 |
required MachineID id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 228 |
optional Mode mode = 2; |
| 229 |
|
| 230 |
// Signifies that the machine may be unavailable during the given interval. |
| 231 |
// See comments in `Unavailability` and for the `unavailability` fields |
| 232 |
// in `Offer` and `InverseOffer` for more information. |
| 233 |
optional Unavailability unavailability = 3; |
| 234 |
} |
| 235 |
|
| 236 |
|
| 237 |
/** |
| 238 |
* Describes a framework. |
| 239 |
*/ |
| 240 |
message FrameworkInfo { |
| 241 |
// Used to determine the Unix user that an executor or task should be |
| 242 |
// launched as. |
| 243 |
// |
| 244 |
// When using the MesosSchedulerDriver, if the field is set to an |
| 245 |
// empty string, it will automagically set it to the current user. |
| 246 |
// |
| 247 |
// When using the HTTP Scheduler API, the user has to be set |
| 248 |
// explicitly. |
| 249 |
required string user = 1 [(gogoproto.nullable) = false]; |
| 250 |
|
| 251 |
// Name of the framework that shows up in the Mesos Web UI. |
| 252 |
required string name = 2 [(gogoproto.nullable) = false]; |
| 253 |
|
| 254 |
// Note that 'id' is only available after a framework has |
| 255 |
// registered, however, it is included here in order to facilitate |
| 256 |
// scheduler failover (i.e., if it is set then the |
| 257 |
// MesosSchedulerDriver expects the scheduler is performing |
| 258 |
// failover). |
| 259 |
optional FrameworkID id = 3 [(gogoproto.customname) = "ID"]; |
| 260 |
|
| 261 |
// The amount of time (in seconds) that the master will wait for the |
| 262 |
// scheduler to failover before it tears down the framework by |
| 263 |
// killing all its tasks/executors. This should be non-zero if a |
| 264 |
// framework expects to reconnect after a failure and not lose its |
| 265 |
// tasks/executors. |
| 266 |
// |
| 267 |
// NOTE: To avoid accidental destruction of tasks, production |
| 268 |
// frameworks typically set this to a large value (e.g., 1 week). |
| 269 |
optional double failover_timeout = 4 [default = 0.0]; |
| 270 |
|
| 271 |
// If set, agents running tasks started by this framework will write |
| 272 |
// the framework pid, executor pids and status updates to disk. If |
| 273 |
// the agent exits (e.g., due to a crash or as part of upgrading |
| 274 |
// Mesos), this checkpointed data allows the restarted agent to |
| 275 |
// reconnect to executors that were started by the old instance of |
| 276 |
// the agent. Enabling checkpointing improves fault tolerance, at |
| 277 |
// the cost of a (usually small) increase in disk I/O. |
| 278 |
optional bool checkpoint = 5 [default = false]; |
| 279 |
|
| 280 |
// Roles are the entities to which allocations are made. |
| 281 |
// The framework must have at least one role in order to |
| 282 |
// be offered resources. Note that `role` is deprecated |
| 283 |
// in favor of `roles` and only one of these fields must |
| 284 |
// be used. Since we cannot distinguish between empty |
| 285 |
// `roles` and the default unset `role`, we require that |
| 286 |
// frameworks set the `MULTI_ROLE` capability if |
| 287 |
// setting the `roles` field. |
| 288 |
optional string role = 6 [default = "*", deprecated=true]; |
| 289 |
repeated string roles = 12; |
| 290 |
|
| 291 |
// Used to indicate the current host from which the scheduler is |
| 292 |
// registered in the Mesos Web UI. If set to an empty string Mesos |
| 293 |
// will automagically set it to the current hostname if one is |
| 294 |
// available. |
| 295 |
optional string hostname = 7; |
| 296 |
|
| 297 |
// This field should match the credential's principal the framework |
| 298 |
// uses for authentication. This field is used for framework API |
| 299 |
// rate limiting and dynamic reservations. It should be set even |
| 300 |
// if authentication is not enabled if these features are desired. |
| 301 |
optional string principal = 8; |
| 302 |
|
| 303 |
// This field allows a framework to advertise its web UI, so that |
| 304 |
// the Mesos web UI can link to it. It is expected to be a full URL, |
| 305 |
// for example http://my-scheduler.example.com:8080/. |
| 306 |
optional string webui_url = 9 [(gogoproto.customname) = "WebUiURL"]; |
| 307 |
|
| 308 |
message Capability { |
| 309 |
enum Type { |
| 310 |
// This must be the first enum value in this list, to |
| 311 |
// ensure that if 'type' is not set, the default value |
| 312 |
// is UNKNOWN. This enables enum values to be added |
| 313 |
// in a backwards-compatible way. See: MESOS-4997. |
| 314 |
UNKNOWN = 0; |
| 315 |
|
| 316 |
// Receive offers with revocable resources. See 'Resource' |
| 317 |
// message for details. |
| 318 |
REVOCABLE_RESOURCES = 1; |
| 319 |
|
| 320 |
// Receive the TASK_KILLING TaskState when a task is being |
| 321 |
// killed by an executor. The executor will examine this |
| 322 |
// capability to determine whether it can send TASK_KILLING. |
| 323 |
TASK_KILLING_STATE = 2; |
| 324 |
|
| 325 |
// Indicates whether the framework is aware of GPU resources. |
| 326 |
// Frameworks that are aware of GPU resources are expected to |
| 327 |
// avoid placing non-GPU workloads on GPU agents, in order |
| 328 |
// to avoid occupying a GPU agent and preventing GPU workloads |
| 329 |
// from running! Currently, if a framework is unaware of GPU |
| 330 |
// resources, it will not be offered *any* of the resources on |
| 331 |
// an agent with GPUs. This restriction is in place because we |
| 332 |
// do not have a revocation mechanism that ensures GPU workloads |
| 333 |
// can evict GPU agent occupants if necessary. |
| 334 |
// |
| 335 |
// TODO(bmahler): As we add revocation we can relax the |
| 336 |
// restriction here. See MESOS-5634 for more information. |
| 337 |
GPU_RESOURCES = 3; |
| 338 |
|
| 339 |
// Receive offers with resources that are shared. |
| 340 |
SHARED_RESOURCES = 4; |
| 341 |
|
| 342 |
// Indicates that (1) the framework is prepared to handle the |
| 343 |
// following TaskStates: TASK_UNREACHABLE, TASK_DROPPED, |
| 344 |
// TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN, and (2) |
| 345 |
// the framework will assume responsibility for managing |
| 346 |
// partitioned tasks that reregister with the master. |
| 347 |
// |
| 348 |
// Frameworks that enable this capability can define how they |
| 349 |
// would like to handle partitioned tasks. Frameworks will |
| 350 |
// receive TASK_UNREACHABLE for tasks on agents that are |
| 351 |
// partitioned from the master. If/when a partitioned agent |
| 352 |
// reregisters, tasks on the agent that were started by |
| 353 |
// PARTITION_AWARE frameworks will not killed. |
| 354 |
// |
| 355 |
// Without this capability, frameworks will receive TASK_LOST |
| 356 |
// for tasks on partitioned agents; such tasks will be killed by |
| 357 |
// Mesos when the agent reregisters (unless the master has |
| 358 |
// failed over). |
| 359 |
PARTITION_AWARE = 5; |
| 360 |
|
| 361 |
// This expresses the ability for the framework to be |
| 362 |
// "multi-tenant" via using the newly introduced `roles` |
| 363 |
// field, and examining `Offer.allocation_info` to determine |
| 364 |
// which role the offers are being made to. We also |
| 365 |
// expect that "single-tenant" schedulers eventually |
| 366 |
// provide this and move away from the deprecated |
| 367 |
// `role` field. |
| 368 |
MULTI_ROLE = 6; |
| 369 |
|
| 370 |
// This capability has two effects for a framework. |
| 371 |
// |
| 372 |
// (1) The framework is offered resources in a new format. |
| 373 |
// |
| 374 |
// The offered resources have the `Resource.reservations` field set |
| 375 |
// rather than `Resource.role` and `Resource.reservation`. In short, |
| 376 |
// an empty `reservations` field denotes unreserved resources, and |
| 377 |
// each `ReservationInfo` in the `reservations` field denotes a |
| 378 |
// reservation that refines the previous one. |
| 379 |
// |
| 380 |
// See the 'Resource Format' section for more details. |
| 381 |
// |
| 382 |
// (2) The framework can create refined reservations. |
| 383 |
// |
| 384 |
// A framework can refine an existing reservation via the |
| 385 |
// `Resource.reservations` field. For example, a reservation for role |
| 386 |
// `eng` can be refined to `eng/front_end`. |
| 387 |
// |
| 388 |
// See `ReservationInfo.reservations` for more details. |
| 389 |
// |
| 390 |
// NOTE: Without this capability, a framework is not offered resources |
| 391 |
// that have refined reservations. A resource is said to have refined |
| 392 |
// reservations if it uses the `Resource.reservations` field, and |
| 393 |
// `Resource.reservations_size() > 1`. |
| 394 |
RESERVATION_REFINEMENT = 7; // EXPERIMENTAL. |
| 395 |
|
| 396 |
// Indicates that the framework is prepared to receive offers |
| 397 |
// for agents whose region is different from the master's |
| 398 |
// region. Network links between hosts in different regions |
| 399 |
// typically have higher latency and lower bandwidth than |
| 400 |
// network links within a region, so frameworks should be |
| 401 |
// careful to only place suitable workloads in remote regions. |
| 402 |
// Frameworks that are not region-aware will never receive |
| 403 |
// offers for remote agents; region-aware frameworks are assumed |
| 404 |
// to implement their own logic to decide which workloads (if |
| 405 |
// any) are suitable for placement on remote agents. |
| 406 |
REGION_AWARE = 8; |
| 407 |
|
| 408 |
option (gogoproto.goproto_enum_prefix) = true; |
| 409 |
} |
| 410 |
|
| 411 |
// Enum fields should be optional, see: MESOS-4997. |
| 412 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 413 |
} |
| 414 |
|
| 415 |
// This field allows a framework to advertise its set of |
| 416 |
// capabilities (e.g., ability to receive offers for revocable |
| 417 |
// resources). |
| 418 |
repeated Capability capabilities = 10 [(gogoproto.nullable) = false]; |
| 419 |
|
| 420 |
// Labels are free-form key value pairs supplied by the framework |
| 421 |
// scheduler (e.g., to describe additional functionality offered by |
| 422 |
// the framework). These labels are not interpreted by Mesos itself. |
| 423 |
// Labels should not contain duplicate key-value pairs. |
| 424 |
optional Labels labels = 11; |
| 425 |
} |
| 426 |
|
| 427 |
|
| 428 |
/** |
| 429 |
* Describes a general non-interpreting non-killing check for a task or |
| 430 |
* executor (or any arbitrary process/command). A type is picked by |
| 431 |
* specifying one of the optional fields. Specifying more than one type |
| 432 |
* is an error. |
| 433 |
* |
| 434 |
* NOTE: This API is unstable and the related feature is experimental. |
| 435 |
*/ |
| 436 |
message CheckInfo { |
| 437 |
enum Type { |
| 438 |
UNKNOWN = 0; |
| 439 |
COMMAND = 1; |
| 440 |
HTTP = 2; |
| 441 |
TCP = 3; |
| 442 |
|
| 443 |
// TODO(alexr): Consider supporting custom user checks. They should |
| 444 |
// probably be paired with a `data` field and complemented by a |
| 445 |
// `data` response in `CheckStatusInfo`. |
| 446 |
|
| 447 |
option (gogoproto.goproto_enum_prefix) = true; |
| 448 |
} |
| 449 |
|
| 450 |
// Describes a command check. If applicable, enters mount and/or network |
| 451 |
// namespaces of the task. |
| 452 |
message Command { |
| 453 |
required CommandInfo command = 1 [(gogoproto.nullable) = false]; |
| 454 |
} |
| 455 |
|
| 456 |
// Describes an HTTP check. Sends a GET request to |
| 457 |
// http://<host>:port/path. Note that <host> is not configurable and is |
| 458 |
// resolved automatically to 127.0.0.1. |
| 459 |
message Http { |
| 460 |
// Port to send the HTTP request. |
| 461 |
required uint32 port = 1 [(gogoproto.nullable) = false]; |
| 462 |
|
| 463 |
// HTTP request path. |
| 464 |
optional string path = 2; |
| 465 |
|
| 466 |
// TODO(alexr): Add support for HTTP method. While adding POST |
| 467 |
// and PUT is simple, supporting payload is more involved. |
| 468 |
|
| 469 |
// TODO(alexr): Add support for custom HTTP headers. |
| 470 |
|
| 471 |
// TODO(alexr): Consider adding an optional message to describe TLS |
| 472 |
// options and thus enabling https. Such message might contain certificate |
| 473 |
// validation, TLS version. |
| 474 |
} |
| 475 |
|
| 476 |
// Describes a TCP check, i.e. based on establishing a TCP connection to |
| 477 |
// the specified port. Note that <host> is not configurable and is resolved |
| 478 |
// automatically to 127.0.0.1. |
| 479 |
message Tcp { |
| 480 |
required uint32 port = 1 [(gogoproto.nullable) = false]; |
| 481 |
} |
| 482 |
|
| 483 |
// The type of the check. |
| 484 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 485 |
|
| 486 |
// Command check. |
| 487 |
optional Command command = 2; |
| 488 |
|
| 489 |
// HTTP check. |
| 490 |
optional Http http = 3 [(gogoproto.customname) = "HTTP"]; |
| 491 |
|
| 492 |
// TCP check. |
| 493 |
optional Tcp tcp = 7 [(gogoproto.customname) = "TCP"]; |
| 494 |
|
| 495 |
// Amount of time to wait to start checking the task after it |
| 496 |
// transitions to `TASK_RUNNING` or `TASK_STARTING` if the latter |
| 497 |
// is used by the executor. |
| 498 |
optional double delay_seconds = 4 [default = 15.0]; |
| 499 |
|
| 500 |
// Interval between check attempts, i.e., amount of time to wait after |
| 501 |
// the previous check finished or timed out to start the next check. |
| 502 |
optional double interval_seconds = 5 [default = 10.0]; |
| 503 |
|
| 504 |
// Amount of time to wait for the check to complete. Zero means infinite |
| 505 |
// timeout. |
| 506 |
// |
| 507 |
// After this timeout, the check attempt is aborted and no result is |
| 508 |
// reported. Note that this may be considered a state change and hence |
| 509 |
// may trigger a check status change delivery to the corresponding |
| 510 |
// scheduler. See `CheckStatusInfo` for more details. |
| 511 |
optional double timeout_seconds = 6 [default = 20.0]; |
| 512 |
} |
| 513 |
|
| 514 |
|
| 515 |
/** |
| 516 |
* Describes a health check for a task or executor (or any arbitrary |
| 517 |
* process/command). A type is picked by specifying one of the |
| 518 |
* optional fields. Specifying more than one type is an error. |
| 519 |
*/ |
| 520 |
message HealthCheck { |
| 521 |
enum Type { |
| 522 |
UNKNOWN = 0; |
| 523 |
COMMAND = 1; |
| 524 |
HTTP = 2; |
| 525 |
TCP = 3; |
| 526 |
|
| 527 |
option (gogoproto.goproto_enum_prefix) = true; |
| 528 |
} |
| 529 |
|
| 530 |
// Describes an HTTP health check. Sends a GET request to |
| 531 |
// scheme://<host>:port/path. Note that <host> is not configurable and is |
| 532 |
// resolved automatically, in most cases to 127.0.0.1. Default executors |
| 533 |
// treat return codes between 200 and 399 as success; custom executors |
| 534 |
// may employ a different strategy, e.g. leveraging the `statuses` field. |
| 535 |
message HTTPCheckInfo { |
| 536 |
// Currently "http" and "https" are supported. |
| 537 |
optional string scheme = 3; |
| 538 |
|
| 539 |
// Port to send the HTTP request. |
| 540 |
required uint32 port = 1 [(gogoproto.nullable) = false]; |
| 541 |
|
| 542 |
// HTTP request path. |
| 543 |
optional string path = 2; |
| 544 |
|
| 545 |
// TODO(alexr): Add support for HTTP method. While adding POST |
| 546 |
// and PUT is simple, supporting payload is more involved. |
| 547 |
|
| 548 |
// TODO(alexr): Add support for custom HTTP headers. |
| 549 |
|
| 550 |
// TODO(alexr): Add support for success and possibly failure |
| 551 |
// statuses. |
| 552 |
|
| 553 |
// NOTE: It is up to the custom executor to interpret and act on this |
| 554 |
// field. Setting this field has no effect on the default executors. |
| 555 |
// |
| 556 |
// TODO(haosdent): Deprecate this field when we add better support for |
| 557 |
// success and possibly failure statuses, e.g. ranges of success and |
| 558 |
// failure statuses. |
| 559 |
repeated uint32 statuses = 4; |
| 560 |
|
| 561 |
// TODO(haosdent): Consider adding a flag to enable task's certificate |
| 562 |
// validation for HTTPS health checks, see MESOS-5997. |
| 563 |
|
| 564 |
// TODO(benh): Include an 'optional bytes data' field for checking |
| 565 |
// for specific data in the response. |
| 566 |
} |
| 567 |
|
| 568 |
// Describes a TCP health check, i.e. based on establishing |
| 569 |
// a TCP connection to the specified port. |
| 570 |
message TCPCheckInfo { |
| 571 |
// Port expected to be open. |
| 572 |
required uint32 port = 1 [(gogoproto.nullable) = false]; |
| 573 |
} |
| 574 |
|
| 575 |
// TODO(benh): Consider adding a URL health check strategy which |
| 576 |
// allows doing something similar to the HTTP strategy but |
| 577 |
// encapsulates all the details in a single string field. |
| 578 |
|
| 579 |
// Amount of time to wait to start health checking the task after it |
| 580 |
// transitions to `TASK_RUNNING` or `TASK_STATING` if the latter is |
| 581 |
// used by the executor. |
| 582 |
optional double delay_seconds = 2 [default = 15.0]; |
| 583 |
|
| 584 |
// Interval between health checks, i.e., amount of time to wait after |
| 585 |
// the previous health check finished or timed out to start the next |
| 586 |
// health check. |
| 587 |
optional double interval_seconds = 3 [default = 10.0]; |
| 588 |
|
| 589 |
// Amount of time to wait for the health check to complete. After this |
| 590 |
// timeout, the health check is aborted and treated as a failure. Zero |
| 591 |
// means infinite timeout. |
| 592 |
optional double timeout_seconds = 4 [default = 20.0]; |
| 593 |
|
| 594 |
// Number of consecutive failures until the task is killed by the executor. |
| 595 |
optional uint32 consecutive_failures = 5 [default = 3]; |
| 596 |
|
| 597 |
// Amount of time after the task is launched during which health check |
| 598 |
// failures are ignored. Once a check succeeds for the first time, |
| 599 |
// the grace period does not apply anymore. Note that it includes |
| 600 |
// `delay_seconds`, i.e., setting `grace_period_seconds` < `delay_seconds` |
| 601 |
// has no effect. |
| 602 |
optional double grace_period_seconds = 6 [default = 10.0]; |
| 603 |
|
| 604 |
// TODO(alexr): Add an optional `KillPolicy` that should be used |
| 605 |
// if the task is killed because of a health check failure. |
| 606 |
|
| 607 |
// The type of health check. |
| 608 |
optional Type type = 8 [(gogoproto.nullable) = false]; |
| 609 |
|
| 610 |
// Command health check. |
| 611 |
optional CommandInfo command = 7; |
| 612 |
|
| 613 |
// HTTP health check. |
| 614 |
optional HTTPCheckInfo http = 1 [(gogoproto.customname) = "HTTP"]; |
| 615 |
|
| 616 |
// TCP health check. |
| 617 |
optional TCPCheckInfo tcp = 9 [(gogoproto.customname) = "TCP"]; |
| 618 |
} |
| 619 |
|
| 620 |
|
| 621 |
/** |
| 622 |
* Describes a kill policy for a task. Currently does not express |
| 623 |
* different policies (e.g. hitting HTTP endpoints), only controls |
| 624 |
* how long to wait between graceful and forcible task kill: |
| 625 |
* |
| 626 |
* graceful kill --------------> forcible kill |
| 627 |
* grace_period |
| 628 |
* |
| 629 |
* Kill policies are best-effort, because machine failures / forcible |
| 630 |
* terminations may occur. |
| 631 |
* |
| 632 |
* NOTE: For executor-less command-based tasks, the kill is performed |
| 633 |
* via sending a signal to the task process: SIGTERM for the graceful |
| 634 |
* kill and SIGKILL for the forcible kill. For the docker executor-less |
| 635 |
* tasks the grace period is passed to 'docker stop --time'. |
| 636 |
*/ |
| 637 |
message KillPolicy { |
| 638 |
// The grace period specifies how long to wait before forcibly |
| 639 |
// killing the task. It is recommended to attempt to gracefully |
| 640 |
// kill the task (and send TASK_KILLING) to indicate that the |
| 641 |
// graceful kill is in progress. Once the grace period elapses, |
| 642 |
// if the task has not terminated, a forcible kill should occur. |
| 643 |
// The task should not assume that it will always be allotted |
| 644 |
// the full grace period. For example, the executor may be |
| 645 |
// shutdown more quickly by the agent, or failures / forcible |
| 646 |
// terminations may occur. |
| 647 |
optional DurationInfo grace_period = 1; |
| 648 |
} |
| 649 |
|
| 650 |
|
| 651 |
/** |
| 652 |
* Describes a command, executed via: '/bin/sh -c value'. Any URIs specified |
| 653 |
* are fetched before executing the command. If the executable field for an |
| 654 |
* uri is set, executable file permission is set on the downloaded file. |
| 655 |
* Otherwise, if the downloaded file has a recognized archive extension |
| 656 |
* (currently [compressed] tar and zip) it is extracted into the executor's |
| 657 |
* working directory. This extraction can be disabled by setting `extract` to |
| 658 |
* false. In addition, any environment variables are set before executing |
| 659 |
* the command (so they can be used to "parameterize" your command). |
| 660 |
*/ |
| 661 |
message CommandInfo { |
| 662 |
message URI { |
| 663 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 664 |
optional bool executable = 2; |
| 665 |
|
| 666 |
// In case the fetched file is recognized as an archive, extract |
| 667 |
// its contents into the sandbox. Note that a cached archive is |
| 668 |
// not copied from the cache to the sandbox in case extraction |
| 669 |
// originates from an archive in the cache. |
| 670 |
optional bool extract = 3 [default = true]; |
| 671 |
|
| 672 |
// If this field is "true", the fetcher cache will be used. If not, |
| 673 |
// fetching bypasses the cache and downloads directly into the |
| 674 |
// sandbox directory, no matter whether a suitable cache file is |
| 675 |
// available or not. The former directs the fetcher to download to |
| 676 |
// the file cache, then copy from there to the sandbox. Subsequent |
| 677 |
// fetch attempts with the same URI will omit downloading and copy |
| 678 |
// from the cache as long as the file is resident there. Cache files |
| 679 |
// may get evicted at any time, which then leads to renewed |
| 680 |
// downloading. See also "docs/fetcher.md" and |
| 681 |
// "docs/fetcher-cache-internals.md". |
| 682 |
optional bool cache = 4; |
| 683 |
|
| 684 |
// The fetcher's default behavior is to use the URI string's basename to |
| 685 |
// name the local copy. If this field is provided, the local copy will be |
| 686 |
// named with its value instead. If there is a directory component (which |
| 687 |
// must be a relative path), the local copy will be stored in that |
| 688 |
// subdirectory inside the sandbox. |
| 689 |
optional string output_file = 5; |
| 690 |
} |
| 691 |
|
| 692 |
repeated URI uris = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "URIs"]; |
| 693 |
|
| 694 |
optional Environment environment = 2; |
| 695 |
|
| 696 |
// There are two ways to specify the command: |
| 697 |
// 1) If 'shell == true', the command will be launched via shell |
| 698 |
// (i.e., /bin/sh -c 'value'). The 'value' specified will be |
| 699 |
// treated as the shell command. The 'arguments' will be ignored. |
| 700 |
// 2) If 'shell == false', the command will be launched by passing |
| 701 |
// arguments to an executable. The 'value' specified will be |
| 702 |
// treated as the filename of the executable. The 'arguments' |
| 703 |
// will be treated as the arguments to the executable. This is |
| 704 |
// similar to how POSIX exec families launch processes (i.e., |
| 705 |
// execlp(value, arguments(0), arguments(1), ...)). |
| 706 |
// NOTE: The field 'value' is changed from 'required' to 'optional' |
| 707 |
// in 0.20.0. It will only cause issues if a new framework is |
| 708 |
// connecting to an old master. |
| 709 |
optional bool shell = 6 [default = true]; |
| 710 |
optional string value = 3; |
| 711 |
repeated string arguments = 7; |
| 712 |
|
| 713 |
// Enables executor and tasks to run as a specific user. If the user |
| 714 |
// field is present both in FrameworkInfo and here, the CommandInfo |
| 715 |
// user value takes precedence. |
| 716 |
optional string user = 5; |
| 717 |
} |
| 718 |
|
| 719 |
|
| 720 |
/** |
| 721 |
* Describes information about an executor. |
| 722 |
*/ |
| 723 |
message ExecutorInfo { |
| 724 |
enum Type { |
| 725 |
UNKNOWN = 0; |
| 726 |
|
| 727 |
// Mesos provides a simple built-in default executor that frameworks can |
| 728 |
// leverage to run shell commands and containers. |
| 729 |
// |
| 730 |
// NOTES: |
| 731 |
// |
| 732 |
// 1) `command` must not be set when using a default executor. |
| 733 |
// |
| 734 |
// 2) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP` |
| 735 |
// offer operation. |
| 736 |
// |
| 737 |
// 3) If `container` is set, `container.type` must be `MESOS` |
| 738 |
// and `container.mesos.image` must not be set. |
| 739 |
DEFAULT = 1; |
| 740 |
|
| 741 |
// For frameworks that need custom functionality to run tasks, a `CUSTOM` |
| 742 |
// executor can be used. Note that `command` must be set when using a |
| 743 |
// `CUSTOM` executor. |
| 744 |
CUSTOM = 2; |
| 745 |
|
| 746 |
option (gogoproto.goproto_enum_prefix) = true; |
| 747 |
} |
| 748 |
|
| 749 |
// For backwards compatibility, if this field is not set when using `LAUNCH` |
| 750 |
// offer operation, Mesos will infer the type by checking if `command` is |
| 751 |
// set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using |
| 752 |
// `LAUNCH_GROUP` offer operation. |
| 753 |
// |
| 754 |
// TODO(vinod): Add support for explicitly setting `type` to `DEFAULT ` |
| 755 |
// in `LAUNCH` offer operation. |
| 756 |
optional Type type = 15 [(gogoproto.nullable) = false]; |
| 757 |
|
| 758 |
required ExecutorID executor_id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ExecutorID"]; |
| 759 |
optional FrameworkID framework_id = 8 [(gogoproto.customname) = "FrameworkID"]; // TODO(benh): Make this required. |
| 760 |
optional CommandInfo command = 7; |
| 761 |
|
| 762 |
// Executor provided with a container will launch the container |
| 763 |
// with the executor's CommandInfo and we expect the container to |
| 764 |
// act as a Mesos executor. |
| 765 |
optional ContainerInfo container = 11; |
| 766 |
|
| 767 |
repeated Resource resources = 5 [(gogoproto.nullable) = false]; |
| 768 |
optional string name = 9; |
| 769 |
|
| 770 |
// 'source' is an identifier style string used by frameworks to |
| 771 |
// track the source of an executor. This is useful when it's |
| 772 |
// possible for different executor ids to be related semantically. |
| 773 |
// |
| 774 |
// NOTE: 'source' is exposed alongside the resource usage of the |
| 775 |
// executor via JSON on the agent. This allows users to import usage |
| 776 |
// information into a time series database for monitoring. |
| 777 |
// |
| 778 |
// This field is deprecated since 1.0. Please use labels for |
| 779 |
// free-form metadata instead. |
| 780 |
optional string source = 10 [deprecated = true]; // Since 1.0. |
| 781 |
|
| 782 |
// This field can be used to pass arbitrary bytes to an executor. |
| 783 |
optional bytes data = 4; |
| 784 |
|
| 785 |
// Service discovery information for the executor. It is not |
| 786 |
// interpreted or acted upon by Mesos. It is up to a service |
| 787 |
// discovery system to use this information as needed and to handle |
| 788 |
// executors without service discovery information. |
| 789 |
optional DiscoveryInfo discovery = 12; |
| 790 |
|
| 791 |
// When shutting down an executor the agent will wait in a |
| 792 |
// best-effort manner for the grace period specified here |
| 793 |
// before forcibly destroying the container. The executor |
| 794 |
// must not assume that it will always be allotted the full |
| 795 |
// grace period, as the agent may decide to allot a shorter |
| 796 |
// period and failures / forcible terminations may occur. |
| 797 |
optional DurationInfo shutdown_grace_period = 13; |
| 798 |
|
| 799 |
// Labels are free-form key value pairs which are exposed through |
| 800 |
// master and agent endpoints. Labels will not be interpreted or |
| 801 |
// acted upon by Mesos itself. As opposed to the data field, labels |
| 802 |
// will be kept in memory on master and agent processes. Therefore, |
| 803 |
// labels should be used to tag executors with lightweight metadata. |
| 804 |
// Labels should not contain duplicate key-value pairs. |
| 805 |
optional Labels labels = 14; |
| 806 |
} |
| 807 |
|
| 808 |
|
| 809 |
/** |
| 810 |
* Describes a domain. A domain is a collection of hosts that have |
| 811 |
* similar characteristics. Mesos currently only supports "fault |
| 812 |
* domains", which identify groups of hosts with similar failure |
| 813 |
* characteristics. |
| 814 |
* |
| 815 |
* Frameworks can generally assume that network links between hosts in |
| 816 |
* the same fault domain have lower latency, higher bandwidth, and better |
| 817 |
* availability than network links between hosts in different domains. |
| 818 |
* Schedulers may prefer to place network-intensive workloads in the |
| 819 |
* same domain, as this may improve performance. Conversely, a single |
| 820 |
* failure that affects a host in a domain may be more likely to |
| 821 |
* affect other hosts in the same domain; hence, schedulers may prefer |
| 822 |
* to place workloads that require high availability in multiple |
| 823 |
* domains. (For example, all the hosts in a single rack might lose |
| 824 |
* power or network connectivity simultaneously.) |
| 825 |
* |
| 826 |
* There are two kinds of fault domains: regions and zones. Regions |
| 827 |
* offer the highest degree of fault isolation, but network latency |
| 828 |
* between regions is typically high (typically >50 ms). Zones offer a |
| 829 |
* modest degree of fault isolation along with reasonably low network |
| 830 |
* latency (typically <10 ms). |
| 831 |
* |
| 832 |
* The mapping from fault domains to physical infrastructure is up to |
| 833 |
* the operator to configure. In cloud environments, regions and zones |
| 834 |
* can be mapped to the "region" and "availability zone" concepts |
| 835 |
* exposed by most cloud providers, respectively. In on-premise |
| 836 |
* deployments, regions and zones can be mapped to data centers and |
| 837 |
* racks, respectively. |
| 838 |
* |
| 839 |
* Both masters and agents can be configured with domains. Frameworks |
| 840 |
* can compare the domains of two hosts to determine if the hosts are |
| 841 |
* in the same zone, in different zones in the same region, or in |
| 842 |
* different regions. Note that all masters in a given Mesos cluster |
| 843 |
* must be in the same region. |
| 844 |
*/ |
| 845 |
message DomainInfo { |
| 846 |
message FaultDomain { |
| 847 |
message RegionInfo { |
| 848 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 849 |
} |
| 850 |
|
| 851 |
message ZoneInfo { |
| 852 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 853 |
} |
| 854 |
|
| 855 |
required RegionInfo region = 1 [(gogoproto.nullable) = false]; |
| 856 |
required ZoneInfo zone = 2 [(gogoproto.nullable) = false]; |
| 857 |
} |
| 858 |
|
| 859 |
optional FaultDomain fault_domain = 1; |
| 860 |
} |
| 861 |
|
| 862 |
|
| 863 |
/** |
| 864 |
* Describes a master. This will probably have more fields in the |
| 865 |
* future which might be used, for example, to link a framework webui |
| 866 |
* to a master webui. |
| 867 |
*/ |
| 868 |
message MasterInfo { |
| 869 |
required string id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 870 |
|
| 871 |
// The IP address (only IPv4) as a packed 4-bytes integer, |
| 872 |
// stored in network order. Deprecated, use `address.ip` instead. |
| 873 |
required uint32 ip = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "IP"]; |
| 874 |
|
| 875 |
// The TCP port the Master is listening on for incoming |
| 876 |
// HTTP requests; deprecated, use `address.port` instead. |
| 877 |
required uint32 port = 3 [default = 5050]; |
| 878 |
|
| 879 |
// In the default implementation, this will contain information |
| 880 |
// about both the IP address, port and Master name; it should really |
| 881 |
// not be relied upon by external tooling/frameworks and be |
| 882 |
// considered an "internal" implementation field. |
| 883 |
optional string pid = 4 [(gogoproto.customname) = "PID"]; |
| 884 |
|
| 885 |
// The server's hostname, if available; it may be unreliable |
| 886 |
// in environments where the DNS configuration does not resolve |
| 887 |
// internal hostnames (eg, some public cloud providers). |
| 888 |
// Deprecated, use `address.hostname` instead. |
| 889 |
optional string hostname = 5; |
| 890 |
|
| 891 |
// The running Master version, as a string; taken from the |
| 892 |
// generated "master/version.hpp". |
| 893 |
optional string version = 6; |
| 894 |
|
| 895 |
// The full IP address (supports both IPv4 and IPv6 formats) |
| 896 |
// and supersedes the use of `ip`, `port` and `hostname`. |
| 897 |
// Since Mesos 0.24. |
| 898 |
optional Address address = 7; |
| 899 |
|
| 900 |
// The domain that this master belongs to. All masters in a Mesos |
| 901 |
// cluster should belong to the same region. |
| 902 |
optional DomainInfo domain = 8; |
| 903 |
} |
| 904 |
|
| 905 |
|
| 906 |
/** |
| 907 |
* Describes an agent. Note that the 'id' field is only available |
| 908 |
* after an agent is registered with the master, and is made available |
| 909 |
* here to facilitate re-registration. |
| 910 |
*/ |
| 911 |
message AgentInfo { |
| 912 |
required string hostname = 1 [(gogoproto.nullable) = false]; |
| 913 |
optional int32 port = 8 [default = 5051]; |
| 914 |
|
| 915 |
// The configured resources at the agent. This does not include any |
| 916 |
// dynamic reservations or persistent volumes that may currently |
| 917 |
// exist at the agent. |
| 918 |
repeated Resource resources = 3 [(gogoproto.nullable) = false]; |
| 919 |
|
| 920 |
repeated Attribute attributes = 5 [(gogoproto.nullable) = false]; |
| 921 |
optional AgentID id = 6 [(gogoproto.customname) = "ID"]; |
| 922 |
|
| 923 |
// The domain that this agent belongs to. If the agent's region |
| 924 |
// differs from the master's region, it will not appear in resource |
| 925 |
// offers to frameworks that have not enabled the REGION_AWARE |
| 926 |
// capability. |
| 927 |
optional DomainInfo domain = 10; |
| 928 |
|
| 929 |
message Capability { |
| 930 |
enum Type { |
| 931 |
// This must be the first enum value in this list, to |
| 932 |
// ensure that if 'type' is not set, the default value |
| 933 |
// is UNKNOWN. This enables enum values to be added |
| 934 |
// in a backwards-compatible way. See: MESOS-4997. |
| 935 |
UNKNOWN = 0; |
| 936 |
|
| 937 |
// This expresses the ability for the agent to be able |
| 938 |
// to launch tasks of a 'multi-role' framework. |
| 939 |
MULTI_ROLE = 1; |
| 940 |
|
| 941 |
// This expresses the ability for the agent to be able to launch |
| 942 |
// tasks, reserve resources, and create volumes using resources |
| 943 |
// allocated to a 'hierarchical-role'. |
| 944 |
// NOTE: This capability is required specifically for creating |
| 945 |
// volumes because a hierchical role includes '/' (slashes) in them. |
| 946 |
// Agents with this capability know to transform the '/' (slashes) |
| 947 |
// into ' ' (spaces). |
| 948 |
HIERARCHICAL_ROLE = 2; |
| 949 |
|
| 950 |
// This capability has three effects for an agent. |
| 951 |
// |
| 952 |
// (1) The format of the checkpointed resources, and |
| 953 |
// the resources reported to master. |
| 954 |
// |
| 955 |
// These resources are reported in the "pre-reservation-refinement" |
| 956 |
// format if none of the resources have refined reservations. If any |
| 957 |
// of the resources have refined reservations, they are reported in |
| 958 |
// the "post-reservation-refinement" format. The purpose is to allow |
| 959 |
// downgrading of an agent as well as communication with a pre-1.4.0 |
| 960 |
// master until the reservation refinement feature is actually used. |
| 961 |
// |
| 962 |
// See the 'Resource Format' section for more details. |
| 963 |
// |
| 964 |
// (2) The format of the resources reported by the HTTP endpoints. |
| 965 |
// |
| 966 |
// For resources reported by agent endpoints, the |
| 967 |
// "pre-reservation-refinement" format is "injected" if possible. |
| 968 |
// That is, resources without refined reservations will have the |
| 969 |
// `Resource.role` and `Resource.reservation` set, whereas |
| 970 |
// resources with refined reservations will not. |
| 971 |
// |
| 972 |
// See the 'Resource Format' section for more details. |
| 973 |
// |
| 974 |
// (3) The ability for the agent to launch tasks, reserve resources, and |
| 975 |
// create volumes using resources that have refined reservations. |
| 976 |
// |
| 977 |
// See `ReservationInfo.reservations` section for more details. |
| 978 |
// |
| 979 |
// NOTE: Resources are said to have refined reservations if it uses the |
| 980 |
// `Resource.reservations` field, and `Resource.reservations_size() > 1`. |
| 981 |
RESERVATION_REFINEMENT = 3; |
| 982 |
|
| 983 |
option (gogoproto.goproto_enum_prefix) = true; |
| 984 |
} |
| 985 |
|
| 986 |
// Enum fields should be optional, see: MESOS-4997. |
| 987 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 988 |
} |
| 989 |
} |
| 990 |
|
| 991 |
|
| 992 |
/** |
| 993 |
* Describes a resource provider. Note that the 'id' field is only available |
| 994 |
* after a resource provider is registered with the master, and is made |
| 995 |
* available here to facilitate re-registration. |
| 996 |
*/ |
| 997 |
message ResourceProviderInfo { |
| 998 |
optional ResourceProviderID id = 1 [(gogoproto.customname) = "ID"]; |
| 999 |
repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; |
| 1000 |
|
| 1001 |
// The type of the resource provider. This uniquely identifies a |
| 1002 |
// resource provider implementation. For instance: |
| 1003 |
// org.apache.mesos.rp.local.storage |
| 1004 |
// |
| 1005 |
// Please follow to Java package naming convention |
| 1006 |
// (https://en.wikipedia.org/wiki/Java_package#Package_naming_conventions) |
| 1007 |
// to avoid conflicts on type names. |
| 1008 |
required string type = 3 [(gogoproto.nullable) = false]; |
| 1009 |
|
| 1010 |
// The name of the resource provider. There could be multiple |
| 1011 |
// instances of a type of resource provider. The name field is used |
| 1012 |
// to distinguish these instances. |
| 1013 |
required string name = 4 [(gogoproto.nullable) = false]; |
| 1014 |
} |
| 1015 |
|
| 1016 |
|
| 1017 |
/** |
| 1018 |
* Describes an Attribute or Resource "value". A value is described |
| 1019 |
* using the standard protocol buffer "union" trick. |
| 1020 |
*/ |
| 1021 |
message Value { |
| 1022 |
enum Type { |
| 1023 |
SCALAR = 0; |
| 1024 |
RANGES = 1; |
| 1025 |
SET = 2; |
| 1026 |
TEXT = 3; |
| 1027 |
} |
| 1028 |
|
| 1029 |
message Scalar { |
| 1030 |
// Scalar values are represented using floating point. To reduce |
| 1031 |
// the chance of unpredictable floating point behavior due to |
| 1032 |
// roundoff error, Mesos only supports three decimal digits of |
| 1033 |
// precision for scalar resource values. That is, floating point |
| 1034 |
// values are converted to a fixed point format that supports |
| 1035 |
// three decimal digits of precision, and then converted back to |
| 1036 |
// floating point on output. Any additional precision in scalar |
| 1037 |
// resource values is discarded (via rounding). |
| 1038 |
required double value = 1 [(gogoproto.nullable) = false]; |
| 1039 |
} |
| 1040 |
|
| 1041 |
message Range { |
| 1042 |
required uint64 begin = 1 [(gogoproto.nullable) = false]; |
| 1043 |
required uint64 end = 2 [(gogoproto.nullable) = false]; |
| 1044 |
} |
| 1045 |
|
| 1046 |
message Ranges { |
| 1047 |
repeated Range range = 1 [(gogoproto.nullable) = false]; |
| 1048 |
} |
| 1049 |
|
| 1050 |
message Set { |
| 1051 |
repeated string item = 1; |
| 1052 |
} |
| 1053 |
|
| 1054 |
message Text { |
| 1055 |
required string value = 1 [(gogoproto.nullable) = false]; |
| 1056 |
} |
| 1057 |
|
| 1058 |
required Type type = 1 [(gogoproto.nullable) = false]; |
| 1059 |
optional Scalar scalar = 2; |
| 1060 |
optional Ranges ranges = 3; |
| 1061 |
optional Set set = 4; |
| 1062 |
optional Text text = 5; |
| 1063 |
} |
| 1064 |
|
| 1065 |
|
| 1066 |
/** |
| 1067 |
* Describes an attribute that can be set on a machine. For now, |
| 1068 |
* attributes and resources share the same "value" type, but this may |
| 1069 |
* change in the future and attributes may only be string based. |
| 1070 |
*/ |
| 1071 |
message Attribute { |
| 1072 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 1073 |
required Value.Type type = 2 [(gogoproto.nullable) = false]; |
| 1074 |
optional Value.Scalar scalar = 3; |
| 1075 |
optional Value.Ranges ranges = 4; |
| 1076 |
optional Value.Set set = 6; |
| 1077 |
optional Value.Text text = 5; |
| 1078 |
} |
| 1079 |
|
| 1080 |
|
| 1081 |
/** |
| 1082 |
* Describes a resource from a resource provider. The `name` field is |
| 1083 |
* a string like "cpus" or "mem" that indicates which kind of resource |
| 1084 |
* this is; the rest of the fields describe the properties of the |
| 1085 |
* resource. A resource can take on one of three types: scalar |
| 1086 |
* (double), a list of finite and discrete ranges (e.g., [1-10, |
| 1087 |
* 20-30]), or a set of items. A resource is described using the |
| 1088 |
* standard protocol buffer "union" trick. |
| 1089 |
* |
| 1090 |
* Note that "disk" and "mem" resources are scalar values expressed in |
| 1091 |
* megabytes. Fractional "cpus" values are allowed (e.g., "0.5"), |
| 1092 |
* which correspond to partial shares of a CPU. |
| 1093 |
*/ |
| 1094 |
message Resource { |
| 1095 |
optional ResourceProviderID provider_id = 12 [(gogoproto.customname) = "ProviderID"]; |
| 1096 |
|
| 1097 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 1098 |
required Value.Type type = 2; |
| 1099 |
optional Value.Scalar scalar = 3; |
| 1100 |
optional Value.Ranges ranges = 4; |
| 1101 |
optional Value.Set set = 5; |
| 1102 |
|
| 1103 |
// The role that this resource is reserved for. If "*", this indicates |
| 1104 |
// that the resource is unreserved. Otherwise, the resource will only |
| 1105 |
// be offered to frameworks that belong to this role. |
| 1106 |
// |
| 1107 |
// NOTE: Frameworks must not set this field if `reservations` is set. |
| 1108 |
// See the 'Resource Format' section for more details. |
| 1109 |
// |
| 1110 |
// TODO(mpark): Deprecate once `reservations` is no longer experimental. |
| 1111 |
optional string role = 6 [default = "*", deprecated=true]; |
| 1112 |
|
| 1113 |
// This was initially introduced to support MULTI_ROLE capable |
| 1114 |
// frameworks. Frameworks that are not MULTI_ROLE capable can |
| 1115 |
// continue to assume that the offered resources are allocated |
| 1116 |
// to their role. |
| 1117 |
message AllocationInfo { |
| 1118 |
// If set, this resource is allocated to a role. Note that in the |
| 1119 |
// future, this may be unset and the scheduler may be responsible |
| 1120 |
// for allocating to one of its roles. |
| 1121 |
optional string role = 1; |
| 1122 |
|
| 1123 |
// In the future, we may add additional fields here, e.g. priority |
| 1124 |
// tier, type of allocation (quota / fair share). |
| 1125 |
} |
| 1126 |
|
| 1127 |
optional AllocationInfo allocation_info = 11; |
| 1128 |
|
| 1129 |
// Resource Format: |
| 1130 |
// |
| 1131 |
// Frameworks receive resource offers in one of two formats, depending on |
| 1132 |
// whether the RESERVATION_REFINEMENT capability is enabled. |
| 1133 |
// |
| 1134 |
// __WITHOUT__ the RESERVATION_REFINEMENT capability, the framework is offered |
| 1135 |
// resources in the "pre-reservation-refinement" format. In this format, the |
| 1136 |
// `Resource.role` and `Resource.reservation` fields are used in conjunction |
| 1137 |
// to describe the reservation state of a `Resource` message. |
| 1138 |
// |
| 1139 |
// The following is an overview of the possible reservation states: |
| 1140 |
// |
| 1141 |
// +------------+------------------------------------------------------------+ |
| 1142 |
// | unreserved | { | |
| 1143 |
// | | role: "*", | |
| 1144 |
// | | reservation: <not set>, | |
| 1145 |
// | | reservations: <unused> | |
| 1146 |
// | | } | |
| 1147 |
// +------------+------------------------------------------------------------+ |
| 1148 |
// | static | { | |
| 1149 |
// | | role: "eng", | |
| 1150 |
// | | reservation: <not set>, | |
| 1151 |
// | | reservations: <unused> | |
| 1152 |
// | | } | |
| 1153 |
// +------------+------------------------------------------------------------+ |
| 1154 |
// | dynamic | { | |
| 1155 |
// | | role: "eng", | |
| 1156 |
// | | reservation: { | |
| 1157 |
// | | type: <unused>, | |
| 1158 |
// | | role: <unused>, | |
| 1159 |
// | | principal: <optional>, | |
| 1160 |
// | | labels: <optional> | |
| 1161 |
// | | }, | |
| 1162 |
// | | reservations: <unused> | |
| 1163 |
// | | } | |
| 1164 |
// +------------+------------------------------------------------------------+ |
| 1165 |
// |
| 1166 |
// __WITH__ the RESERVATION_REFINEMENT capability, the framework is offered |
| 1167 |
// resources in the "post-reservation-refinement" format. In this format, the |
| 1168 |
// reservation state of a `Resource` message is expressed solely in |
| 1169 |
// `Resource.reservations` field. |
| 1170 |
// |
| 1171 |
// The following is an overview of the possible reservation states: |
| 1172 |
// |
| 1173 |
// +------------+------------------------------------------------------------+ |
| 1174 |
// | unreserved | { | |
| 1175 |
// | | role: <unused>, | |
| 1176 |
// | | reservation: <unused>, | |
| 1177 |
// | | reservations: [] | |
| 1178 |
// | | } | |
| 1179 |
// +------------+------------------------------------------------------------+ |
| 1180 |
// | static | { | |
| 1181 |
// | | role: <unused>, | |
| 1182 |
// | | reservation: <unused>, | |
| 1183 |
// | | reservations: [ | |
| 1184 |
// | | { | |
| 1185 |
// | | type: STATIC, | |
| 1186 |
// | | role: "eng", | |
| 1187 |
// | | principal: <optional>, | |
| 1188 |
// | | labels: <optional> | |
| 1189 |
// | | } | |
| 1190 |
// | | ] | |
| 1191 |
// | | } | |
| 1192 |
// +------------+------------------------------------------------------------+ |
| 1193 |
// | dynamic | { | |
| 1194 |
// | | role: <unused>, | |
| 1195 |
// | | reservation: <unused>, | |
| 1196 |
// | | reservations: [ | |
| 1197 |
// | | { | |
| 1198 |
// | | type: DYNAMIC, | |
| 1199 |
// | | role: "eng", | |
| 1200 |
// | | principal: <optional>, | |
| 1201 |
// | | labels: <optional> | |
| 1202 |
// | | } | |
| 1203 |
// | | ] | |
| 1204 |
// | | } | |
| 1205 |
// +------------+------------------------------------------------------------+ |
| 1206 |
// |
| 1207 |
// We can also __refine__ reservations with this capability like so: |
| 1208 |
// |
| 1209 |
// +------------+------------------------------------------------------------+ |
| 1210 |
// | refined | { | |
| 1211 |
// | | role: <unused>, | |
| 1212 |
// | | reservation: <unused>, | |
| 1213 |
// | | reservations: [ | |
| 1214 |
// | | { | |
| 1215 |
// | | type: STATIC or DYNAMIC, | |
| 1216 |
// | | role: "eng", | |
| 1217 |
// | | principal: <optional>, | |
| 1218 |
// | | labels: <optional> | |
| 1219 |
// | | }, | |
| 1220 |
// | | { | |
| 1221 |
// | | type: DYNAMIC, | |
| 1222 |
// | | role: "eng/front_end", | |
| 1223 |
// | | principal: <optional>, | |
| 1224 |
// | | labels: <optional> | |
| 1225 |
// | | } | |
| 1226 |
// | | ] | |
| 1227 |
// | | } | |
| 1228 |
// +------------+------------------------------------------------------------+ |
| 1229 |
// |
| 1230 |
// NOTE: Each `ReservationInfo` in the `reservations` field denotes |
| 1231 |
// a reservation that refines the previous `ReservationInfo`. |
| 1232 |
|
| 1233 |
message ReservationInfo { |
| 1234 |
// TODO(mpark): Explain the two resource formats. |
| 1235 |
|
| 1236 |
// Describes a reservation. A static reservation is set by the operator on |
| 1237 |
// the command-line and they are immutable without agent restart. A dynamic |
| 1238 |
// reservation is acquired by an operator via the '/reserve' HTTP endpoint |
| 1239 |
// or by a framework via the offer cycle by sending back an |
| 1240 |
// 'Offer::Operation::Reserve' message. |
| 1241 |
// NOTE: We currently do not allow frameworks with role "*" to make dynamic |
| 1242 |
// reservations. |
| 1243 |
|
| 1244 |
enum Type { |
| 1245 |
UNKNOWN = 0; |
| 1246 |
STATIC = 1; |
| 1247 |
DYNAMIC = 2; |
| 1248 |
|
| 1249 |
option (gogoproto.goproto_enum_prefix) = true; |
| 1250 |
} |
| 1251 |
|
| 1252 |
// The type of this reservation. |
| 1253 |
// NOTE: This field must not be set for `Resource.reservation`. |
| 1254 |
optional Type type = 4; |
| 1255 |
|
| 1256 |
// The role to which this reservation is made for. |
| 1257 |
// NOTE: This field must not be set for `Resource.reservation`. |
| 1258 |
optional string role = 3; |
| 1259 |
|
| 1260 |
// Indicates the principal, if any, of the framework or operator |
| 1261 |
// that reserved this resource. If reserved by a framework, the |
| 1262 |
// field should match the `FrameworkInfo.principal`. It is used in |
| 1263 |
// conjunction with the `UnreserveResources` ACL to determine |
| 1264 |
// whether the entity attempting to unreserve this resource is |
| 1265 |
// permitted to do so. |
| 1266 |
optional string principal = 1; |
| 1267 |
|
| 1268 |
// Labels are free-form key value pairs that can be used to |
| 1269 |
// associate arbitrary metadata with a reserved resource. For |
| 1270 |
// example, frameworks can use labels to identify the intended |
| 1271 |
// purpose for a portion of the resources the framework has |
| 1272 |
// reserved at a given agent. Labels should not contain duplicate |
| 1273 |
// key-value pairs. |
| 1274 |
optional Labels labels = 2; |
| 1275 |
} |
| 1276 |
|
| 1277 |
// If this is set, this resource was dynamically reserved by an |
| 1278 |
// operator or a framework. Otherwise, this resource is either unreserved |
| 1279 |
// or statically reserved by an operator via the --resources flag. |
| 1280 |
// NOTE: Frameworks must not set this field if `reservations` is set. |
| 1281 |
optional ReservationInfo reservation = 8; |
| 1282 |
|
| 1283 |
// The stack of reservations. If this field is empty, it indicates that this |
| 1284 |
// resource is unreserved. Otherwise, the resource is reserved. The first |
| 1285 |
// `ReservationInfo` may have type `STATIC` or `DYNAMIC`, but the rest must |
| 1286 |
// have `DYNAMIC`. One can create a new reservation on top of an existing |
| 1287 |
// one by pushing a new `ReservationInfo` to the back. The last |
| 1288 |
// `ReservationInfo` in this stack is the "current" reservation. The new |
| 1289 |
// reservation's role must be a child of the current reservation's role. |
| 1290 |
// NOTE: Frameworks must not set this field if `reservation` is set. |
| 1291 |
repeated ReservationInfo reservations = 13 [(gogoproto.nullable) = false]; // EXPERIMENTAL. |
| 1292 |
|
| 1293 |
message DiskInfo { |
| 1294 |
// Describes a persistent disk volume. |
| 1295 |
// |
| 1296 |
// A persistent disk volume will not be automatically garbage |
| 1297 |
// collected if the task/executor/agent terminates, but will be |
| 1298 |
// re-offered to the framework(s) belonging to the 'role'. |
| 1299 |
// |
| 1300 |
// NOTE: Currently, we do not allow persistent disk volumes |
| 1301 |
// without a reservation (i.e., 'role' cannot be '*'). |
| 1302 |
message Persistence { |
| 1303 |
// A unique ID for the persistent disk volume. This ID must be |
| 1304 |
// unique per role on each agent. Although it is possible to use |
| 1305 |
// the same ID on different agents in the cluster and to reuse |
| 1306 |
// IDs after a volume with that ID has been destroyed, both |
| 1307 |
// practices are discouraged. |
| 1308 |
required string id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 1309 |
|
| 1310 |
// This field indicates the principal of the operator or |
| 1311 |
// framework that created this volume. It is used in conjunction |
| 1312 |
// with the "destroy" ACL to determine whether an entity |
| 1313 |
// attempting to destroy the volume is permitted to do so. |
| 1314 |
// |
| 1315 |
// NOTE: This field should match the FrameworkInfo.principal of |
| 1316 |
// the framework that created the volume. |
| 1317 |
optional string principal = 2; |
| 1318 |
} |
| 1319 |
|
| 1320 |
optional Persistence persistence = 1; |
| 1321 |
|
| 1322 |
// Describes how this disk resource will be mounted in the |
| 1323 |
// container. If not set, the disk resource will be used as the |
| 1324 |
// sandbox. Otherwise, it will be mounted according to the |
| 1325 |
// 'container_path' inside 'volume'. The 'host_path' inside |
| 1326 |
// 'volume' is ignored. |
| 1327 |
// NOTE: If 'volume' is set but 'persistence' is not set, the |
| 1328 |
// volume will be automatically garbage collected after |
| 1329 |
// task/executor terminates. Currently, if 'persistence' is set, |
| 1330 |
// 'volume' must be set. |
| 1331 |
optional Volume volume = 2; |
| 1332 |
|
| 1333 |
// Describes where a disk originates from. |
| 1334 |
// TODO(jmlvanre): Add support for BLOCK devices. |
| 1335 |
message Source { |
| 1336 |
enum Type { |
| 1337 |
UNKNOWN = 0; |
| 1338 |
PATH = 1; |
| 1339 |
MOUNT = 2; |
| 1340 |
} |
| 1341 |
|
| 1342 |
// A folder that can be located on a separate disk device. This |
| 1343 |
// can be shared and carved up as necessary between frameworks. |
| 1344 |
message Path { |
| 1345 |
// Path to the folder (e.g., /mnt/raid/disk0). |
| 1346 |
optional string root = 1; |
| 1347 |
} |
| 1348 |
|
| 1349 |
// A mounted file-system set up by the Agent administrator. This |
| 1350 |
// can only be used exclusively: a framework cannot accept a |
| 1351 |
// partial amount of this disk. |
| 1352 |
message Mount { |
| 1353 |
// Path to mount point (e.g., /mnt/raid/disk0). |
| 1354 |
optional string root = 1; |
| 1355 |
} |
| 1356 |
|
| 1357 |
required Type type = 1 [(gogoproto.nullable) = false]; |
| 1358 |
optional Path path = 2; |
| 1359 |
optional Mount mount = 3; |
| 1360 |
} |
| 1361 |
|
| 1362 |
optional Source source = 3; |
| 1363 |
} |
| 1364 |
|
| 1365 |
optional DiskInfo disk = 7; |
| 1366 |
|
| 1367 |
message RevocableInfo {} |
| 1368 |
|
| 1369 |
// If this is set, the resources are revocable, i.e., any tasks or |
| 1370 |
// executors launched using these resources could get preempted or |
| 1371 |
// throttled at any time. This could be used by frameworks to run |
| 1372 |
// best effort tasks that do not need strict uptime or performance |
| 1373 |
// guarantees. Note that if this is set, 'disk' or 'reservation' |
| 1374 |
// cannot be set. |
| 1375 |
optional RevocableInfo revocable = 9; |
| 1376 |
|
| 1377 |
// Allow the resource to be shared across tasks. |
| 1378 |
message SharedInfo {} |
| 1379 |
|
| 1380 |
// If this is set, the resources are shared, i.e. multiple tasks |
| 1381 |
// can be launched using this resource and all of them shall refer |
| 1382 |
// to the same physical resource on the cluster. Note that only |
| 1383 |
// persistent volumes can be shared currently. |
| 1384 |
optional SharedInfo shared = 10; |
| 1385 |
} |
| 1386 |
|
| 1387 |
|
| 1388 |
/** |
| 1389 |
* When the network bandwidth caps are enabled and the container |
| 1390 |
* is over its limit, outbound packets may be either delayed or |
| 1391 |
* dropped completely either because it exceeds the maximum bandwidth |
| 1392 |
* allocation for a single container (the cap) or because the combined |
| 1393 |
* network traffic of multiple containers on the host exceeds the |
| 1394 |
* transmit capacity of the host (the share). We can report the |
| 1395 |
* following statistics for each of these conditions exported directly |
| 1396 |
* from the Linux Traffic Control Queueing Discipline. |
| 1397 |
* |
| 1398 |
* id : name of the limiter, e.g. 'tx_bw_cap' |
| 1399 |
* backlog : number of packets currently delayed |
| 1400 |
* bytes : total bytes seen |
| 1401 |
* drops : number of packets dropped in total |
| 1402 |
* overlimits : number of packets which exceeded allocation |
| 1403 |
* packets : total packets seen |
| 1404 |
* qlen : number of packets currently queued |
| 1405 |
* rate_bps : throughput in bytes/sec |
| 1406 |
* rate_pps : throughput in packets/sec |
| 1407 |
* requeues : number of times a packet has been delayed due to |
| 1408 |
* locking or device contention issues |
| 1409 |
* |
| 1410 |
* More information on the operation of Linux Traffic Control can be |
| 1411 |
* found at http://www.lartc.org/lartc.html. |
| 1412 |
*/ |
| 1413 |
message TrafficControlStatistics { |
| 1414 |
required string id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 1415 |
optional uint64 backlog = 2; |
| 1416 |
optional uint64 bytes = 3; |
| 1417 |
optional uint64 drops = 4; |
| 1418 |
optional uint64 overlimits = 5; |
| 1419 |
optional uint64 packets = 6; |
| 1420 |
optional uint64 qlen = 7; |
| 1421 |
optional uint64 ratebps = 8 [(gogoproto.customname) = "RateBPS"]; |
| 1422 |
optional uint64 ratepps = 9 [(gogoproto.customname) = "RatePPS"]; |
| 1423 |
optional uint64 requeues = 10; |
| 1424 |
} |
| 1425 |
|
| 1426 |
|
| 1427 |
message IpStatistics { |
| 1428 |
optional int64 Forwarding = 1; |
| 1429 |
optional int64 DefaultTTL = 2; |
| 1430 |
optional int64 InReceives = 3; |
| 1431 |
optional int64 InHdrErrors = 4; |
| 1432 |
optional int64 InAddrErrors = 5; |
| 1433 |
optional int64 ForwDatagrams = 6; |
| 1434 |
optional int64 InUnknownProtos = 7; |
| 1435 |
optional int64 InDiscards = 8; |
| 1436 |
optional int64 InDelivers = 9; |
| 1437 |
optional int64 OutRequests = 10; |
| 1438 |
optional int64 OutDiscards = 11; |
| 1439 |
optional int64 OutNoRoutes = 12; |
| 1440 |
optional int64 ReasmTimeout = 13; |
| 1441 |
optional int64 ReasmReqds = 14; |
| 1442 |
optional int64 ReasmOKs = 15; |
| 1443 |
optional int64 ReasmFails = 16; |
| 1444 |
optional int64 FragOKs = 17; |
| 1445 |
optional int64 FragFails = 18; |
| 1446 |
optional int64 FragCreates = 19; |
| 1447 |
} |
| 1448 |
|
| 1449 |
|
| 1450 |
message IcmpStatistics { |
| 1451 |
optional int64 InMsgs = 1; |
| 1452 |
optional int64 InErrors = 2; |
| 1453 |
optional int64 InCsumErrors = 3; |
| 1454 |
optional int64 InDestUnreachs = 4; |
| 1455 |
optional int64 InTimeExcds = 5; |
| 1456 |
optional int64 InParmProbs = 6; |
| 1457 |
optional int64 InSrcQuenchs = 7; |
| 1458 |
optional int64 InRedirects = 8; |
| 1459 |
optional int64 InEchos = 9; |
| 1460 |
optional int64 InEchoReps = 10; |
| 1461 |
optional int64 InTimestamps = 11; |
| 1462 |
optional int64 InTimestampReps = 12; |
| 1463 |
optional int64 InAddrMasks = 13; |
| 1464 |
optional int64 InAddrMaskReps = 14; |
| 1465 |
optional int64 OutMsgs = 15; |
| 1466 |
optional int64 OutErrors = 16; |
| 1467 |
optional int64 OutDestUnreachs = 17; |
| 1468 |
optional int64 OutTimeExcds = 18; |
| 1469 |
optional int64 OutParmProbs = 19; |
| 1470 |
optional int64 OutSrcQuenchs = 20; |
| 1471 |
optional int64 OutRedirects = 21; |
| 1472 |
optional int64 OutEchos = 22; |
| 1473 |
optional int64 OutEchoReps = 23; |
| 1474 |
optional int64 OutTimestamps = 24; |
| 1475 |
optional int64 OutTimestampReps = 25; |
| 1476 |
optional int64 OutAddrMasks = 26; |
| 1477 |
optional int64 OutAddrMaskReps = 27; |
| 1478 |
} |
| 1479 |
|
| 1480 |
|
| 1481 |
message TcpStatistics { |
| 1482 |
optional int64 RtoAlgorithm = 1; |
| 1483 |
optional int64 RtoMin = 2; |
| 1484 |
optional int64 RtoMax = 3; |
| 1485 |
optional int64 MaxConn = 4; |
| 1486 |
optional int64 ActiveOpens = 5; |
| 1487 |
optional int64 PassiveOpens = 6; |
| 1488 |
optional int64 AttemptFails = 7; |
| 1489 |
optional int64 EstabResets = 8; |
| 1490 |
optional int64 CurrEstab = 9; |
| 1491 |
optional int64 InSegs = 10; |
| 1492 |
optional int64 OutSegs = 11; |
| 1493 |
optional int64 RetransSegs = 12; |
| 1494 |
optional int64 InErrs = 13; |
| 1495 |
optional int64 OutRsts = 14; |
| 1496 |
optional int64 InCsumErrors = 15; |
| 1497 |
} |
| 1498 |
|
| 1499 |
|
| 1500 |
message UdpStatistics { |
| 1501 |
optional int64 InDatagrams = 1; |
| 1502 |
optional int64 NoPorts = 2; |
| 1503 |
optional int64 InErrors = 3; |
| 1504 |
optional int64 OutDatagrams = 4; |
| 1505 |
optional int64 RcvbufErrors = 5; |
| 1506 |
optional int64 SndbufErrors = 6; |
| 1507 |
optional int64 InCsumErrors = 7; |
| 1508 |
optional int64 IgnoredMulti = 8; |
| 1509 |
} |
| 1510 |
|
| 1511 |
|
| 1512 |
message SNMPStatistics { |
| 1513 |
optional IpStatistics ip_stats = 1 [(gogoproto.customname) = "IPStats"]; |
| 1514 |
optional IcmpStatistics icmp_stats = 2 [(gogoproto.customname) = "ICMPStats"]; |
| 1515 |
optional TcpStatistics tcp_stats = 3 [(gogoproto.customname) = "TCPStats"]; |
| 1516 |
optional UdpStatistics udp_stats = 4 [(gogoproto.customname) = "UDPStats"]; |
| 1517 |
} |
| 1518 |
|
| 1519 |
|
| 1520 |
message DiskStatistics { |
| 1521 |
optional Resource.DiskInfo.Source source = 1; |
| 1522 |
optional Resource.DiskInfo.Persistence persistence = 2; |
| 1523 |
optional uint64 limit_bytes = 3; |
| 1524 |
optional uint64 used_bytes = 4; |
| 1525 |
} |
| 1526 |
|
| 1527 |
|
| 1528 |
/** |
| 1529 |
* A snapshot of resource usage statistics. |
| 1530 |
*/ |
| 1531 |
message ResourceStatistics { |
| 1532 |
required double timestamp = 1 [(gogoproto.nullable) = false]; // Snapshot time, in seconds since the Epoch. |
| 1533 |
|
| 1534 |
optional uint32 processes = 30; |
| 1535 |
optional uint32 threads = 31; |
| 1536 |
|
| 1537 |
// CPU Usage Information: |
| 1538 |
// Total CPU time spent in user mode, and kernel mode. |
| 1539 |
optional double cpus_user_time_secs = 2 [(gogoproto.customname) = "CPUsUserTimeSecs"]; |
| 1540 |
optional double cpus_system_time_secs = 3 [(gogoproto.customname) = "CPUsSystemTimeSecs"]; |
| 1541 |
|
| 1542 |
// Number of CPUs allocated. |
| 1543 |
optional double cpus_limit = 4 [(gogoproto.customname) = "CPUsLimit"]; |
| 1544 |
|
| 1545 |
// cpu.stat on process throttling (for contention issues). |
| 1546 |
optional uint32 cpus_nr_periods = 7 [(gogoproto.customname) = "CPUsNrPeriods"]; |
| 1547 |
optional uint32 cpus_nr_throttled = 8 [(gogoproto.customname) = "CPUsNrThrottled"]; |
| 1548 |
optional double cpus_throttled_time_secs = 9 [(gogoproto.customname) = "CPUsThrottledTimeSecs"]; |
| 1549 |
|
| 1550 |
// Memory Usage Information: |
| 1551 |
|
| 1552 |
// mem_total_bytes was added in 0.23.0 to represent the total memory |
| 1553 |
// of a process in RAM (as opposed to in Swap). This was previously |
| 1554 |
// reported as mem_rss_bytes, which was also changed in 0.23.0 to |
| 1555 |
// represent only the anonymous memory usage, to keep in sync with |
| 1556 |
// Linux kernel's (arguably erroneous) use of terminology. |
| 1557 |
optional uint64 mem_total_bytes = 36; |
| 1558 |
|
| 1559 |
// Total memory + swap usage. This is set if swap is enabled. |
| 1560 |
optional uint64 mem_total_memsw_bytes = 37; |
| 1561 |
|
| 1562 |
// Hard memory limit for a container. |
| 1563 |
optional uint64 mem_limit_bytes = 6; |
| 1564 |
|
| 1565 |
// Soft memory limit for a container. |
| 1566 |
optional uint64 mem_soft_limit_bytes = 38; |
| 1567 |
|
| 1568 |
// Broken out memory usage information: pagecache, rss (anonymous), |
| 1569 |
// mmaped files and swap. |
| 1570 |
|
| 1571 |
// TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in |
| 1572 |
// 0.23.0 and will be removed in 0.24.0. |
| 1573 |
optional uint64 mem_file_bytes = 10; |
| 1574 |
optional uint64 mem_anon_bytes = 11; |
| 1575 |
|
| 1576 |
// mem_cache_bytes is added in 0.23.0 to represent page cache usage. |
| 1577 |
optional uint64 mem_cache_bytes = 39; |
| 1578 |
|
| 1579 |
// Since 0.23.0, mem_rss_bytes is changed to represent only |
| 1580 |
// anonymous memory usage. Note that neither its requiredness, type, |
| 1581 |
// name nor numeric tag has been changed. |
| 1582 |
optional uint64 mem_rss_bytes = 5 [(gogoproto.customname) = "MemRSSBytes"]; |
| 1583 |
|
| 1584 |
optional uint64 mem_mapped_file_bytes = 12; |
| 1585 |
// This is only set if swap is enabled. |
| 1586 |
optional uint64 mem_swap_bytes = 40; |
| 1587 |
optional uint64 mem_unevictable_bytes = 41; |
| 1588 |
|
| 1589 |
// Number of occurrences of different levels of memory pressure |
| 1590 |
// events reported by memory cgroup. Pressure listening (re)starts |
| 1591 |
// with these values set to 0 when agent (re)starts. See |
| 1592 |
// https://www.kernel.org/doc/Documentation/cgroups/memory.txt for |
| 1593 |
// more details. |
| 1594 |
optional uint64 mem_low_pressure_counter = 32; |
| 1595 |
optional uint64 mem_medium_pressure_counter = 33; |
| 1596 |
optional uint64 mem_critical_pressure_counter = 34; |
| 1597 |
|
| 1598 |
// Disk Usage Information for executor working directory. |
| 1599 |
optional uint64 disk_limit_bytes = 26; |
| 1600 |
optional uint64 disk_used_bytes = 27; |
| 1601 |
|
| 1602 |
// Per disk (resource) statistics. |
| 1603 |
repeated DiskStatistics disk_statistics = 43 [(gogoproto.nullable) = false]; |
| 1604 |
|
| 1605 |
// Cgroups blkio statistics. |
| 1606 |
optional CgroupInfo.Blkio.Statistics blkio_statistics = 44; |
| 1607 |
|
| 1608 |
// Perf statistics. |
| 1609 |
optional PerfStatistics perf = 13; |
| 1610 |
|
| 1611 |
// Network Usage Information: |
| 1612 |
optional uint64 net_rx_packets = 14; |
| 1613 |
optional uint64 net_rx_bytes = 15; |
| 1614 |
optional uint64 net_rx_errors = 16; |
| 1615 |
optional uint64 net_rx_dropped = 17; |
| 1616 |
optional uint64 net_tx_packets = 18; |
| 1617 |
optional uint64 net_tx_bytes = 19; |
| 1618 |
optional uint64 net_tx_errors = 20; |
| 1619 |
optional uint64 net_tx_dropped = 21; |
| 1620 |
|
| 1621 |
// The kernel keeps track of RTT (round-trip time) for its TCP |
| 1622 |
// sockets. RTT is a way to tell the latency of a container. |
| 1623 |
optional double net_tcp_rtt_microsecs_p50 = 22 [(gogoproto.customname) = "NetTCPRttMicrosecsP50"]; |
| 1624 |
optional double net_tcp_rtt_microsecs_p90 = 23 [(gogoproto.customname) = "NetTCPRttMicrosecsP90"]; |
| 1625 |
optional double net_tcp_rtt_microsecs_p95 = 24 [(gogoproto.customname) = "NetTCPRttMicrosecsP95"]; |
| 1626 |
optional double net_tcp_rtt_microsecs_p99 = 25 [(gogoproto.customname) = "NetTCPRttMicrosecsP99"]; |
| 1627 |
|
| 1628 |
optional double net_tcp_active_connections = 28 [(gogoproto.customname) = "NetTCPActiveConnections"]; |
| 1629 |
optional double net_tcp_time_wait_connections = 29 [(gogoproto.customname) = "NetTCPTimeWaitConnections"]; |
| 1630 |
|
| 1631 |
// Network traffic flowing into or out of a container can be delayed |
| 1632 |
// or dropped due to congestion or policy inside and outside the |
| 1633 |
// container. |
| 1634 |
repeated TrafficControlStatistics net_traffic_control_statistics = 35 [(gogoproto.nullable) = false]; |
| 1635 |
|
| 1636 |
// Network SNMP statistics for each container. |
| 1637 |
optional SNMPStatistics net_snmp_statistics = 42 [(gogoproto.customname) = "NetSNMPStatistics"]; |
| 1638 |
} |
| 1639 |
|
| 1640 |
|
| 1641 |
/** |
| 1642 |
* Describes a snapshot of the resource usage for executors. |
| 1643 |
*/ |
| 1644 |
message ResourceUsage { |
| 1645 |
message Executor { |
| 1646 |
required ExecutorInfo executor_info = 1 [(gogoproto.nullable) = false]; |
| 1647 |
|
| 1648 |
// This includes resources used by the executor itself |
| 1649 |
// as well as its active tasks. |
| 1650 |
repeated Resource allocated = 2 [(gogoproto.nullable) = false]; |
| 1651 |
|
| 1652 |
// Current resource usage. If absent, the containerizer |
| 1653 |
// cannot provide resource usage. |
| 1654 |
optional ResourceStatistics statistics = 3; |
| 1655 |
|
| 1656 |
// The container id for the executor specified in the executor_info field. |
| 1657 |
required ContainerID container_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "ContainerID"]; |
| 1658 |
|
| 1659 |
message Task { |
| 1660 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 1661 |
required TaskID id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 1662 |
repeated Resource resources = 3 [(gogoproto.nullable) = false]; |
| 1663 |
optional Labels labels = 4; |
| 1664 |
} |
| 1665 |
|
| 1666 |
// Non-terminal tasks. |
| 1667 |
repeated Task tasks = 5 [(gogoproto.nullable) = false]; |
| 1668 |
} |
| 1669 |
|
| 1670 |
repeated Executor executors = 1 [(gogoproto.nullable) = false]; |
| 1671 |
|
| 1672 |
// Agent's total resources including checkpointed dynamic |
| 1673 |
// reservations and persistent volumes. |
| 1674 |
repeated Resource total = 2 [(gogoproto.nullable) = false]; |
| 1675 |
} |
| 1676 |
|
| 1677 |
|
| 1678 |
/** |
| 1679 |
* Describes a sample of events from "perf stat". Only available on |
| 1680 |
* Linux. |
| 1681 |
* |
| 1682 |
* NOTE: Each optional field matches the name of a perf event (see |
| 1683 |
* "perf list") with the following changes: |
| 1684 |
* 1. Names are downcased. |
| 1685 |
* 2. Hyphens ('-') are replaced with underscores ('_'). |
| 1686 |
* 3. Events with alternate names use the name "perf stat" returns, |
| 1687 |
* e.g., for the event "cycles OR cpu-cycles" perf always returns |
| 1688 |
* cycles. |
| 1689 |
*/ |
| 1690 |
message PerfStatistics { |
| 1691 |
required double timestamp = 1 [(gogoproto.nullable) = false]; // Start of sample interval, in seconds since the Epoch. |
| 1692 |
required double duration = 2 [(gogoproto.nullable) = false]; // Duration of sample interval, in seconds. |
| 1693 |
|
| 1694 |
// Hardware event. |
| 1695 |
optional uint64 cycles = 3; |
| 1696 |
optional uint64 stalled_cycles_frontend = 4; |
| 1697 |
optional uint64 stalled_cycles_backend = 5; |
| 1698 |
optional uint64 instructions = 6; |
| 1699 |
optional uint64 cache_references = 7; |
| 1700 |
optional uint64 cache_misses = 8; |
| 1701 |
optional uint64 branches = 9; |
| 1702 |
optional uint64 branch_misses = 10; |
| 1703 |
optional uint64 bus_cycles = 11; |
| 1704 |
optional uint64 ref_cycles = 12; |
| 1705 |
|
| 1706 |
// Software event. |
| 1707 |
optional double cpu_clock = 13 [(gogoproto.customname) = "CPUClock"]; |
| 1708 |
optional double task_clock = 14; |
| 1709 |
optional uint64 page_faults = 15; |
| 1710 |
optional uint64 minor_faults = 16; |
| 1711 |
optional uint64 major_faults = 17; |
| 1712 |
optional uint64 context_switches = 18; |
| 1713 |
optional uint64 cpu_migrations = 19 [(gogoproto.customname) = "CPUMigrations"]; |
| 1714 |
optional uint64 alignment_faults = 20; |
| 1715 |
optional uint64 emulation_faults = 21; |
| 1716 |
|
| 1717 |
// Hardware cache event. |
| 1718 |
optional uint64 l1_dcache_loads = 22; |
| 1719 |
optional uint64 l1_dcache_load_misses = 23; |
| 1720 |
optional uint64 l1_dcache_stores = 24; |
| 1721 |
optional uint64 l1_dcache_store_misses = 25; |
| 1722 |
optional uint64 l1_dcache_prefetches = 26; |
| 1723 |
optional uint64 l1_dcache_prefetch_misses = 27; |
| 1724 |
optional uint64 l1_icache_loads = 28; |
| 1725 |
optional uint64 l1_icache_load_misses = 29; |
| 1726 |
optional uint64 l1_icache_prefetches = 30; |
| 1727 |
optional uint64 l1_icache_prefetch_misses = 31; |
| 1728 |
optional uint64 llc_loads = 32 [(gogoproto.customname) = "LLCLoads"]; |
| 1729 |
optional uint64 llc_load_misses = 33 [(gogoproto.customname) = "LLCLoadMisses"]; |
| 1730 |
optional uint64 llc_stores = 34 [(gogoproto.customname) = "LLCStores"]; |
| 1731 |
optional uint64 llc_store_misses = 35 [(gogoproto.customname) = "LLCStoreMisses"]; |
| 1732 |
optional uint64 llc_prefetches = 36 [(gogoproto.customname) = "LLCPrefetches"]; |
| 1733 |
optional uint64 llc_prefetch_misses = 37 [(gogoproto.customname) = "LLCPrefetchMisses"]; |
| 1734 |
optional uint64 dtlb_loads = 38 [(gogoproto.customname) = "DTLBLoads"]; |
| 1735 |
optional uint64 dtlb_load_misses = 39 [(gogoproto.customname) = "DTLBLoadMisses"]; |
| 1736 |
optional uint64 dtlb_stores = 40 [(gogoproto.customname) = "DTLBStores"]; |
| 1737 |
optional uint64 dtlb_store_misses = 41 [(gogoproto.customname) = "DTLBStoreMisses"]; |
| 1738 |
optional uint64 dtlb_prefetches = 42 [(gogoproto.customname) = "DTLBPrefetches"]; |
| 1739 |
optional uint64 dtlb_prefetch_misses = 43 [(gogoproto.customname) = "DTLBPrefetchMisses"]; |
| 1740 |
optional uint64 itlb_loads = 44 [(gogoproto.customname) = "ITLBLoads"]; |
| 1741 |
optional uint64 itlb_load_misses = 45 [(gogoproto.customname) = "ITLBLoadMisses"]; |
| 1742 |
optional uint64 branch_loads = 46; |
| 1743 |
optional uint64 branch_load_misses = 47; |
| 1744 |
optional uint64 node_loads = 48; |
| 1745 |
optional uint64 node_load_misses = 49; |
| 1746 |
optional uint64 node_stores = 50; |
| 1747 |
optional uint64 node_store_misses = 51; |
| 1748 |
optional uint64 node_prefetches = 52; |
| 1749 |
optional uint64 node_prefetch_misses = 53; |
| 1750 |
} |
| 1751 |
|
| 1752 |
|
| 1753 |
/** |
| 1754 |
* Describes a request for resources that can be used by a framework |
| 1755 |
* to proactively influence the allocator. If 'agent_id' is provided |
| 1756 |
* then this request is assumed to only apply to resources on that |
| 1757 |
* agent. |
| 1758 |
*/ |
| 1759 |
message Request { |
| 1760 |
optional AgentID agent_id = 1 [(gogoproto.customname) = "AgentID"]; |
| 1761 |
repeated Resource resources = 2 [(gogoproto.nullable) = false]; |
| 1762 |
} |
| 1763 |
|
| 1764 |
|
| 1765 |
/** |
| 1766 |
* Describes some resources available on an agent. An offer only |
| 1767 |
* contains resources from a single agent. |
| 1768 |
*/ |
| 1769 |
message Offer { |
| 1770 |
required OfferID id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID"]; |
| 1771 |
required FrameworkID framework_id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "FrameworkID"]; |
| 1772 |
required AgentID agent_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "AgentID"]; |
| 1773 |
required string hostname = 4 [(gogoproto.nullable) = false]; |
| 1774 |
|
| 1775 |
// URL for reaching the agent running on the host. |
| 1776 |
optional URL url = 8 [(gogoproto.customname) = "URL"]; |
| 1777 |
|
| 1778 |
// The domain of the agent. |
| 1779 |
optional DomainInfo domain = 11; |
| 1780 |
|
| 1781 |
repeated Resource resources = 5 [(gogoproto.nullable) = false]; |
| 1782 |
repeated Attribute attributes = 7 [(gogoproto.nullable) = false]; |
| 1783 |
repeated ExecutorID executor_ids = 6 [(gogoproto.nullable) = false, (gogoproto.customname) = "ExecutorIDs"]; |
| 1784 |
|
| 1785 |
// Signifies that the resources in this Offer may be unavailable during |
| 1786 |
// the given interval. Any tasks launched using these resources may be |
| 1787 |
// killed when the interval arrives. For example, these resources may be |
| 1788 |
// part of a planned maintenance schedule. |
| 1789 |
// |
| 1790 |
// This field only provides information about a planned unavailability. |
| 1791 |
// The unavailability interval may not necessarily start at exactly this |
| 1792 |
// interval, nor last for exactly the duration of this interval. |
| 1793 |
// The unavailability may also be forever! See comments in |
| 1794 |
// `Unavailability` for more details. |
| 1795 |
optional Unavailability unavailability = 9; |
| 1796 |
|
| 1797 |
// An offer represents resources allocated to *one* of the |
| 1798 |
// roles managed by the scheduler. (Therefore, each |
| 1799 |
// `Offer.resources[i].allocation_info` will match the |
| 1800 |
// top level `Offer.allocation_info`). |
| 1801 |
optional Resource.AllocationInfo allocation_info = 10; |
| 1802 |
|
| 1803 |
// Defines an operation that can be performed against offers. |
| 1804 |
message Operation { |
| 1805 |
enum Type { |
| 1806 |
UNKNOWN = 0; |
| 1807 |
LAUNCH = 1; |
| 1808 |
LAUNCH_GROUP = 6; |
| 1809 |
RESERVE = 2; |
| 1810 |
UNRESERVE = 3; |
| 1811 |
CREATE = 4; |
| 1812 |
DESTROY = 5; |
| 1813 |
option (gogoproto.goproto_enum_prefix) = true; |
| 1814 |
} |
| 1815 |
|
| 1816 |
// TODO(vinod): Deprecate this in favor of `LaunchGroup` below. |
| 1817 |
message Launch { |
| 1818 |
repeated TaskInfo task_infos = 1 [(gogoproto.nullable) = false]; |
| 1819 |
} |
| 1820 |
|
| 1821 |
// Unlike `Launch` above, all the tasks in a `task_group` are |
| 1822 |
// atomically delivered to an executor. |
| 1823 |
// |
| 1824 |
// `NetworkInfo` set on executor will be shared by all tasks in |
| 1825 |
// the task group. |
| 1826 |
// |
| 1827 |
// TODO(vinod): Any volumes set on executor could be used by a |
| 1828 |
// task by explicitly setting `Volume.source` in its resources. |
| 1829 |
message LaunchGroup { |
| 1830 |
required ExecutorInfo executor = 1 [(gogoproto.nullable) = false]; |
| 1831 |
required TaskGroupInfo task_group = 2 [(gogoproto.nullable) = false]; |
| 1832 |
} |
| 1833 |
|
| 1834 |
message Reserve { |
| 1835 |
repeated Resource resources = 1 [(gogoproto.nullable) = false]; |
| 1836 |
} |
| 1837 |
|
| 1838 |
message Unreserve { |
| 1839 |
repeated Resource resources = 1 [(gogoproto.nullable) = false]; |
| 1840 |
} |
| 1841 |
|
| 1842 |
message Create { |
| 1843 |
repeated Resource volumes = 1 [(gogoproto.nullable) = false]; |
| 1844 |
} |
| 1845 |
|
| 1846 |
message Destroy { |
| 1847 |
repeated Resource volumes = 1 [(gogoproto.nullable) = false]; |
| 1848 |
} |
| 1849 |
|
| 1850 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 1851 |
optional Launch launch = 2; |
| 1852 |
optional LaunchGroup launch_group = 7; |
| 1853 |
optional Reserve reserve = 3; |
| 1854 |
optional Unreserve unreserve = 4; |
| 1855 |
optional Create create = 5; |
| 1856 |
optional Destroy destroy = 6; |
| 1857 |
} |
| 1858 |
} |
| 1859 |
|
| 1860 |
|
| 1861 |
/** |
| 1862 |
* A request to return some resources occupied by a framework. |
| 1863 |
*/ |
| 1864 |
message InverseOffer { |
| 1865 |
// This is the same OfferID as found in normal offers, which allows |
| 1866 |
// re-use of some of the OfferID-only messages. |
| 1867 |
required OfferID id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "OfferID"]; |
| 1868 |
|
| 1869 |
// URL for reaching the agent running on the host. This enables some |
| 1870 |
// optimizations as described in MESOS-3012, such as allowing the |
| 1871 |
// scheduler driver to bypass the master and talk directly with an agent. |
| 1872 |
optional URL url = 2 [(gogoproto.customname) = "URL"]; |
| 1873 |
|
| 1874 |
// The framework that should release its resources. |
| 1875 |
// If no specifics are provided (i.e. which agent), all the framework's |
| 1876 |
// resources are requested back. |
| 1877 |
required FrameworkID framework_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "FrameworkID"]; |
| 1878 |
|
| 1879 |
// Specified if the resources need to be released from a particular agent. |
| 1880 |
// All the framework's resources on this agent are requested back, |
| 1881 |
// unless further qualified by the `resources` field. |
| 1882 |
optional AgentID agent_id = 4 [(gogoproto.customname) = "AgentID"]; |
| 1883 |
|
| 1884 |
// This InverseOffer represents a planned unavailability event in the |
| 1885 |
// specified interval. Any tasks running on the given framework or agent |
| 1886 |
// may be killed when the interval arrives. Therefore, frameworks should |
| 1887 |
// aim to gracefully terminate tasks prior to the arrival of the interval. |
| 1888 |
// |
| 1889 |
// For reserved resources, the resources are expected to be returned to the |
| 1890 |
// framework after the unavailability interval. This is an expectation, |
| 1891 |
// not a guarantee. For example, if the unavailability duration is not set, |
| 1892 |
// the resources may be removed permanently. |
| 1893 |
// |
| 1894 |
// For other resources, there is no guarantee that requested resources will |
| 1895 |
// be returned after the unavailability interval. The allocator has no |
| 1896 |
// obligation to re-offer these resources to the prior framework after |
| 1897 |
// the unavailability. |
| 1898 |
required Unavailability unavailability = 5 [(gogoproto.nullable) = false]; |
| 1899 |
|
| 1900 |
// A list of resources being requested back from the framework, |
| 1901 |
// on the agent identified by `agent_id`. If no resources are specified |
| 1902 |
// then all resources are being requested back. For the purpose of |
| 1903 |
// maintenance, this field is always empty (maintenance always requests |
| 1904 |
// all resources back). |
| 1905 |
repeated Resource resources = 6 [(gogoproto.nullable) = false]; |
| 1906 |
|
| 1907 |
// TODO(josephw): Add additional options for narrowing down the resources |
| 1908 |
// being requested back. Such as specific executors, tasks, etc. |
| 1909 |
} |
| 1910 |
|
| 1911 |
|
| 1912 |
/** |
| 1913 |
* Describes a task. Passed from the scheduler all the way to an |
| 1914 |
* executor (see SchedulerDriver::launchTasks and |
| 1915 |
* Executor::launchTask). Either ExecutorInfo or CommandInfo should be set. |
| 1916 |
* A different executor can be used to launch this task, and subsequent tasks |
| 1917 |
* meant for the same executor can reuse the same ExecutorInfo struct. |
| 1918 |
*/ |
| 1919 |
message TaskInfo { |
| 1920 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 1921 |
required TaskID task_id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "TaskID"]; |
| 1922 |
required AgentID agent_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "AgentID"]; |
| 1923 |
repeated Resource resources = 4 [(gogoproto.nullable) = false]; |
| 1924 |
optional ExecutorInfo executor = 5; |
| 1925 |
optional CommandInfo command = 7; |
| 1926 |
|
| 1927 |
// Task provided with a container will launch the container as part |
| 1928 |
// of this task paired with the task's CommandInfo. |
| 1929 |
optional ContainerInfo container = 9; |
| 1930 |
|
| 1931 |
// A health check for the task. Implemented for executor-less |
| 1932 |
// command-based tasks. For tasks that specify an executor, it is |
| 1933 |
// the executor's responsibility to implement the health checking. |
| 1934 |
optional HealthCheck health_check = 8; |
| 1935 |
|
| 1936 |
// A general check for the task. Implemented for all built-in executors. |
| 1937 |
// For tasks that specify an executor, it is the executor's responsibility |
| 1938 |
// to implement checking support. Executors should (all built-in executors |
| 1939 |
// will) neither interpret nor act on the check's result. |
| 1940 |
// |
| 1941 |
// NOTE: Check support in built-in executors is experimental. |
| 1942 |
// |
| 1943 |
// TODO(alexr): Consider supporting multiple checks per task. |
| 1944 |
optional CheckInfo check = 13; |
| 1945 |
|
| 1946 |
// A kill policy for the task. Implemented for executor-less |
| 1947 |
// command-based and docker tasks. For tasks that specify an |
| 1948 |
// executor, it is the executor's responsibility to implement |
| 1949 |
// the kill policy. |
| 1950 |
optional KillPolicy kill_policy = 12; |
| 1951 |
|
| 1952 |
optional bytes data = 6; |
| 1953 |
|
| 1954 |
// Labels are free-form key value pairs which are exposed through |
| 1955 |
// master and agent endpoints. Labels will not be interpreted or |
| 1956 |
// acted upon by Mesos itself. As opposed to the data field, labels |
| 1957 |
// will be kept in memory on master and agent processes. Therefore, |
| 1958 |
// labels should be used to tag tasks with light-weight meta-data. |
| 1959 |
// Labels should not contain duplicate key-value pairs. |
| 1960 |
optional Labels labels = 10; |
| 1961 |
|
| 1962 |
// Service discovery information for the task. It is not interpreted |
| 1963 |
// or acted upon by Mesos. It is up to a service discovery system |
| 1964 |
// to use this information as needed and to handle tasks without |
| 1965 |
// service discovery information. |
| 1966 |
optional DiscoveryInfo discovery = 11; |
| 1967 |
} |
| 1968 |
|
| 1969 |
|
| 1970 |
/** |
| 1971 |
* Describes a group of tasks that belong to an executor. The |
| 1972 |
* executor will receive the task group in a single message to |
| 1973 |
* allow the group to be launched "atomically". |
| 1974 |
* |
| 1975 |
* NOTES: |
| 1976 |
* 1) `NetworkInfo` must not be set inside task's `ContainerInfo`. |
| 1977 |
* 2) `TaskInfo.executor` doesn't need to set. If set, it should match |
| 1978 |
* `LaunchGroup.executor`. |
| 1979 |
*/ |
| 1980 |
message TaskGroupInfo { |
| 1981 |
repeated TaskInfo tasks = 1 [(gogoproto.nullable) = false]; |
| 1982 |
} |
| 1983 |
|
| 1984 |
|
| 1985 |
// TODO(bmahler): Add executor_uuid here, and send it to the master. This will |
| 1986 |
// allow us to expose executor work directories for tasks in the webui when |
| 1987 |
// looking from the master level. Currently only the agent knows which run the |
| 1988 |
// task belongs to. |
| 1989 |
/** |
| 1990 |
* Describes a task, similar to `TaskInfo`. |
| 1991 |
* |
| 1992 |
* `Task` is used in some of the Mesos messages found below. |
| 1993 |
* `Task` is used instead of `TaskInfo` if: |
| 1994 |
* 1) we need additional IDs, such as a specific |
| 1995 |
* framework, executor, or agent; or |
| 1996 |
* 2) we do not need the additional data, such as the command run by the |
| 1997 |
* task or the health checks. These additional fields may be large and |
| 1998 |
* unnecessary for some Mesos messages. |
| 1999 |
* |
| 2000 |
* `Task` is generally constructed from a `TaskInfo`. See protobuf::createTask. |
| 2001 |
*/ |
| 2002 |
message Task { |
| 2003 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 2004 |
required TaskID task_id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "TaskID"]; |
| 2005 |
required FrameworkID framework_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "FrameworkID"]; |
| 2006 |
optional ExecutorID executor_id = 4 [(gogoproto.customname) = "ExecutorID"]; |
| 2007 |
required AgentID agent_id = 5 [(gogoproto.nullable) = false, (gogoproto.customname) = "AgentID"]; |
| 2008 |
required TaskState state = 6; // Latest state of the task. |
| 2009 |
repeated Resource resources = 7 [(gogoproto.nullable) = false]; |
| 2010 |
repeated TaskStatus statuses = 8 [(gogoproto.nullable) = false]; |
| 2011 |
|
| 2012 |
// These fields correspond to the state and uuid of the latest |
| 2013 |
// status update forwarded to the master. |
| 2014 |
// NOTE: Either both the fields must be set or both must be unset. |
| 2015 |
optional TaskState status_update_state = 9; |
| 2016 |
optional bytes status_update_uuid = 10 [(gogoproto.customname) = "StatusUpdateUUID"]; |
| 2017 |
|
| 2018 |
optional Labels labels = 11; |
| 2019 |
|
| 2020 |
// Service discovery information for the task. It is not interpreted |
| 2021 |
// or acted upon by Mesos. It is up to a service discovery system |
| 2022 |
// to use this information as needed and to handle tasks without |
| 2023 |
// service discovery information. |
| 2024 |
optional DiscoveryInfo discovery = 12; |
| 2025 |
|
| 2026 |
// Container information for the task. |
| 2027 |
optional ContainerInfo container = 13; |
| 2028 |
|
| 2029 |
// Specific user under which task is running. |
| 2030 |
optional string user = 14; |
| 2031 |
} |
| 2032 |
|
| 2033 |
|
| 2034 |
/** |
| 2035 |
* Describes possible task states. IMPORTANT: Mesos assumes tasks that |
| 2036 |
* enter terminal states (see below) imply the task is no longer |
| 2037 |
* running and thus clean up any thing associated with the task |
| 2038 |
* (ultimately offering any resources being consumed by that task to |
| 2039 |
* another task). |
| 2040 |
*/ |
| 2041 |
enum TaskState { |
| 2042 |
TASK_STAGING = 6; // Initial state. Framework status updates should not use. |
| 2043 |
TASK_STARTING = 0; // The task is being launched by the executor. |
| 2044 |
TASK_RUNNING = 1; |
| 2045 |
|
| 2046 |
// NOTE: This should only be sent when the framework has |
| 2047 |
// the TASK_KILLING_STATE capability. |
| 2048 |
TASK_KILLING = 8; // The task is being killed by the executor. |
| 2049 |
|
| 2050 |
TASK_FINISHED = 2; // TERMINAL: The task finished successfully. |
| 2051 |
TASK_FAILED = 3; // TERMINAL: The task failed to finish successfully. |
| 2052 |
TASK_KILLED = 4; // TERMINAL: The task was killed by the executor. |
| 2053 |
TASK_ERROR = 7; // TERMINAL: The task description contains an error. |
| 2054 |
|
| 2055 |
// In Mesos 1.3, this will only be sent when the framework does NOT |
| 2056 |
// opt-in to the PARTITION_AWARE capability. |
| 2057 |
// |
| 2058 |
// NOTE: This state is not always terminal. For example, tasks might |
| 2059 |
// transition from TASK_LOST to TASK_RUNNING or other states when a |
| 2060 |
// partitioned agent re-registers. |
| 2061 |
TASK_LOST = 5; // The task failed but can be rescheduled. |
| 2062 |
|
| 2063 |
// The following task states are only sent when the framework |
| 2064 |
// opts-in to the PARTITION_AWARE capability. |
| 2065 |
|
| 2066 |
// The task failed to launch because of a transient error. The |
| 2067 |
// task's executor never started running. Unlike TASK_ERROR, the |
| 2068 |
// task description is valid -- attempting to launch the task again |
| 2069 |
// may be successful. |
| 2070 |
TASK_DROPPED = 9; // TERMINAL. |
| 2071 |
|
| 2072 |
// The task was running on an agent that has lost contact with the |
| 2073 |
// master, typically due to a network failure or partition. The task |
| 2074 |
// may or may not still be running. |
| 2075 |
TASK_UNREACHABLE = 10; |
| 2076 |
|
| 2077 |
// The task is no longer running. This can occur if the agent has |
| 2078 |
// been terminated along with all of its tasks (e.g., the host that |
| 2079 |
// was running the agent was rebooted). It might also occur if the |
| 2080 |
// task was terminated due to an agent or containerizer error, or if |
| 2081 |
// the task was preempted by the QoS controller in an |
| 2082 |
// oversubscription scenario. |
| 2083 |
TASK_GONE = 11; // TERMINAL. |
| 2084 |
|
| 2085 |
// The task was running on an agent that the master cannot contact; |
| 2086 |
// the operator has asserted that the agent has been shutdown, but |
| 2087 |
// this has not been directly confirmed by the master. If the |
| 2088 |
// operator is correct, the task is not running and this is a |
| 2089 |
// terminal state; if the operator is mistaken, the task may still |
| 2090 |
// be running and might return to RUNNING in the future. |
| 2091 |
TASK_GONE_BY_OPERATOR = 12; |
| 2092 |
|
| 2093 |
// The master has no knowledge of the task. This is typically |
| 2094 |
// because either (a) the master never had knowledge of the task, or |
| 2095 |
// (b) the master forgot about the task because it garbage collected |
| 2096 |
// its metadata about the task. The task may or may not still be |
| 2097 |
// running. |
| 2098 |
TASK_UNKNOWN = 13; |
| 2099 |
} |
| 2100 |
|
| 2101 |
|
| 2102 |
/** |
| 2103 |
* Describes the status of a check. Type and the corresponding field, i.e., |
| 2104 |
* `command` or `http` must be set. If the result of the check is not available |
| 2105 |
* (e.g., the check timed out), these fields must contain empty messages, i.e., |
| 2106 |
* `exit_code` or `status_code` will be unset. |
| 2107 |
* |
| 2108 |
* NOTE: This API is unstable and the related feature is experimental. |
| 2109 |
*/ |
| 2110 |
message CheckStatusInfo { |
| 2111 |
message Command { |
| 2112 |
// Exit code of a command check. It is the result of calling |
| 2113 |
// `WEXITSTATUS()` on `waitpid()` termination information on |
| 2114 |
// Posix and calling `GetExitCodeProcess()` on Windows. |
| 2115 |
optional int32 exit_code = 1; |
| 2116 |
} |
| 2117 |
|
| 2118 |
message Http { |
| 2119 |
// HTTP status code of an HTTP check. |
| 2120 |
optional uint32 status_code = 1; |
| 2121 |
} |
| 2122 |
|
| 2123 |
message Tcp { |
| 2124 |
// Whether a TCP connection succeeded. |
| 2125 |
optional bool succeeded = 1; |
| 2126 |
} |
| 2127 |
|
| 2128 |
// TODO(alexr): Consider adding a `data` field, which can contain, e.g., |
| 2129 |
// truncated stdout/stderr output for command checks or HTTP response body |
| 2130 |
// for HTTP checks. Alternatively, it can be an even shorter `message` field |
| 2131 |
// containing the last line of stdout or Reason-Phrase of the status line of |
| 2132 |
// the HTTP response. |
| 2133 |
|
| 2134 |
// The type of the check this status corresponds to. |
| 2135 |
optional CheckInfo.Type type = 1; |
| 2136 |
|
| 2137 |
// Status of a command check. |
| 2138 |
optional Command command = 2; |
| 2139 |
|
| 2140 |
// Status of an HTTP check. |
| 2141 |
optional Http http = 3 [(gogoproto.customname) = "HTTP"]; |
| 2142 |
|
| 2143 |
// Status of a TCP check. |
| 2144 |
optional Tcp tcp = 4 [(gogoproto.customname) = "TCP"]; |
| 2145 |
|
| 2146 |
// TODO(alexr): Consider introducing a "last changed at" timestamp, since |
| 2147 |
// task status update's timestamp may not correspond to the last check's |
| 2148 |
// state, e.g., for reconciliation. |
| 2149 |
|
| 2150 |
// TODO(alexr): Consider introducing a `reason` enum here to explicitly |
| 2151 |
// distinguish between completed, delayed, and timed out checks. |
| 2152 |
} |
| 2153 |
|
| 2154 |
|
| 2155 |
/** |
| 2156 |
* Describes the current status of a task. |
| 2157 |
*/ |
| 2158 |
message TaskStatus { |
| 2159 |
// Describes the source of the task status update. |
| 2160 |
enum Source { |
| 2161 |
SOURCE_MASTER = 0; |
| 2162 |
SOURCE_AGENT = 1; |
| 2163 |
SOURCE_EXECUTOR = 2; |
| 2164 |
} |
| 2165 |
|
| 2166 |
// Detailed reason for the task status update. |
| 2167 |
// |
| 2168 |
// TODO(bmahler): Differentiate between agent removal reasons |
| 2169 |
// (e.g. unhealthy vs. unregistered for maintenance). |
| 2170 |
enum Reason { |
| 2171 |
// TODO(jieyu): The default value when a caller doesn't check for |
| 2172 |
// presence is 0 and so ideally the 0 reason is not a valid one. |
| 2173 |
// Since this is not used anywhere, consider removing this reason. |
| 2174 |
REASON_COMMAND_EXECUTOR_FAILED = 0; |
| 2175 |
|
| 2176 |
REASON_CONTAINER_LAUNCH_FAILED = 21; |
| 2177 |
REASON_CONTAINER_LIMITATION = 19; |
| 2178 |
REASON_CONTAINER_LIMITATION_DISK = 20; |
| 2179 |
REASON_CONTAINER_LIMITATION_MEMORY = 8; |
| 2180 |
REASON_CONTAINER_PREEMPTED = 17; |
| 2181 |
REASON_CONTAINER_UPDATE_FAILED = 22; |
| 2182 |
REASON_EXECUTOR_REGISTRATION_TIMEOUT = 23; |
| 2183 |
REASON_EXECUTOR_REREGISTRATION_TIMEOUT = 24; |
| 2184 |
REASON_EXECUTOR_TERMINATED = 1; |
| 2185 |
REASON_EXECUTOR_UNREGISTERED = 2; // No longer used. |
| 2186 |
REASON_FRAMEWORK_REMOVED = 3; |
| 2187 |
REASON_GC_ERROR = 4; |
| 2188 |
REASON_INVALID_FRAMEWORKID = 5; |
| 2189 |
REASON_INVALID_OFFERS = 6; |
| 2190 |
REASON_IO_SWITCHBOARD_EXITED = 27; |
| 2191 |
REASON_MASTER_DISCONNECTED = 7; |
| 2192 |
REASON_RECONCILIATION = 9; |
| 2193 |
REASON_RESOURCES_UNKNOWN = 18; |
| 2194 |
REASON_AGENT_DISCONNECTED = 10; |
| 2195 |
REASON_AGENT_REMOVED = 11; |
| 2196 |
REASON_AGENT_RESTARTED = 12; |
| 2197 |
REASON_AGENT_UNKNOWN = 13; |
| 2198 |
REASON_TASK_KILLED_DURING_LAUNCH = 30; |
| 2199 |
REASON_TASK_CHECK_STATUS_UPDATED = 28; |
| 2200 |
REASON_TASK_HEALTH_CHECK_STATUS_UPDATED = 29; |
| 2201 |
REASON_TASK_GROUP_INVALID = 25; |
| 2202 |
REASON_TASK_GROUP_UNAUTHORIZED = 26; |
| 2203 |
REASON_TASK_INVALID = 14; |
| 2204 |
REASON_TASK_UNAUTHORIZED = 15; |
| 2205 |
REASON_TASK_UNKNOWN = 16; |
| 2206 |
} |
| 2207 |
|
| 2208 |
required TaskID task_id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "TaskID"]; |
| 2209 |
required TaskState state = 2; |
| 2210 |
optional string message = 4; // Possible message explaining state. |
| 2211 |
optional Source source = 9; |
| 2212 |
optional Reason reason = 10; |
| 2213 |
optional bytes data = 3; |
| 2214 |
optional AgentID agent_id = 5 [(gogoproto.customname) = "AgentID"]; |
| 2215 |
optional ExecutorID executor_id = 7 [(gogoproto.customname) = "ExecutorID"]; // TODO(benh): Use in master/agent. |
| 2216 |
optional double timestamp = 6; |
| 2217 |
|
| 2218 |
// Statuses that are delivered reliably to the scheduler will |
| 2219 |
// include a 'uuid'. The status is considered delivered once |
| 2220 |
// it is acknowledged by the scheduler. Schedulers can choose |
| 2221 |
// to either explicitly acknowledge statuses or let the scheduler |
| 2222 |
// driver implicitly acknowledge (default). |
| 2223 |
// |
| 2224 |
// TODO(bmahler): This is currently overwritten in the scheduler |
| 2225 |
// driver and executor driver, but executors will need to set this |
| 2226 |
// to a valid RFC-4122 UUID if using the HTTP API. |
| 2227 |
optional bytes uuid = 11 [(gogoproto.customname) = "UUID"]; |
| 2228 |
|
| 2229 |
// Describes whether the task has been determined to be healthy (true) or |
| 2230 |
// unhealthy (false) according to the `health_check` field in `TaskInfo`. |
| 2231 |
optional bool healthy = 8; |
| 2232 |
|
| 2233 |
// Contains check status for the check specified in the corresponding |
| 2234 |
// `TaskInfo`. If no check has been specified, this field must be |
| 2235 |
// absent, otherwise it must be present even if the check status is |
| 2236 |
// not available yet. If the status update is triggered for a different |
| 2237 |
// reason than `REASON_TASK_CHECK_STATUS_UPDATED`, this field will contain |
| 2238 |
// the last known value. |
| 2239 |
// |
| 2240 |
// NOTE: A check-related task status update is triggered if and only if |
| 2241 |
// the value or presence of any field in `CheckStatusInfo` changes. |
| 2242 |
// |
| 2243 |
// NOTE: Check support in built-in executors is experimental. |
| 2244 |
optional CheckStatusInfo check_status = 15; |
| 2245 |
|
| 2246 |
// Labels are free-form key value pairs which are exposed through |
| 2247 |
// master and agent endpoints. Labels will not be interpreted or |
| 2248 |
// acted upon by Mesos itself. As opposed to the data field, labels |
| 2249 |
// will be kept in memory on master and agent processes. Therefore, |
| 2250 |
// labels should be used to tag TaskStatus message with light-weight |
| 2251 |
// meta-data. Labels should not contain duplicate key-value pairs. |
| 2252 |
optional Labels labels = 12; |
| 2253 |
|
| 2254 |
// Container related information that is resolved dynamically such as |
| 2255 |
// network address. |
| 2256 |
optional ContainerStatus container_status = 13; |
| 2257 |
|
| 2258 |
// The time (according to the master's clock) when the agent where |
| 2259 |
// this task was running became unreachable. This is only set on |
| 2260 |
// status updates for tasks running on agents that are unreachable |
| 2261 |
// (e.g., partitioned away from the master). |
| 2262 |
optional TimeInfo unreachable_time = 14; |
| 2263 |
} |
| 2264 |
|
| 2265 |
|
| 2266 |
/** |
| 2267 |
* Describes possible filters that can be applied to unused resources |
| 2268 |
* (see SchedulerDriver::launchTasks) to influence the allocator. |
| 2269 |
*/ |
| 2270 |
message Filters { |
| 2271 |
// Time to consider unused resources refused. Note that all unused |
| 2272 |
// resources will be considered refused and use the default value |
| 2273 |
// (below) regardless of whether Filters was passed to |
| 2274 |
// SchedulerDriver::launchTasks. You MUST pass Filters with this |
| 2275 |
// field set to change this behavior (i.e., get another offer which |
| 2276 |
// includes unused resources sooner or later than the default). |
| 2277 |
optional double refuse_seconds = 1 [default = 5.0]; |
| 2278 |
} |
| 2279 |
|
| 2280 |
|
| 2281 |
/** |
| 2282 |
* Describes a collection of environment variables. This is used with |
| 2283 |
* CommandInfo in order to set environment variables before running a |
| 2284 |
* command. The contents of each variable may be specified as a string |
| 2285 |
* or a Secret; only one of `value` and `secret` must be set. |
| 2286 |
*/ |
| 2287 |
message Environment { |
| 2288 |
message Variable { |
| 2289 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 2290 |
|
| 2291 |
enum Type { |
| 2292 |
UNKNOWN = 0; |
| 2293 |
VALUE = 1; |
| 2294 |
SECRET = 2; |
| 2295 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2296 |
} |
| 2297 |
|
| 2298 |
// In Mesos 1.2, the `Environment.variables.value` message was made |
| 2299 |
// optional. The default type for `Environment.variables.type` is now VALUE, |
| 2300 |
// which requires `value` to be set, maintaining backward compatibility. |
| 2301 |
// |
| 2302 |
// TODO(greggomann): The default can be removed in Mesos 2.1 (MESOS-7134). |
| 2303 |
optional Type type = 3 [default = VALUE]; |
| 2304 |
|
| 2305 |
// Only one of `value` and `secret` must be set. |
| 2306 |
optional string value = 2; |
| 2307 |
optional Secret secret = 4; |
| 2308 |
} |
| 2309 |
|
| 2310 |
repeated Variable variables = 1 [(gogoproto.nullable) = false]; |
| 2311 |
} |
| 2312 |
|
| 2313 |
|
| 2314 |
/** |
| 2315 |
* A generic (key, value) pair used in various places for parameters. |
| 2316 |
*/ |
| 2317 |
message Parameter { |
| 2318 |
required string key = 1 [(gogoproto.nullable) = false]; |
| 2319 |
required string value = 2 [(gogoproto.nullable) = false]; |
| 2320 |
} |
| 2321 |
|
| 2322 |
|
| 2323 |
/** |
| 2324 |
* Collection of Parameter. |
| 2325 |
*/ |
| 2326 |
message Parameters { |
| 2327 |
repeated Parameter parameter = 1 [(gogoproto.nullable) = false]; |
| 2328 |
} |
| 2329 |
|
| 2330 |
|
| 2331 |
/** |
| 2332 |
* Credential used in various places for authentication and |
| 2333 |
* authorization. |
| 2334 |
* |
| 2335 |
* NOTE: A 'principal' is different from 'FrameworkInfo.user'. The |
| 2336 |
* former is used for authentication and authorization while the |
| 2337 |
* latter is used to determine the default user under which the |
| 2338 |
* framework's executors/tasks are run. |
| 2339 |
*/ |
| 2340 |
message Credential { |
| 2341 |
required string principal = 1 [(gogoproto.nullable) = false]; |
| 2342 |
optional string secret = 2; |
| 2343 |
} |
| 2344 |
|
| 2345 |
|
| 2346 |
/** |
| 2347 |
* Credentials used for framework authentication, HTTP authentication |
| 2348 |
* (where the common 'username' and 'password' are captured as |
| 2349 |
* 'principal' and 'secret' respectively), etc. |
| 2350 |
*/ |
| 2351 |
message Credentials { |
| 2352 |
repeated Credential credentials = 1 [(gogoproto.nullable) = false]; |
| 2353 |
} |
| 2354 |
|
| 2355 |
|
| 2356 |
/** |
| 2357 |
* Secret used to pass privileged information. It is designed to provide |
| 2358 |
* pass-by-value or pass-by-reference semantics, where the REFERENCE type can be |
| 2359 |
* used by custom modules which interact with a secure back-end. |
| 2360 |
*/ |
| 2361 |
message Secret |
| 2362 |
{ |
| 2363 |
enum Type { |
| 2364 |
UNKNOWN = 0; |
| 2365 |
REFERENCE = 1; |
| 2366 |
VALUE = 2; |
| 2367 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2368 |
} |
| 2369 |
|
| 2370 |
// Can be used by modules to refer to a secret stored in a secure back-end. |
| 2371 |
// The `key` field is provided to permit reference to a single value within a |
| 2372 |
// secret containing arbitrary key-value pairs. |
| 2373 |
// |
| 2374 |
// For example, given a back-end secret store with a secret named |
| 2375 |
// "my-secret" containing the following key-value pairs: |
| 2376 |
// |
| 2377 |
// { |
| 2378 |
// "username": "my-user", |
| 2379 |
// "password": "my-password |
| 2380 |
// } |
| 2381 |
// |
| 2382 |
// the username could be referred to in a `Secret` by specifying |
| 2383 |
// "my-secret" for the `name` and "username" for the `key`. |
| 2384 |
message Reference |
| 2385 |
{ |
| 2386 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 2387 |
optional string key = 2; |
| 2388 |
} |
| 2389 |
|
| 2390 |
// Used to pass the value of a secret. |
| 2391 |
message Value |
| 2392 |
{ |
| 2393 |
required bytes data = 1; |
| 2394 |
} |
| 2395 |
|
| 2396 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 2397 |
|
| 2398 |
// Only one of `reference` and `value` must be set. |
| 2399 |
optional Reference reference = 2; |
| 2400 |
optional Value value = 3; |
| 2401 |
} |
| 2402 |
|
| 2403 |
|
| 2404 |
/** |
| 2405 |
* Rate (queries per second, QPS) limit for messages from a framework to master. |
| 2406 |
* Strictly speaking they are the combined rate from all frameworks of the same |
| 2407 |
* principal. |
| 2408 |
*/ |
| 2409 |
message RateLimit { |
| 2410 |
// Leaving QPS unset gives it unlimited rate (i.e., not throttled), |
| 2411 |
// which also implies unlimited capacity. |
| 2412 |
optional double qps = 1 [(gogoproto.customname) = "QPS"]; |
| 2413 |
|
| 2414 |
// Principal of framework(s) to be throttled. Should match |
| 2415 |
// FrameworkInfo.principal and Credential.principal (if using authentication). |
| 2416 |
required string principal = 2 [(gogoproto.nullable) = false]; |
| 2417 |
|
| 2418 |
// Max number of outstanding messages from frameworks of this principal |
| 2419 |
// allowed by master before the next message is dropped and an error is sent |
| 2420 |
// back to the sender. Messages received before the capacity is reached are |
| 2421 |
// still going to be processed after the error is sent. |
| 2422 |
// If unspecified, this principal is assigned unlimited capacity. |
| 2423 |
// NOTE: This value is ignored if 'qps' is not set. |
| 2424 |
optional uint64 capacity = 3; |
| 2425 |
} |
| 2426 |
|
| 2427 |
|
| 2428 |
/** |
| 2429 |
* Collection of RateLimit. |
| 2430 |
* Frameworks without rate limits defined here are not throttled unless |
| 2431 |
* 'aggregate_default_qps' is specified. |
| 2432 |
*/ |
| 2433 |
message RateLimits { |
| 2434 |
// Items should have unique principals. |
| 2435 |
repeated RateLimit limits = 1 [(gogoproto.nullable) = false]; |
| 2436 |
|
| 2437 |
// All the frameworks not specified in 'limits' get this default rate. |
| 2438 |
// This rate is an aggregate rate for all of them, i.e., their combined |
| 2439 |
// traffic is throttled together at this rate. |
| 2440 |
optional double aggregate_default_qps = 2 [(gogoproto.customname) = "AggregateDefaultQPS"]; |
| 2441 |
|
| 2442 |
// All the frameworks not specified in 'limits' get this default capacity. |
| 2443 |
// This is an aggregate value similar to 'aggregate_default_qps'. |
| 2444 |
optional uint64 aggregate_default_capacity = 3; |
| 2445 |
} |
| 2446 |
|
| 2447 |
|
| 2448 |
/** |
| 2449 |
* Describe an image used by tasks or executors. Note that it's only |
| 2450 |
* for tasks or executors launched by MesosContainerizer currently. |
| 2451 |
*/ |
| 2452 |
message Image { |
| 2453 |
enum Type { |
| 2454 |
APPC = 1; |
| 2455 |
DOCKER = 2; |
| 2456 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2457 |
} |
| 2458 |
|
| 2459 |
// Protobuf for specifying an Appc container image. See: |
| 2460 |
// https://github.com/appc/spec/blob/master/spec/aci.md |
| 2461 |
message Appc { |
| 2462 |
// The name of the image. |
| 2463 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 2464 |
|
| 2465 |
// An image ID is a string of the format "hash-value", where |
| 2466 |
// "hash" is the hash algorithm used and "value" is the hex |
| 2467 |
// encoded string of the digest. Currently the only permitted |
| 2468 |
// hash algorithm is sha512. |
| 2469 |
optional string id = 2 [(gogoproto.customname) = "ID"]; |
| 2470 |
|
| 2471 |
// Optional labels. Suggested labels: "version", "os", and "arch". |
| 2472 |
optional Labels labels = 3; |
| 2473 |
} |
| 2474 |
|
| 2475 |
message Docker { |
| 2476 |
// The name of the image. Expected format: |
| 2477 |
// [REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG|@TYPE:DIGEST] |
| 2478 |
// |
| 2479 |
// See: https://docs.docker.com/reference/commandline/pull/ |
| 2480 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 2481 |
|
| 2482 |
// Credential to authenticate with docker registry. |
| 2483 |
// NOTE: This is not encrypted, therefore framework and operators |
| 2484 |
// should enable SSL when passing this information. |
| 2485 |
// |
| 2486 |
// This field has never been used in Mesos before and is |
| 2487 |
// deprecated since Mesos 1.3. Please use `config` below |
| 2488 |
// (see MESOS-7088 for details). |
| 2489 |
optional Credential credential = 2 [deprecated = true]; // Since 1.3. |
| 2490 |
|
| 2491 |
// Docker config containing credentails to authenticate with |
| 2492 |
// docker registry. The secret is expected to be a docker |
| 2493 |
// config file in JSON format with UTF-8 character encoding. |
| 2494 |
optional Secret config = 3; |
| 2495 |
} |
| 2496 |
|
| 2497 |
required Type type = 1; |
| 2498 |
|
| 2499 |
// Only one of the following image messages should be set to match |
| 2500 |
// the type. |
| 2501 |
optional Appc appc = 2; |
| 2502 |
optional Docker docker = 3; |
| 2503 |
|
| 2504 |
// With this flag set to false, the mesos containerizer will pull |
| 2505 |
// the docker/appc image from the registry even if the image is |
| 2506 |
// already downloaded on the agent. |
| 2507 |
optional bool cached = 4 [default = true]; |
| 2508 |
} |
| 2509 |
|
| 2510 |
|
| 2511 |
/** |
| 2512 |
* Describes a volume mapping either from host to container or vice |
| 2513 |
* versa. Both paths can either refer to a directory or a file. |
| 2514 |
*/ |
| 2515 |
message Volume { |
| 2516 |
enum Mode { |
| 2517 |
RW = 1; // read-write. |
| 2518 |
RO = 2; // read-only. |
| 2519 |
} |
| 2520 |
|
| 2521 |
// TODO(gyliu513): Make this as `optional` after deprecation cycle of 1.0. |
| 2522 |
required Mode mode = 3; |
| 2523 |
|
| 2524 |
// Path pointing to a directory or file in the container. If the |
| 2525 |
// path is a relative path, it is relative to the container work |
| 2526 |
// directory. If the path is an absolute path, that path must |
| 2527 |
// already exist. |
| 2528 |
required string container_path = 1 [(gogoproto.nullable) = false]; |
| 2529 |
|
| 2530 |
// The following specifies the source of this volume. At most one of |
| 2531 |
// the following should be set. |
| 2532 |
|
| 2533 |
// Absolute path pointing to a directory or file on the host or a |
| 2534 |
// path relative to the container work directory. |
| 2535 |
optional string host_path = 2; |
| 2536 |
|
| 2537 |
// The source of the volume is an Image which describes a root |
| 2538 |
// filesystem which will be provisioned by Mesos. |
| 2539 |
optional Image image = 4; |
| 2540 |
|
| 2541 |
// Describes where a volume originates from. |
| 2542 |
message Source { |
| 2543 |
enum Type { |
| 2544 |
// This must be the first enum value in this list, to |
| 2545 |
// ensure that if 'type' is not set, the default value |
| 2546 |
// is UNKNOWN. This enables enum values to be added |
| 2547 |
// in a backwards-compatible way. See: MESOS-4997. |
| 2548 |
UNKNOWN = 0; |
| 2549 |
|
| 2550 |
// TODO(gyliu513): Add HOST_PATH and IMAGE as volume source type. |
| 2551 |
DOCKER_VOLUME = 1; |
| 2552 |
SANDBOX_PATH = 2; |
| 2553 |
SECRET = 3; |
| 2554 |
|
| 2555 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2556 |
} |
| 2557 |
|
| 2558 |
message DockerVolume { |
| 2559 |
// Driver of the volume, it can be flocker, convoy, raxrey etc. |
| 2560 |
optional string driver = 1; |
| 2561 |
|
| 2562 |
// Name of the volume. |
| 2563 |
required string name = 2 [(gogoproto.nullable) = false]; |
| 2564 |
|
| 2565 |
// Volume driver specific options. |
| 2566 |
optional Parameters driver_options = 3; |
| 2567 |
} |
| 2568 |
|
| 2569 |
// Describe a path from a container's sandbox. The container can |
| 2570 |
// be the current container (SELF), or its parent container |
| 2571 |
// (PARENT). PARENT allows all child containers to share a volume |
| 2572 |
// from their parent container's sandbox. It'll be an error if |
| 2573 |
// the current container is a top level container. |
| 2574 |
message SandboxPath { |
| 2575 |
enum Type { |
| 2576 |
UNKNOWN = 0; |
| 2577 |
SELF = 1; |
| 2578 |
PARENT = 2; |
| 2579 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2580 |
} |
| 2581 |
|
| 2582 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 2583 |
|
| 2584 |
// A path relative to the corresponding container's sandbox. |
| 2585 |
// Note that upwards traversal (i.e. ../../abc) is not allowed. |
| 2586 |
required string path = 2 [(gogoproto.nullable) = false]; |
| 2587 |
} |
| 2588 |
|
| 2589 |
// Enum fields should be optional, see: MESOS-4997. |
| 2590 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 2591 |
|
| 2592 |
// The following specifies the source of this volume. At most one of |
| 2593 |
// the following should be set. |
| 2594 |
|
| 2595 |
// The source of the volume created by docker volume driver. |
| 2596 |
optional DockerVolume docker_volume = 2; |
| 2597 |
|
| 2598 |
optional SandboxPath sandbox_path = 3; |
| 2599 |
|
| 2600 |
// The volume/secret isolator uses the secret-fetcher module (third-party or |
| 2601 |
// internal) downloads the secret and makes it available at container_path. |
| 2602 |
optional Secret secret = 4; |
| 2603 |
} |
| 2604 |
|
| 2605 |
optional Source source = 5; |
| 2606 |
} |
| 2607 |
|
| 2608 |
|
| 2609 |
/** |
| 2610 |
* Describes a network request from a framework as well as network resolution |
| 2611 |
* provided by Mesos. |
| 2612 |
* |
| 2613 |
* A framework may request the network isolator on the Agent to isolate the |
| 2614 |
* container in a network namespace and create a virtual network interface. |
| 2615 |
* The `NetworkInfo` message describes the properties of that virtual |
| 2616 |
* interface, including the IP addresses and network isolation policy |
| 2617 |
* (network group membership). |
| 2618 |
* |
| 2619 |
* The NetworkInfo message is not interpreted by the Master or Agent and is |
| 2620 |
* intended to be used by Agent and Master modules implementing network |
| 2621 |
* isolation. If the modules are missing, the message is simply ignored. In |
| 2622 |
* future, the task launch will fail if there is no module providing the |
| 2623 |
* network isolation capabilities (MESOS-3390). |
| 2624 |
* |
| 2625 |
* An executor, Agent, or an Agent module may append NetworkInfos inside |
| 2626 |
* TaskStatus::container_status to provide information such as the container IP |
| 2627 |
* address and isolation groups. |
| 2628 |
*/ |
| 2629 |
message NetworkInfo { |
| 2630 |
enum Protocol { |
| 2631 |
IPv4 = 1; |
| 2632 |
IPv6 = 2; |
| 2633 |
} |
| 2634 |
|
| 2635 |
// Specifies a request for an IP address, or reports the assigned container |
| 2636 |
// IP address. |
| 2637 |
// |
| 2638 |
// Users can request an automatically assigned IP (for example, via an |
| 2639 |
// IPAM service) or a specific IP by adding a NetworkInfo to the |
| 2640 |
// ContainerInfo for a task. On a request, specifying neither `protocol` |
| 2641 |
// nor `ip_address` means that any available address may be assigned. |
| 2642 |
message IPAddress { |
| 2643 |
// Specify IP address requirement. Set protocol to the desired value to |
| 2644 |
// request the network isolator on the Agent to assign an IP address to the |
| 2645 |
// container being launched. If a specific IP address is specified in |
| 2646 |
// ip_address, this field should not be set. |
| 2647 |
optional Protocol protocol = 1 [default = IPv4]; |
| 2648 |
|
| 2649 |
// Statically assigned IP provided by the Framework. This IP will be |
| 2650 |
// assigned to the container by the network isolator module on the Agent. |
| 2651 |
// This field should not be used with the protocol field above. |
| 2652 |
// |
| 2653 |
// If an explicit address is requested but is unavailable, the network |
| 2654 |
// isolator should fail the task. |
| 2655 |
optional string ip_address = 2 [(gogoproto.customname) = "IPAddress"]; |
| 2656 |
} |
| 2657 |
|
| 2658 |
// When included in a ContainerInfo, each of these represent a |
| 2659 |
// request for an IP address. Each request can specify an explicit address |
| 2660 |
// or the IP protocol to use. |
| 2661 |
// |
| 2662 |
// When included in a TaskStatus message, these inform the framework |
| 2663 |
// scheduler about the IP addresses that are bound to the container |
| 2664 |
// interface. When there are no custom network isolator modules installed, |
| 2665 |
// this field is filled in automatically with the Agent IP address. |
| 2666 |
repeated IPAddress ip_addresses = 5 [(gogoproto.nullable) = false, (gogoproto.customname) = "IPAddresses"]; |
| 2667 |
|
| 2668 |
// Name of the network which will be used by network isolator to determine |
| 2669 |
// the network that the container joins. It's up to the network isolator |
| 2670 |
// to decide how to interpret this field. |
| 2671 |
optional string name = 6; |
| 2672 |
|
| 2673 |
// A group is the name given to a set of logically-related interfaces that |
| 2674 |
// are allowed to communicate among themselves. Network traffic is allowed |
| 2675 |
// between two container interfaces that share at least one network group. |
| 2676 |
// For example, one might want to create separate groups for isolating dev, |
| 2677 |
// testing, qa and prod deployment environments. |
| 2678 |
repeated string groups = 3; |
| 2679 |
|
| 2680 |
// To tag certain metadata to be used by Isolator/IPAM, e.g., rack, etc. |
| 2681 |
optional Labels labels = 4; |
| 2682 |
|
| 2683 |
// Specifies a port mapping request for the task on this network. |
| 2684 |
message PortMapping { |
| 2685 |
required uint32 host_port = 1 [(gogoproto.nullable) = false]; |
| 2686 |
required uint32 container_port = 2 [(gogoproto.nullable) = false]; |
| 2687 |
// Protocol to expose as (ie: tcp, udp). |
| 2688 |
optional string protocol = 3; |
| 2689 |
} |
| 2690 |
|
| 2691 |
repeated PortMapping port_mappings = 7 [(gogoproto.nullable) = false]; |
| 2692 |
}; |
| 2693 |
|
| 2694 |
|
| 2695 |
/** |
| 2696 |
* Encapsulation of `Capabilities` supported by Linux. |
| 2697 |
* Reference: http://linux.die.net/man/7/capabilities. |
| 2698 |
*/ |
| 2699 |
message CapabilityInfo { |
| 2700 |
// We start the actual values at an offset(1000) because Protobuf 2 |
| 2701 |
// uses the first value as the default one. Separating the default |
| 2702 |
// value from the real first value helps to disambiguate them. This |
| 2703 |
// is especially valuable for backward compatibility. |
| 2704 |
// See: MESOS-4997. |
| 2705 |
enum Capability { |
| 2706 |
UNKNOWN = 0; |
| 2707 |
CHOWN = 1000; |
| 2708 |
DAC_OVERRIDE = 1001; |
| 2709 |
DAC_READ_SEARCH = 1002; |
| 2710 |
FOWNER = 1003; |
| 2711 |
FSETID = 1004; |
| 2712 |
KILL = 1005; |
| 2713 |
SETGID = 1006; |
| 2714 |
SETUID = 1007; |
| 2715 |
SETPCAP = 1008; |
| 2716 |
LINUX_IMMUTABLE = 1009; |
| 2717 |
NET_BIND_SERVICE = 1010; |
| 2718 |
NET_BROADCAST = 1011; |
| 2719 |
NET_ADMIN = 1012; |
| 2720 |
NET_RAW = 1013; |
| 2721 |
IPC_LOCK = 1014; |
| 2722 |
IPC_OWNER = 1015; |
| 2723 |
SYS_MODULE = 1016; |
| 2724 |
SYS_RAWIO = 1017; |
| 2725 |
SYS_CHROOT = 1018; |
| 2726 |
SYS_PTRACE = 1019; |
| 2727 |
SYS_PACCT = 1020; |
| 2728 |
SYS_ADMIN = 1021; |
| 2729 |
SYS_BOOT = 1022; |
| 2730 |
SYS_NICE = 1023; |
| 2731 |
SYS_RESOURCE = 1024; |
| 2732 |
SYS_TIME = 1025; |
| 2733 |
SYS_TTY_CONFIG = 1026; |
| 2734 |
MKNOD = 1027; |
| 2735 |
LEASE = 1028; |
| 2736 |
AUDIT_WRITE = 1029; |
| 2737 |
AUDIT_CONTROL = 1030; |
| 2738 |
SETFCAP = 1031; |
| 2739 |
MAC_OVERRIDE = 1032; |
| 2740 |
MAC_ADMIN = 1033; |
| 2741 |
SYSLOG = 1034; |
| 2742 |
WAKE_ALARM = 1035; |
| 2743 |
BLOCK_SUSPEND = 1036; |
| 2744 |
AUDIT_READ = 1037; |
| 2745 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2746 |
} |
| 2747 |
|
| 2748 |
repeated Capability capabilities = 1; |
| 2749 |
} |
| 2750 |
|
| 2751 |
|
| 2752 |
/** |
| 2753 |
* Encapsulation for Linux specific configuration. |
| 2754 |
* E.g, capabilities, limits etc. |
| 2755 |
*/ |
| 2756 |
message LinuxInfo { |
| 2757 |
// Since 1.4.0, deprecated in favor of `effective_capabilities`. |
| 2758 |
optional CapabilityInfo capability_info = 1 [deprecated = true]; |
| 2759 |
|
| 2760 |
// The set of capabilities that are allowed but not initially |
| 2761 |
// granted to tasks. |
| 2762 |
optional CapabilityInfo bounding_capabilities = 2; |
| 2763 |
|
| 2764 |
// Represents the set of capabilities that the task will |
| 2765 |
// be executed with. |
| 2766 |
optional CapabilityInfo effective_capabilities = 3; |
| 2767 |
|
| 2768 |
// If set as 'true', the container shares the pid namespace with |
| 2769 |
// its parent. If the container is a top level container, it will |
| 2770 |
// share the pid namespace with the agent. If the container is a |
| 2771 |
// nested container, it will share the pid namespace with its |
| 2772 |
// parent container. This field will be ignored if 'namespaces/pid' |
| 2773 |
// isolator is not enabled. |
| 2774 |
optional bool share_pid_namespace = 4 [(gogoproto.customname) = "SharePIDNamespace"]; |
| 2775 |
} |
| 2776 |
|
| 2777 |
|
| 2778 |
/** |
| 2779 |
* Encapsulation for POSIX rlimits, see |
| 2780 |
* http://pubs.opengroup.org/onlinepubs/009695399/functions/getrlimit.html. |
| 2781 |
* Note that some types might only be defined for Linux. |
| 2782 |
* We use a custom prefix to avoid conflict with existing system macros |
| 2783 |
* (e.g., `RLIMIT_CPU` or `NOFILE`). |
| 2784 |
*/ |
| 2785 |
message RLimitInfo { |
| 2786 |
message RLimit { |
| 2787 |
enum Type { |
| 2788 |
UNKNOWN = 0; |
| 2789 |
RLMT_AS = 1; |
| 2790 |
RLMT_CORE = 2; |
| 2791 |
RLMT_CPU = 3; |
| 2792 |
RLMT_DATA = 4; |
| 2793 |
RLMT_FSIZE = 5; |
| 2794 |
RLMT_LOCKS = 6; |
| 2795 |
RLMT_MEMLOCK = 7; |
| 2796 |
RLMT_MSGQUEUE = 8; |
| 2797 |
RLMT_NICE = 9; |
| 2798 |
RLMT_NOFILE = 10; |
| 2799 |
RLMT_NPROC = 11; |
| 2800 |
RLMT_RSS = 12; |
| 2801 |
RLMT_RTPRIO = 13; |
| 2802 |
RLMT_RTTIME = 14; |
| 2803 |
RLMT_SIGPENDING = 15; |
| 2804 |
RLMT_STACK = 16; |
| 2805 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2806 |
} |
| 2807 |
optional Type type = 1 [(gogoproto.nullable) = false]; |
| 2808 |
|
| 2809 |
// Either both are set or both are not set. |
| 2810 |
// If both are not set, it represents unlimited. |
| 2811 |
// If both are set, we require `soft` <= `hard`. |
| 2812 |
optional uint64 hard = 2; |
| 2813 |
optional uint64 soft = 3; |
| 2814 |
} |
| 2815 |
|
| 2816 |
repeated RLimit rlimits = 1 [(gogoproto.nullable) = false]; |
| 2817 |
} |
| 2818 |
|
| 2819 |
|
| 2820 |
/** |
| 2821 |
* Describes the information about (pseudo) TTY that can |
| 2822 |
* be attached to a process running in a container. |
| 2823 |
*/ |
| 2824 |
message TTYInfo { |
| 2825 |
message WindowSize { |
| 2826 |
required uint32 rows = 1 [(gogoproto.nullable) = false]; |
| 2827 |
required uint32 columns = 2 [(gogoproto.nullable) = false]; |
| 2828 |
} |
| 2829 |
|
| 2830 |
optional WindowSize window_size = 1; |
| 2831 |
} |
| 2832 |
|
| 2833 |
|
| 2834 |
/** |
| 2835 |
* Describes a container configuration and allows extensible |
| 2836 |
* configurations for different container implementations. |
| 2837 |
* |
| 2838 |
* NOTE: `ContainerInfo` may be specified, e.g., by a task, even if no |
| 2839 |
* container image is provided. In this case neither `MesosInfo` nor |
| 2840 |
* `DockerInfo` is set, the required `type` must be `MESOS`. This is to |
| 2841 |
* address a case when a task without an image, e.g., a shell script |
| 2842 |
* with URIs, wants to use features originally designed for containers, |
| 2843 |
* for example custom network isolation via `NetworkInfo`. |
| 2844 |
*/ |
| 2845 |
message ContainerInfo { |
| 2846 |
// All container implementation types. |
| 2847 |
enum Type { |
| 2848 |
DOCKER = 1; |
| 2849 |
MESOS = 2; |
| 2850 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2851 |
} |
| 2852 |
|
| 2853 |
message DockerInfo { |
| 2854 |
// The docker image that is going to be passed to the registry. |
| 2855 |
required string image = 1 [(gogoproto.nullable) = false]; |
| 2856 |
|
| 2857 |
// Network options. |
| 2858 |
enum Network { |
| 2859 |
HOST = 1; |
| 2860 |
BRIDGE = 2; |
| 2861 |
NONE = 3; |
| 2862 |
USER = 4; |
| 2863 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2864 |
} |
| 2865 |
|
| 2866 |
optional Network network = 2 [default = HOST]; |
| 2867 |
|
| 2868 |
message PortMapping { |
| 2869 |
required uint32 host_port = 1 [(gogoproto.nullable) = false]; |
| 2870 |
required uint32 container_port = 2 [(gogoproto.nullable) = false]; |
| 2871 |
// Protocol to expose as (ie: tcp, udp). |
| 2872 |
optional string protocol = 3; |
| 2873 |
} |
| 2874 |
|
| 2875 |
repeated PortMapping port_mappings = 3 [(gogoproto.nullable) = false]; |
| 2876 |
|
| 2877 |
optional bool privileged = 4 [default = false]; |
| 2878 |
|
| 2879 |
// Allowing arbitrary parameters to be passed to docker CLI. |
| 2880 |
// Note that anything passed to this field is not guaranteed |
| 2881 |
// to be supported moving forward, as we might move away from |
| 2882 |
// the docker CLI. |
| 2883 |
repeated Parameter parameters = 5 [(gogoproto.nullable) = false]; |
| 2884 |
|
| 2885 |
// With this flag set to true, the docker containerizer will |
| 2886 |
// pull the docker image from the registry even if the image |
| 2887 |
// is already downloaded on the agent. |
| 2888 |
optional bool force_pull_image = 6; |
| 2889 |
|
| 2890 |
// The name of volume driver plugin. |
| 2891 |
optional string volume_driver = 7 [deprecated = true]; // Since 1.0 |
| 2892 |
} |
| 2893 |
|
| 2894 |
message MesosInfo { |
| 2895 |
optional Image image = 1; |
| 2896 |
} |
| 2897 |
|
| 2898 |
required Type type = 1; |
| 2899 |
repeated Volume volumes = 2 [(gogoproto.nullable) = false]; |
| 2900 |
optional string hostname = 4; |
| 2901 |
|
| 2902 |
// Only one of the following *Info messages should be set to match |
| 2903 |
// the type. |
| 2904 |
optional DockerInfo docker = 3; |
| 2905 |
optional MesosInfo mesos = 5; |
| 2906 |
|
| 2907 |
// A list of network requests. A framework can request multiple IP addresses |
| 2908 |
// for the container. |
| 2909 |
repeated NetworkInfo network_infos = 7 [(gogoproto.nullable) = false]; |
| 2910 |
|
| 2911 |
// Linux specific information for the container. |
| 2912 |
optional LinuxInfo linux_info = 8; |
| 2913 |
|
| 2914 |
// (POSIX only) rlimits of the container. |
| 2915 |
optional RLimitInfo rlimit_info = 9; |
| 2916 |
|
| 2917 |
// If specified a tty will be attached to the container entrypoint. |
| 2918 |
optional TTYInfo tty_info = 10 [(gogoproto.customname) = "TTYInfo"]; |
| 2919 |
} |
| 2920 |
|
| 2921 |
|
| 2922 |
/** |
| 2923 |
* Container related information that is resolved during container |
| 2924 |
* setup. The information is sent back to the framework as part of the |
| 2925 |
* TaskStatus message. |
| 2926 |
*/ |
| 2927 |
message ContainerStatus { |
| 2928 |
optional ContainerID container_id = 4 [(gogoproto.customname) = "ContainerID"]; |
| 2929 |
|
| 2930 |
// This field can be reliably used to identify the container IP address. |
| 2931 |
repeated NetworkInfo network_infos = 1 [(gogoproto.nullable) = false]; |
| 2932 |
|
| 2933 |
// Information about Linux control group (cgroup). |
| 2934 |
optional CgroupInfo cgroup_info = 2; |
| 2935 |
|
| 2936 |
// Information about Executor PID. |
| 2937 |
optional uint32 executor_pid = 3 [(gogoproto.customname) = "ExecutorPID"]; |
| 2938 |
} |
| 2939 |
|
| 2940 |
|
| 2941 |
/** |
| 2942 |
* Linux control group (cgroup) information. |
| 2943 |
*/ |
| 2944 |
message CgroupInfo { |
| 2945 |
// Configuration of a blkio cgroup subsystem. |
| 2946 |
message Blkio { |
| 2947 |
enum Operation { |
| 2948 |
UNKNOWN = 0; |
| 2949 |
TOTAL = 1; |
| 2950 |
READ = 2; |
| 2951 |
WRITE = 3; |
| 2952 |
SYNC = 4; |
| 2953 |
ASYNC = 5; |
| 2954 |
option (gogoproto.goproto_enum_prefix) = true; |
| 2955 |
} |
| 2956 |
|
| 2957 |
// Describes a stat value without the device descriptor part. |
| 2958 |
message Value { |
| 2959 |
optional Operation op = 1; // Required. |
| 2960 |
optional uint64 value = 2; // Required. |
| 2961 |
} |
| 2962 |
|
| 2963 |
message CFQ { |
| 2964 |
message Statistics { |
| 2965 |
// Stats are grouped by block devices. If `device` is not |
| 2966 |
// set, it represents `Total`. |
| 2967 |
optional Device.Number device = 1; |
| 2968 |
// blkio.sectors |
| 2969 |
optional uint64 sectors = 2; |
| 2970 |
// blkio.time |
| 2971 |
optional uint64 time = 3; |
| 2972 |
// blkio.io_serviced |
| 2973 |
repeated Value io_serviced = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOServiced"]; |
| 2974 |
// blkio.io_service_bytes |
| 2975 |
repeated Value io_service_bytes = 5 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOServiceBytes"]; |
| 2976 |
// blkio.io_service_time |
| 2977 |
repeated Value io_service_time = 6 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOServiceTime"]; |
| 2978 |
// blkio.io_wait_time |
| 2979 |
repeated Value io_wait_time = 7 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOWaitTime"]; |
| 2980 |
// blkio.io_merged |
| 2981 |
repeated Value io_merged = 8 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOMerged"]; |
| 2982 |
// blkio.io_queued |
| 2983 |
repeated Value io_queued = 9 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOQueued"]; |
| 2984 |
} |
| 2985 |
|
| 2986 |
// TODO(jasonlai): Add fields for blkio weight and weight |
| 2987 |
// device. |
| 2988 |
} |
| 2989 |
|
| 2990 |
message Throttling { |
| 2991 |
message Statistics { |
| 2992 |
// Stats are grouped by block devices. If `device` is not |
| 2993 |
// set, it represents `Total`. |
| 2994 |
optional Device.Number device = 1; |
| 2995 |
// blkio.throttle.io_serviced |
| 2996 |
repeated Value io_serviced = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOServiced"]; |
| 2997 |
// blkio.throttle.io_service_bytes |
| 2998 |
repeated Value io_service_bytes = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "IOServiceBytes"]; |
| 2999 |
} |
| 3000 |
|
| 3001 |
// TODO(jasonlai): Add fields for blkio.throttle.*_device. |
| 3002 |
} |
| 3003 |
|
| 3004 |
message Statistics { |
| 3005 |
repeated CFQ.Statistics cfq = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "CFQ"]; |
| 3006 |
repeated CFQ.Statistics cfq_recursive = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "CFQRecursive"]; |
| 3007 |
repeated Throttling.Statistics throttling = 3; |
| 3008 |
} |
| 3009 |
} |
| 3010 |
|
| 3011 |
// Configuration of a net_cls cgroup subsystem. |
| 3012 |
message NetCls { |
| 3013 |
// The 32-bit classid consists of two parts, a 16 bit major handle |
| 3014 |
// and a 16-bit minor handle. The major and minor handle are |
| 3015 |
// represented using the format 0xAAAABBBB, where 0xAAAA is the |
| 3016 |
// 16-bit major handle and 0xBBBB is the 16-bit minor handle. |
| 3017 |
optional uint32 classid = 1 [(gogoproto.customname) = "ClassID"]; |
| 3018 |
} |
| 3019 |
|
| 3020 |
optional NetCls net_cls = 1 [(gogoproto.customname) = "NetCLS"]; |
| 3021 |
} |
| 3022 |
|
| 3023 |
|
| 3024 |
/** |
| 3025 |
* Collection of labels. Labels should not contain duplicate key-value |
| 3026 |
* pairs. |
| 3027 |
*/ |
| 3028 |
message Labels { |
| 3029 |
repeated Label labels = 1 [(gogoproto.nullable) = false]; |
| 3030 |
} |
| 3031 |
|
| 3032 |
|
| 3033 |
/** |
| 3034 |
* Key, value pair used to store free form user-data. |
| 3035 |
*/ |
| 3036 |
message Label { |
| 3037 |
required string key = 1 [(gogoproto.nullable) = false]; |
| 3038 |
optional string value = 2; |
| 3039 |
} |
| 3040 |
|
| 3041 |
|
| 3042 |
/** |
| 3043 |
* Named port used for service discovery. |
| 3044 |
*/ |
| 3045 |
message Port { |
| 3046 |
// Port number on which the framework exposes a service. |
| 3047 |
required uint32 number = 1 [(gogoproto.nullable) = false]; |
| 3048 |
|
| 3049 |
// Name of the service hosted on this port. |
| 3050 |
optional string name = 2; |
| 3051 |
|
| 3052 |
// Layer 4-7 protocol on which the framework exposes its services. |
| 3053 |
optional string protocol = 3; |
| 3054 |
|
| 3055 |
// This field restricts discovery within a framework (FRAMEWORK), |
| 3056 |
// within a Mesos cluster (CLUSTER), or places no restrictions (EXTERNAL). |
| 3057 |
// The visibility setting for a Port overrides the general visibility setting |
| 3058 |
// in the DiscoveryInfo. |
| 3059 |
optional DiscoveryInfo.Visibility visibility = 4; |
| 3060 |
|
| 3061 |
// This can be used to decorate the message with metadata to be |
| 3062 |
// interpreted by external applications such as firewalls. |
| 3063 |
optional Labels labels = 5; |
| 3064 |
} |
| 3065 |
|
| 3066 |
|
| 3067 |
/** |
| 3068 |
* Collection of ports. |
| 3069 |
*/ |
| 3070 |
message Ports { |
| 3071 |
repeated Port ports = 1 [(gogoproto.nullable) = false]; |
| 3072 |
} |
| 3073 |
|
| 3074 |
|
| 3075 |
/** |
| 3076 |
* Service discovery information. |
| 3077 |
* The visibility field restricts discovery within a framework (FRAMEWORK), |
| 3078 |
* within a Mesos cluster (CLUSTER), or places no restrictions (EXTERNAL). |
| 3079 |
* Each port in the ports field also has an optional visibility field. |
| 3080 |
* If visibility is specified for a port, it overrides the default service-wide |
| 3081 |
* DiscoveryInfo.visibility for that port. |
| 3082 |
* The environment, location, and version fields provide first class support for |
| 3083 |
* common attributes used to differentiate between similar services. The |
| 3084 |
* environment may receive values such as PROD/QA/DEV, the location field may |
| 3085 |
* receive values like EAST-US/WEST-US/EUROPE/AMEA, and the version field may |
| 3086 |
* receive values like v2.0/v0.9. The exact use of these fields is up to each |
| 3087 |
* service discovery system. |
| 3088 |
*/ |
| 3089 |
message DiscoveryInfo { |
| 3090 |
enum Visibility { |
| 3091 |
FRAMEWORK = 0; |
| 3092 |
CLUSTER = 1; |
| 3093 |
EXTERNAL = 2; |
| 3094 |
} |
| 3095 |
|
| 3096 |
required Visibility visibility = 1 [(gogoproto.nullable) = false]; |
| 3097 |
optional string name = 2; |
| 3098 |
optional string environment = 3; |
| 3099 |
optional string location = 4; |
| 3100 |
optional string version = 5; |
| 3101 |
optional Ports ports = 6; |
| 3102 |
optional Labels labels = 7; |
| 3103 |
} |
| 3104 |
|
| 3105 |
|
| 3106 |
/** |
| 3107 |
* Named WeightInfo to indicate resource allocation |
| 3108 |
* priority between the different roles. |
| 3109 |
*/ |
| 3110 |
message WeightInfo { |
| 3111 |
required double weight = 1 [(gogoproto.nullable) = false]; |
| 3112 |
|
| 3113 |
// Related role name. |
| 3114 |
optional string role = 2; |
| 3115 |
} |
| 3116 |
|
| 3117 |
|
| 3118 |
/** |
| 3119 |
* Version information of a component. |
| 3120 |
*/ |
| 3121 |
message VersionInfo { |
| 3122 |
required string version = 1 [(gogoproto.nullable) = false]; |
| 3123 |
optional string build_date = 2; |
| 3124 |
optional double build_time = 3; |
| 3125 |
optional string build_user = 4; |
| 3126 |
optional string git_sha = 5 [(gogoproto.customname) = "GitSHA"]; |
| 3127 |
optional string git_branch = 6; |
| 3128 |
optional string git_tag = 7; |
| 3129 |
} |
| 3130 |
|
| 3131 |
|
| 3132 |
/** |
| 3133 |
* Flag consists of a name and optionally its value. |
| 3134 |
*/ |
| 3135 |
message Flag { |
| 3136 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 3137 |
optional string value = 2; |
| 3138 |
} |
| 3139 |
|
| 3140 |
|
| 3141 |
/** |
| 3142 |
* Describes a Role. Roles can be used to specify that certain resources are |
| 3143 |
* reserved for the use of one or more frameworks. |
| 3144 |
*/ |
| 3145 |
message Role { |
| 3146 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 3147 |
required double weight = 2 [(gogoproto.nullable) = false]; |
| 3148 |
repeated FrameworkID frameworks = 3 [(gogoproto.nullable) = false]; |
| 3149 |
repeated Resource resources = 4 [(gogoproto.nullable) = false]; |
| 3150 |
} |
| 3151 |
|
| 3152 |
|
| 3153 |
/** |
| 3154 |
* Metric consists of a name and optionally its value. |
| 3155 |
*/ |
| 3156 |
message Metric { |
| 3157 |
required string name = 1 [(gogoproto.nullable) = false]; |
| 3158 |
optional double value = 2; |
| 3159 |
} |
| 3160 |
|
| 3161 |
|
| 3162 |
/** |
| 3163 |
* Describes a File. |
| 3164 |
*/ |
| 3165 |
message FileInfo { |
| 3166 |
// Absolute path to the file. |
| 3167 |
required string path = 1 [(gogoproto.nullable) = false]; |
| 3168 |
|
| 3169 |
// Number of hard links. |
| 3170 |
optional int32 nlink = 2; |
| 3171 |
|
| 3172 |
// Total size in bytes. |
| 3173 |
optional uint64 size = 3; |
| 3174 |
|
| 3175 |
// Last modification time. |
| 3176 |
optional TimeInfo mtime = 4; |
| 3177 |
|
| 3178 |
// Represents a file's mode and permission bits. The bits have the same |
| 3179 |
// definition on all systems and is portable. |
| 3180 |
optional uint32 mode = 5; |
| 3181 |
|
| 3182 |
// User ID of owner. |
| 3183 |
optional string uid = 6 [(gogoproto.customname) = "UID"]; |
| 3184 |
|
| 3185 |
// Group ID of owner. |
| 3186 |
optional string gid = 7 [(gogoproto.customname) = "GID"]; |
| 3187 |
} |
| 3188 |
|
| 3189 |
|
| 3190 |
/** |
| 3191 |
* Describes information abount a device. |
| 3192 |
*/ |
| 3193 |
message Device { |
| 3194 |
message Number { |
| 3195 |
required uint64 major_number = 1; |
| 3196 |
required uint64 minor_number = 2; |
| 3197 |
} |
| 3198 |
|
| 3199 |
optional string path = 1; |
| 3200 |
optional Number number = 2; |
| 3201 |
} |
| 3202 |
|
| 3203 |
|
| 3204 |
/** |
| 3205 |
* Describes a device whitelist entry that expose from host to container. |
| 3206 |
*/ |
| 3207 |
message DeviceAccess { |
| 3208 |
message Access { |
| 3209 |
optional bool read = 1; |
| 3210 |
optional bool write = 2; |
| 3211 |
optional bool mknod = 3; |
| 3212 |
} |
| 3213 |
required Device device = 1 [(gogoproto.nullable) = false]; |
| 3214 |
required Access access = 2 [(gogoproto.nullable) = false]; |
| 3215 |
} |
| 3216 |
|
| 3217 |
|
| 3218 |
message DeviceWhitelist { |
| 3219 |
repeated DeviceAccess allowed_devices = 1 [(gogoproto.nullable) = false]; |
| 3220 |
} |