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 2016/08/15 18:54:50 UTC

[1/3] mesos git commit: Added default stub for launch in Mesos containerizer.

Repository: mesos
Updated Branches:
  refs/heads/master 3afef704d -> 1d9cc2a18


Added default stub for launch in Mesos containerizer.

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


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

Branch: refs/heads/master
Commit: 1d9cc2a18b29b170f009bba85cba0062c9355f81
Parents: 075256b
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Aug 15 11:33:53 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Aug 15 11:54:45 2016 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/containerizer.cpp | 45 +++++++++++++++++++-
 src/slave/containerizer/mesos/containerizer.hpp | 12 ++++++
 2 files changed, 56 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1d9cc2a1/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 8b525ce..9b0cca2 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -433,8 +433,19 @@ Future<bool> MesosContainerizer::launch(
     const map<string, string>& environment,
     bool checkpoint)
 {
+  // Need to disambiguate for the compiler.
+  Future<bool> (MesosContainerizerProcess::*launch)(
+      const ContainerID&,
+      const Option<TaskInfo>&,
+      const ExecutorInfo&,
+      const string&,
+      const Option<string>&,
+      const SlaveID&,
+      const map<string, string>&,
+      bool) = &MesosContainerizerProcess::launch;
+
   return dispatch(process.get(),
-                  &MesosContainerizerProcess::launch,
+                  launch,
                   containerId,
                   taskInfo,
                   executorInfo,
@@ -446,6 +457,28 @@ Future<bool> MesosContainerizer::launch(
 }
 
 
+Future<Nothing> MesosContainerizer::launch(
+    const ContainerID& containerId,
+    const CommandInfo& commandInfo,
+    const Option<ContainerInfo>& containerInfo,
+    const Resources& resources)
+{
+  // Need to disambiguate for the compiler.
+  Future<Nothing> (MesosContainerizerProcess::*launch)(
+      const ContainerID&,
+      const CommandInfo&,
+      const Option<ContainerInfo>&,
+      const Resources&) = &MesosContainerizerProcess::launch;
+
+  return dispatch(process.get(),
+                  launch,
+                  containerId,
+                  commandInfo,
+                  containerInfo,
+                  resources);
+}
+
+
 Future<Nothing> MesosContainerizer::update(
     const ContainerID& containerId,
     const Resources& resources)
@@ -1411,6 +1444,16 @@ Future<bool> MesosContainerizerProcess::exec(
 }
 
 
+Future<Nothing> MesosContainerizerProcess::launch(
+    const ContainerID& containerId,
+    const CommandInfo& commandInfo,
+    const Option<ContainerInfo>& containerInfo,
+    const Resources& resources)
+{
+  return Failure("Unsupported");
+}
+
+
 Future<containerizer::Termination> MesosContainerizerProcess::wait(
     const ContainerID& containerId)
 {

http://git-wip-us.apache.org/repos/asf/mesos/blob/1d9cc2a1/src/slave/containerizer/mesos/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.hpp b/src/slave/containerizer/mesos/containerizer.hpp
index c3e3066..8180fea 100644
--- a/src/slave/containerizer/mesos/containerizer.hpp
+++ b/src/slave/containerizer/mesos/containerizer.hpp
@@ -84,6 +84,12 @@ public:
       const std::map<std::string, std::string>& environment,
       bool checkpoint);
 
+  virtual process::Future<Nothing> launch(
+      const ContainerID& containerId,
+      const CommandInfo& commandInfo,
+      const Option<ContainerInfo>& containerInfo,
+      const Resources& resources);
+
   virtual process::Future<Nothing> update(
       const ContainerID& containerId,
       const Resources& resources);
@@ -142,6 +148,12 @@ public:
       const std::map<std::string, std::string>& environment,
       bool checkpoint);
 
+  virtual process::Future<Nothing> launch(
+      const ContainerID& containerId,
+      const CommandInfo& commandInfo,
+      const Option<ContainerInfo>& containerInfo,
+      const Resources& resources);
+
   virtual process::Future<Nothing> update(
       const ContainerID& containerId,
       const Resources& resources);


[2/3] mesos git commit: Added a containerizer launch interface to launch sub-containers.

Posted by ji...@apache.org.
Added a containerizer launch interface to launch sub-containers.

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


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

Branch: refs/heads/master
Commit: 075256be901c991e12735f586bf3ee43adc520aa
Parents: 61fd1e0
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Aug 15 10:50:16 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Aug 15 11:54:45 2016 -0700

----------------------------------------------------------------------
 src/slave/containerizer/containerizer.hpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/075256be/src/slave/containerizer/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/containerizer.hpp b/src/slave/containerizer/containerizer.hpp
index 14f298e..bf39aaa 100644
--- a/src/slave/containerizer/containerizer.hpp
+++ b/src/slave/containerizer/containerizer.hpp
@@ -90,6 +90,17 @@ public:
       const std::map<std::string, std::string>& environment,
       bool checkpoint) = 0;
 
+  // Launch a nested container.
+  // TODO(jieyu): Consider combining with the 'launch' above.
+  virtual process::Future<Nothing> launch(
+      const ContainerID& containerId,
+      const CommandInfo& commandInfo,
+      const Option<ContainerInfo>& containerInfo,
+      const Resources& resources)
+  {
+    return process::Failure("Unsupported");
+  }
+
   // Update the resources for a container.
   virtual process::Future<Nothing> update(
       const ContainerID& containerId,


[3/3] mesos git commit: Supported nested ContainerID.

Posted by ji...@apache.org.
Supported nested ContainerID.

Introduced an optional 'parent' field in ContainerID so it can encode
nesting relationship.

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


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

Branch: refs/heads/master
Commit: 61fd1e030ef80c39826e6221e3c9e3e12a5d1499
Parents: 3afef70
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Aug 15 11:32:15 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Aug 15 11:54:45 2016 -0700

----------------------------------------------------------------------
 include/mesos/mesos.proto | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/61fd1e03/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index af29dab..cd75038 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -82,13 +82,14 @@ message ExecutorID {
 
 
 /**
- * A slave-generated ID to distinguish a container. The ID must be unique
- * between any active or completed containers on the slave. In particular,
- * containers for different runs of the same (framework, executor) pair must be
- * unique.
+ * ID used to uniquely identify a container. If the `parent` is not
+ * specified, the ID is a UUID generated by the agent to uniquely
+ * identify the container of an executor run. If the `parent` field is
+ * specified, it represents a nested container.
  */
 message ContainerID {
   required string value = 1;
+  optional ContainerID parent = 2;
 }