Apache Mesos
paths.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 __PROVISIONER_APPC_PATHS_HPP__
18 #define __PROVISIONER_APPC_PATHS_HPP__
19 
20 #include <string>
21 
22 #include <stout/hashmap.hpp>
23 #include <stout/try.hpp>
24 
25 #include <mesos/appc/spec.hpp>
26 
27 namespace mesos {
28 namespace internal {
29 namespace slave {
30 namespace appc {
31 namespace paths {
32 
33 // The appc store file system layout is as follows:
34 //
35 // <store_dir> ('--appc_store_dir' flag)
36 // |--staging (contains temp directories for staging downloads)
37 // |
38 // |--images (stores validated images)
39 // |--<image_id> (in the form of "sha512-<128_character_hash_sum>")
40 // |--manifest
41 // |--rootfs
42 // |--... (according to the ACI spec)
43 //
44 // TODO(xujyan): The staging directory is unused for now (it's
45 // externally managed) but implemented to illustrate the need for a
46 // separate 'images' directory. Complete the layout diagram when the
47 // staging directory is utilized by the provisioner.
48 
49 std::string getStagingDir(const std::string& storeDir);
50 
51 
52 std::string getImagesDir(const std::string& storeDir);
53 
54 
55 std::string getImagePath(
56  const std::string& storeDir,
57  const std::string& imageId);
58 
59 
60 std::string getImageRootfsPath(
61  const std::string& storeDir,
62  const std::string& imageId);
63 
64 
65 std::string getImageManifestPath(
66  const std::string& storeDir,
67  const std::string& imageId);
68 
69 } // namespace paths {
70 } // namespace appc {
71 } // namespace slave {
72 } // namespace internal {
73 } // namespace mesos {
74 
75 #endif // __PROVISIONER_APPC_PATHS_HPP__
std::string getImagesDir(const std::string &storeDir)
std::string paths()
Definition: os.hpp:136
std::string getImagePath(const std::string &storeDir, const std::string &imageId)
Definition: spec.hpp:30
std::string getImageManifestPath(const std::string &storeDir, const std::string &imageId)
std::string getImageRootfsPath(const std::string &storeDir, const std::string &imageId)
Definition: attributes.hpp:24
Definition: spec.hpp:28
std::string getStagingDir(const std::string &storeDir)