Apache Mesos
executor.hpp
Go to the documentation of this file.
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 #ifndef __DOCKER_EXECUTOR_HPP__
18 #define __DOCKER_EXECUTOR_HPP__
19 
20 #include <stdio.h>
21 
22 #include <map>
23 #include <string>
24 
25 #include <process/process.hpp>
26 
27 #include <stout/option.hpp>
28 
29 #include "logging/flags.hpp"
30 
31 namespace mesos {
32 namespace internal {
33 namespace docker {
34 
35 struct Flags : public virtual mesos::internal::logging::Flags
36 {
37  Flags() {
39  "container",
40  "The name of the docker container to run.");
41 
43  "docker",
44  "The path to the docker executable.");
45 
47  "docker_socket",
48  "Resource used by the agent and the executor to provide CLI access\n"
49  "to the Docker daemon. On Unix, this is typically a path to a\n"
50  "socket, such as '/var/run/docker.sock'. On Windows this must be a\n"
51  "named pipe, such as '//./pipe/docker_engine'.");
52 
54  "sandbox_directory",
55  "The path to the container sandbox holding stdout and stderr files\n"
56  "into which docker container logs will be redirected.");
57 
59  "mapped_directory",
60  "The sandbox directory path that is mapped in the docker container.");
61 
62  // TODO(alexr): Remove this after the deprecation cycle (started in 1.0).
64  "stop_timeout",
65  "The duration for docker to wait after stopping a running container\n"
66  "before it kills that container. This flag is deprecated; use task's\n"
67  "kill policy instead.");
68 
70  "launcher_dir",
71  "Directory path of Mesos binaries. Mesos would find fetcher,\n"
72  "containerizer and executor binary files under this directory.");
73 
75  "task_environment",
76  "A JSON map of environment variables and values that should\n"
77  "be passed into the task launched by this executor.");
78 
80  "default_container_dns",
81  "JSON-formatted default DNS information for container.");
82 
84  "cgroups_enable_cfs",
85  "Cgroups feature flag to enable hard limits on CPU resources\n"
86  "via the CFS bandwidth limiting subfeature.\n",
87  false);
88  }
89 
98 
100 
101  // TODO(alexr): Remove this after the deprecation cycle (started in 1.0).
103 };
104 
105 } // namespace docker {
106 } // namespace internal {
107 } // namespace mesos {
108 
109 #endif // __DOCKER_EXECUTOR_HPP__
Definition: flags.hpp:29
Option< std::string > sandbox_directory
Definition: executor.hpp:93
Option< std::string > docker
Definition: executor.hpp:91
Option< Duration > stop_timeout
Definition: executor.hpp:102
Option< std::string > mapped_directory
Definition: executor.hpp:94
Option< std::string > container
Definition: executor.hpp:90
Option< std::string > launcher_dir
Definition: executor.hpp:95
Flags()
Definition: executor.hpp:37
void add(T1 Flags::*t1, const Name &name, const Option< Name > &alias, const std::string &help, const T2 *t2, F validate)
Definition: flags.hpp:333
Option< std::string > task_environment
Definition: executor.hpp:96
Option< std::string > default_container_dns
Definition: executor.hpp:97
bool cgroups_enable_cfs
Definition: executor.hpp:99
Definition: executor.hpp:35
Option< std::string > docker_socket
Definition: executor.hpp:92