| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| package mesos.slave; |
| |
| import "mesos/mesos.proto"; |
| |
| import "mesos/docker/v1.proto"; |
| |
| |
| /** |
| * Information when an executor is impacted by a resource limitation |
| * and should be terminated. Intended to support resources like memory |
| * where the Linux kernel may invoke the OOM killer, killing some/all |
| * of a container's processes. |
| */ |
| message ContainerLimitation |
| { |
| // Resources that triggered the limitation. |
| // NOTE: 'Resources' is used here because the resource may span |
| // multiple roles (e.g. `"mem(*):1;mem(role):2"`). |
| repeated Resource resources = 1; |
| |
| // Description of the limitation. |
| optional string message = 2; |
| |
| // The container will be terminated when a resource limitation is |
| // reached. This field specifies the 'reason' that will be sent in |
| // the status update for any remaining non-terminal tasks when the |
| // container is terminated. |
| optional TaskStatus.Reason reason = 3; |
| } |
| |
| |
| /** |
| * This message is derived from slave::state::RunState. It contains |
| * only those fields that are needed by Isolators for recovering the |
| * containers. The reason for not using RunState instead is to avoid |
| * any dependency on RunState and in turn on internal protobufs. |
| */ |
| message ContainerState |
| { |
| required ExecutorInfo executor_info = 1; |
| |
| // Container id of the last executor run. |
| required ContainerID container_id = 2; |
| |
| required uint64 pid = 3; // Executor pid. |
| required string directory = 4; // Executor work directory. |
| } |
| |
| |
| /** |
| * The container configuration that will be passed to each isolator |
| * during `prepare`. |
| */ |
| message ContainerConfig { |
| required ExecutorInfo executor_info = 8; |
| optional TaskInfo task_info = 9; |
| |
| // The work directory for the container in the host filesystem. |
| required string directory = 3; |
| |
| // The user the task will be run as. |
| optional string user = 4; |
| |
| // NOTE: 'rootfs' and 'docker' below are for the executor in custom |
| // executor case, and they are for the task in command task case. |
| |
| // The root filesystem for the container. |
| optional string rootfs = 5; |
| |
| // Docker v1 image manifest. |
| message Docker { |
| optional docker.spec.v1.ImageManifest manifest = 1; |
| } |
| |
| optional Docker docker = 7; |
| |
| // TODO(gilbert): Add appc image manifest. |
| |
| // The following two fields are deprecated. Please do NOT use them |
| // in your isolator. Use 'executor_info' and 'task_info' instead. |
| // TODO(gilbert): Remove them in 0.29. |
| required ExecutorInfo executorInfo = 1; |
| optional TaskInfo taskInfo = 2; |
| } |
| |
| |
| /** |
| * Protobuf returned by Isolator::prepare(). The command is executed |
| * by the Launcher in the containerized context. |
| * Note: Currently, any URIs or Environment in the CommandInfo will be |
| * ignored; only the command value is used. Further, we only accept |
| * shell commands for the preparation commands. |
| */ |
| message ContainerLaunchInfo |
| { |
| repeated CommandInfo commands = 1; |
| optional Environment environment = 2; |
| |
| // The root filesystem for the container. |
| optional string rootfs = 3; |
| |
| // (Linux only) The namespaces required for the container. |
| // The namespaces are created while launching the executor. |
| optional uint32 namespaces = 4 [default = 0]; |
| |
| // If specified, it'll become the launch command for the custom |
| // executor, or the launch command for the user task in the case of |
| // a command task. |
| optional CommandInfo command = 5; |
| |
| // The working directory for the container. |
| // NOTE: This is different than Mesos sandbox. |
| optional string working_directory = 6; |
| } |