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 2016/12/20 22:28:55 UTC

[1/5] mesos git commit: Windows: Added `Winsock` initialization in `docker-mesos-executor`.

Repository: mesos
Updated Branches:
  refs/heads/master b743fb474 -> 3755d37f0


Windows: Added `Winsock` initialization in `docker-mesos-executor`.

This adds a RAII object for initializing and destructing the Windows
Socket stack inside the default docker executor binary.  This object
is needed for any socket operations to succeed on Windows.

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


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

Branch: refs/heads/master
Commit: cf4939f4552213bcde089d96a1170238f4a06727
Parents: 4a411b8
Author: Daniel Pravat <dp...@outlook.com>
Authored: Mon Dec 19 16:23:01 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Dec 20 12:48:34 2016 -0800

----------------------------------------------------------------------
 src/docker/executor.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cf4939f4/src/docker/executor.cpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 94e116f..9b5c469 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -29,6 +29,10 @@
 #include <process/reap.hpp>
 #include <process/subprocess.hpp>
 
+#ifdef __WINDOWS__
+#include <process/windows/winsock.hpp>
+#endif // __WINDOWS__
+
 #include <stout/error.hpp>
 #include <stout/flags.hpp>
 #include <stout/json.hpp>
@@ -671,6 +675,11 @@ int main(int argc, char** argv)
 {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
+#ifdef __WINDOWS__
+  // Initialize the Windows socket stack.
+  process::Winsock winsock;
+#endif // __WINDOWS__
+
   mesos::internal::docker::Flags flags;
 
   // Load flags from environment and command line.


[4/5] mesos git commit: Windows: Changed `MESOS_SANDBOX` to a Windows-style path.

Posted by jo...@apache.org.
Windows: Changed `MESOS_SANDBOX` to a Windows-style path.

This changes the default value for the `MESOS_SANDBOX` environment
variable passed to containers, on Windows, to a Windows-style path.
Because root filesystem changes are not supported (yet) on the Mesos
containerizer, this only affects the Docker containerizer.

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


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

Branch: refs/heads/master
Commit: 704654c423a3859951d15eb42aab3e79fe1a9cf6
Parents: 8de635c
Author: Daniel Pravat <dp...@outlook.com>
Authored: Tue Dec 20 13:20:59 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Dec 20 13:27:03 2016 -0800

----------------------------------------------------------------------
 src/slave/flags.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/704654c4/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 5fb91fb..1eccea9 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -659,7 +659,12 @@ mesos::internal::slave::Flags::Flags()
       "sandbox_directory",
       "The absolute path for the directory in the container where the\n"
       "sandbox is mapped to.\n",
-      "/mnt/mesos/sandbox");
+#ifndef __WINDOWS__
+      "/mnt/mesos/sandbox"
+#else
+      "C:\\mesos\\sandbox"
+#endif // __WINDOWS__
+      );
 
   add(&Flags::default_container_info,
       "default_container_info",


[5/5] mesos git commit: Windows: Changed the shell used by the docker containerizer.

Posted by jo...@apache.org.
Windows: Changed the shell used by the docker containerizer.

This changes the command given to the Docker CLI when the CommandInfo
specifies `shell=true`.  Instead of `/bin/sh -c`, the Windows command
will be `cmd /c`.

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


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

Branch: refs/heads/master
Commit: 3755d37f011a1f48ca9a6efe80b3bd79d5354609
Parents: 704654c
Author: Daniel Pravat <dp...@outlook.com>
Authored: Tue Dec 20 13:39:30 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Dec 20 13:39:30 2016 -0800

----------------------------------------------------------------------
 src/docker/docker.cpp | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3755d37f/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index b2a547d..472cb1b 100755
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -804,11 +804,16 @@ Future<Option<int>> Docker::run(
 
   if (commandInfo.shell()) {
     // We override the entrypoint if shell is enabled because we
-    // assume the user intends to run the command within /bin/sh
+    // assume the user intends to run the command within a shell
     // and not the default entrypoint of the image. View MESOS-1770
     // for more details.
     argv.push_back("--entrypoint");
+
+#ifdef __WINDOWS__
+    argv.push_back("cmd");
+#else
     argv.push_back("/bin/sh");
+#endif // __WINDOWS__
   }
 
   argv.push_back("--name");
@@ -820,10 +825,15 @@ Future<Option<int>> Docker::run(
       return Failure("Shell specified but no command value provided");
     }
 
-    // Adding -c here because Docker cli only supports a single word
-    // for overriding entrypoint, so adding the -c flag for /bin/sh
-    // as part of the command.
+    // The Docker CLI only supports a single word for overriding the
+    // entrypoint, so we must specify `-c` (or `/c` on Windows)
+    // for the other parts of the command.
+#ifdef __WINDOWS__
+    argv.push_back("/c");
+#else
     argv.push_back("-c");
+#endif // __WINDOWS__
+
     argv.push_back(commandInfo.value());
   } else {
     if (commandInfo.has_value()) {


[2/5] mesos git commit: CMake: Fixed typo in `-DHAS_AUTHENTICATION=0` instructions.

Posted by jo...@apache.org.
CMake: Fixed typo in `-DHAS_AUTHENTICATION=0` instructions.

Windows builds without this flag instruct you to add it,
but the instructions were missing the prefix `D` for define,
and so as-is resulted in an error message. This could be a
source of frustration for those unfamiliar with CMake.

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


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

Branch: refs/heads/master
Commit: 4a411b8aacfc9341aca71e9e10070fc5aaf29171
Parents: b743fb4
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Dec 19 14:22:10 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Dec 20 12:48:34 2016 -0800

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4a411b8a/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index d857587..1349afb 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -59,7 +59,7 @@ if (WIN32 AND HAS_AUTHENTICATION)
     FATAL_ERROR
     "Windows builds of Mesos currently do not support agent to master "
     "authentication. To build without this capability, pass "
-    "`-HAS_AUTHENTICATION=0` as an argument when you run CMake.")
+    "`-DHAS_AUTHENTICATION=0` as an argument when you run CMake.")
 endif (WIN32 AND HAS_AUTHENTICATION)
 
 # If 'REBUNDLED' is set to FALSE, this will cause Mesos to build against


[3/5] mesos git commit: Windows: Added `.exe` extension for `docker-mesos-executor`.

Posted by jo...@apache.org.
Windows: Added `.exe` extension for `docker-mesos-executor`.

This refactors three references to the `docker-mesos-executor` binary
in the Docker Containerizer code.  On Windows, the binaries are
generated with an `.exe` extension.

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


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

Branch: refs/heads/master
Commit: 8de635cb6616cc909b3a8354e06aaa09f308ec39
Parents: cf4939f
Author: Daniel Pravat <dp...@outlook.com>
Authored: Tue Dec 20 12:56:17 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Dec 20 12:56:17 2016 -0800

----------------------------------------------------------------------
 src/slave/containerizer/docker.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8de635cb/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index 7ef5928..7a8a727 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -94,6 +94,14 @@ const string DOCKER_NAME_SEPERATOR = ".";
 const string DOCKER_SYMLINK_DIRECTORY = "docker/links";
 
 
+#ifdef __WINDOWS__
+const string MESOS_DOCKER_EXECUTOR = "mesos-docker-executor.exe";
+#else
+const string MESOS_DOCKER_EXECUTOR = "mesos-docker-executor";
+#endif // __WINDOWS__
+
+
+
 // Parse the ContainerID from a Docker container and return None if
 // the container was not launched from Mesos.
 Option<ContainerID> parse(const Docker::Container& container)
@@ -359,7 +367,7 @@ DockerContainerizerProcess::Container::create(
     newCommandInfo.set_shell(false);
 
     newCommandInfo.set_value(
-        path::join(flags.launcher_dir, "mesos-docker-executor"));
+        path::join(flags.launcher_dir, MESOS_DOCKER_EXECUTOR));
 
     // Stringify the flags as arguments.
     // This minimizes the need for escaping flag values.
@@ -1402,7 +1410,7 @@ Future<pid_t> DockerContainerizerProcess::launchExecutorProcess(
   }
 
   vector<string> argv;
-  argv.push_back("mesos-docker-executor");
+  argv.push_back(MESOS_DOCKER_EXECUTOR);
 
   Future<Nothing> allocateGpus = Nothing();
 
@@ -1476,7 +1484,7 @@ Future<pid_t> DockerContainerizerProcess::launchExecutorProcess(
     // container (to distinguish it from Docker containers not created
     // by Mesos).
     Try<Subprocess> s = subprocess(
-        path::join(flags.launcher_dir, "mesos-docker-executor"),
+        path::join(flags.launcher_dir, MESOS_DOCKER_EXECUTOR),
         argv,
         Subprocess::PIPE(),
         subprocessInfo.out,