You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/12/18 23:40:19 UTC

[5/9] mesos git commit: Added path helper method to get image layer manifest on local store.

Added path helper method to get image layer manifest on local store.

Review: https://reviews.apache.org/r/41406/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a2004e42
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a2004e42
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a2004e42

Branch: refs/heads/master
Commit: a2004e42b49a40fbb045b60b21ed45ca96d12227
Parents: c6d9eb1
Author: Gilbert Song <so...@gmail.com>
Authored: Fri Dec 18 14:13:15 2015 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Dec 18 14:29:59 2015 -0800

----------------------------------------------------------------------
 .../containerizer/mesos/provisioner/docker/paths.cpp  | 14 +++++++++++---
 .../containerizer/mesos/provisioner/docker/paths.hpp  | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a2004e42/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/paths.cpp b/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
index 9c1f6a1..9c5c249 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/paths.cpp
@@ -52,7 +52,7 @@ string getImageArchiveRepositoriesPath(const string& archivePath)
 }
 
 
-std::string getImageArchiveLayerPath(
+string getImageArchiveLayerPath(
     const string& archivePath,
     const string& layerId)
 {
@@ -69,8 +69,8 @@ string getImageArchiveLayerManifestPath(
 
 
 string getImageArchiveLayerTarPath(
-  const string& archivePath,
-  const string& layerId)
+    const string& archivePath,
+    const string& layerId)
 {
   return path::join(
       getImageArchiveLayerPath(archivePath, layerId), "layer.tar");
@@ -93,6 +93,14 @@ string getImageLayerPath(
 }
 
 
+string getImageLayerManifestPath(
+    const std::string& storeDir,
+    const std::string& layerId)
+{
+  return path::join(getImageLayerPath(storeDir, layerId), "json");
+}
+
+
 string getImageLayerRootfsPath(
     const string& storeDir,
     const string& layerId)

http://git-wip-us.apache.org/repos/asf/mesos/blob/a2004e42/src/slave/containerizer/mesos/provisioner/docker/paths.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/paths.hpp b/src/slave/containerizer/mesos/provisioner/docker/paths.hpp
index 7e5122d..d2b0cf9 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/paths.hpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/paths.hpp
@@ -32,15 +32,21 @@ namespace paths {
  * The Docker store file system layout is as follows:
  * Image store dir ('--docker_store_dir' slave flag)
  *    |--staging
+ *       |-- repositories(containing all images info as JSON)
  *       |-- <temp_dir_archive>
  *           |-- <layer_id>
  *               |-- rootfs
+ *               |-- json(manifest)
+ *               |-- VERSION
  *    |--layers
  *       |--<layer_id>
- *           |--rootfs
+ *           |-- rootfs
+ *           |-- json(manifest)
+ *           |-- VERSION
  *    |--storedImages (file holding on cached images)
  */
 
+// TODO(gilbert): Clean up any unused method after refactoring.
 std::string getStagingDir(const std::string& storeDir);
 
 
@@ -80,6 +86,11 @@ std::string getImageLayerPath(
     const std::string& layerId);
 
 
+std::string getImageLayerManifestPath(
+    const std::string& storeDir,
+    const std::string& layerId);
+
+
 std::string getImageLayerRootfsPath(
     const std::string& storeDir,
     const std::string& layerId);