You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/08/22 01:33:07 UTC

[3/3] mesos git commit: Updated depiction of runtime directory file structure.

Updated depiction of runtime directory file structure.

This attempts to match the structure of the top level comments
in "slave/paths.hpp" and "slave/containerizer/mesos/paths.hpp".

The runtime directory tree/drawing now shows all potential entries
that can exist in the file structure and the potential nesting of
containers.

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


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

Branch: refs/heads/master
Commit: 6b3e4b72a0b8e67359ce2bbcd890c4e6c96289f4
Parents: b6549bd
Author: Joseph Wu <jo...@apache.org>
Authored: Mon Aug 21 14:48:36 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Aug 21 18:00:50 2017 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/paths.hpp | 42 +++++++++++++++++++---------
 1 file changed, 29 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6b3e4b72/src/slave/containerizer/mesos/paths.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/paths.hpp b/src/slave/containerizer/mesos/paths.hpp
index 12ae7c7..a03f15e 100644
--- a/src/slave/containerizer/mesos/paths.hpp
+++ b/src/slave/containerizer/mesos/paths.hpp
@@ -37,6 +37,32 @@ namespace slave {
 namespace containerizer {
 namespace paths {
 
+
+// The containerizer uses the runtime directory to checkpoint things
+// for each container, like the PID of the first process executed
+// within a container (i.e., the "PID 1") or the LaunchInfo associated
+// with the given container.
+//
+// The file system layout is as follows:
+//
+//   root ('--runtime_dir' flag)
+//   |-- containers
+//       |-- <container_id>
+//           |-- containers
+//           |   |-- <container_id>
+//           |   |   |-- <more nesting of containers>
+//           |   |-- pid
+//           |   |-- ...
+//           |-- force_destroy_on_recovery
+//           |-- io_switchboard
+//           |   |-- pid
+//           |   |-- socket
+//           |-- launch_info
+//           |-- pid
+//           |-- status
+//           |-- termination
+
+
 constexpr char PID_FILE[] = "pid";
 constexpr char STATUS_FILE[] = "status";
 constexpr char TERMINATION_FILE[] = "termination";
@@ -69,19 +95,9 @@ std::string buildPath(
     const Mode& mode);
 
 
-// The containerizer uses the runtime directory (flag 'runtime_dir')
-// to checkpoint things for each container, e.g., the PID of the first
-// process executed within a container (i.e., the "PID 1") gets
-// checkpointed in a file called 'pid'. The following helper function
-// constructs the path for a container given the 'runtimeDir' that was
-// used as well as the container `containerId`. For example, given two
-// containers, one with ID 'a9dd' and one nested within 'a9dd' with ID
-// '4e3a' and with the flag 'runtime_dir' set to '/var/run/mesos' you
-// would have a directory structure that looks like:
-//
-// /var/run/mesos/containers/a9dd
-// /var/run/mesos/containers/a9dd/pid
-// /var/run/mesos/containers/a9dd/containers/4e3a/pid
+// The following helper function constructs the path
+// for a container given the 'runtimeDir' that was
+// used as well as the container `containerId`.
 std::string getRuntimePath(
     const std::string& runtimeDir,
     const ContainerID& containerId);