Apache Mesos
runtime.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_RUNTIME_ISOLATOR_HPP__
18 #define __DOCKER_RUNTIME_ISOLATOR_HPP__
19 
21 
22 namespace mesos {
23 namespace internal {
24 namespace slave {
25 
26 // The docker runtime isolator is responsible for preparing mesos
27 // container by merging runtime configuration specified by user
28 // and docker image default configuration.
30 {
31 public:
33 
35 
36  bool supportsNesting() override;
37  bool supportsStandalone() override;
38 
40  const ContainerID& containerId,
41  const mesos::slave::ContainerConfig& containerConfig) override;
42 
43 private:
44  DockerRuntimeIsolatorProcess(const Flags& flags);
45 
46  Option<Environment> getLaunchEnvironment(
47  const ContainerID& containerId,
48  const mesos::slave::ContainerConfig& containerConfig);
49 
50  Result<CommandInfo> getLaunchCommand(
51  const ContainerID& containerId,
52  const mesos::slave::ContainerConfig& containerConfig);
53 
54  Option<std::string> getWorkingDirectory(
55  const mesos::slave::ContainerConfig& containerConfig);
56 
57  Option<std::string> getContainerUser(
58  const mesos::slave::ContainerConfig& containerConfig);
59 
60  const Flags flags;
61 };
62 
63 } // namespace slave {
64 } // namespace internal {
65 } // namespace mesos {
66 
67 #endif // __DOCKER_RUNTIME_ISOLATOR_HPP__
Definition: option.hpp:29
Definition: check.hpp:33
Definition: flags.hpp:39
Definition: check.hpp:30
process::Future< Option< mesos::slave::ContainerLaunchInfo > > prepare(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig) override
Definition: agent.hpp:25
Definition: attributes.hpp:24
Definition: parse.hpp:33
static Try< mesos::slave::Isolator * > create(const Flags &flags)
Definition: future.hpp:58