Apache Mesos
overlay.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 __MESOS_PROVISIONER_OVERLAY_HPP__
18 #define __MESOS_PROVISIONER_OVERLAY_HPP__
19 
20 #include <list>
21 #include <string>
22 
24 
25 namespace mesos {
26 namespace internal {
27 namespace slave {
28 
29 // Forward declaration.
30 class OverlayBackendProcess;
31 
32 
33 // This backend mounts the images layers to the rootfs using the overlay file
34 // system. The directory layout is as follows:
35 // <work_dir> ('--work_dir' flag)
36 // |-- provisioner
37 // |-- containers
38 // |-- <container-id>
39 // |-- backends
40 // |-- overlay
41 // |-- rootfses
42 // |-- <rootfs_id> (the rootfs)
43 // |-- scratch
44 // |-- <rootfs_id> (the scratch space)
45 // |-- upperdir
46 // |-- workdir
47 // |-- links (symlink to temp dir with links to layers) // NOLINT(whitespace/line_length)
48 class OverlayBackend : public Backend
49 {
50 public:
51  ~OverlayBackend() override;
52 
54 
56  const std::string& workDir);
57 
59  const std::vector<std::string>& layers,
60  const std::string& rootfs,
61  const std::string& backendDir) override;
62 
64  const std::string& rootfs,
65  const std::string& backendDir) override;
66 
67 private:
69 
71  OverlayBackend& operator=(const OverlayBackend&);
72 
74 };
75 
76 } // namespace slave {
77 } // namespace internal {
78 } // namespace mesos {
79 
80 #endif // __MESOS_PROVISIONER_OVERLAY_HPP__
static Try< process::Owned< Backend > > create(const Flags &)
process::Future< Option< std::vector< Path > > > provision(const std::vector< std::string > &layers, const std::string &rootfs, const std::string &backendDir) override
Definition: check.hpp:33
process::Future< bool > destroy(const std::string &rootfs, const std::string &backendDir) override
Definition: flags.hpp:39
Definition: backend.hpp:38
Definition: agent.hpp:25
Definition: attributes.hpp:24
Definition: executor.hpp:48
static Try< std::list< std::string > > listEphemeralVolumes(const std::string &workDir)
Definition: overlay.hpp:48
Definition: future.hpp:58