Apache Mesos
sandbox.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 __SLAVE_CONTAINER_LOGGERS_SANDBOX_HPP__
18 #define __SLAVE_CONTAINER_LOGGERS_SANDBOX_HPP__
19 
20 #include <map>
21 #include <string>
22 #include <vector>
23 
24 #include <mesos/mesos.hpp>
25 
28 
29 #include <process/future.hpp>
30 #include <process/owned.hpp>
31 #include <process/subprocess.hpp>
32 
33 #include <stout/try.hpp>
34 #include <stout/nothing.hpp>
35 #include <stout/option.hpp>
36 
37 namespace mesos {
38 namespace internal {
39 namespace slave {
40 
41 // Forward declaration.
42 class SandboxContainerLoggerProcess;
43 
44 
45 // The default container logger.
46 //
47 // Containers launched through this container logger will have their
48 // stdout and stderr piped to the files "stdout" and "stderr",
49 // respectively, in the sandbox. These logs are accessible via the
50 // agent's `/files` endpoint.
52 {
53 public:
55  ~SandboxContainerLogger() override;
56 
57  // This is a noop. The sandbox container logger has nothing to initialize.
58  Try<Nothing> initialize() override;
59 
60  // Tells the subprocess to redirect the container's stdout and
61  // stderr to separate "stdout" and "stderr" files in the sandbox.
62  // The `path`, `argv`, and `environment` are not changed.
64  const ContainerID& containerId,
65  const mesos::slave::ContainerConfig& containerConfig) override;
66 
67 protected:
69 };
70 
71 
72 } // namespace slave {
73 } // namespace internal {
74 } // namespace mesos {
75 
76 #endif // __SLAVE_CONTAINER_LOGGERS_SANDBOX_HPP__
Definition: check.hpp:33
process::Owned< SandboxContainerLoggerProcess > process
Definition: sandbox.hpp:68
Definition: agent.hpp:25
process::Future< mesos::slave::ContainerIO > prepare(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig) override
Definition: attributes.hpp:24
Try< Nothing > initialize() override
Initializes this container logger.
A containerizer component used to manage container logs.
Definition: container_logger.hpp:61
Definition: future.hpp:58