You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/03/01 00:04:07 UTC

[6/6] mesos git commit: Windows: Ported `mesos-master` for testing.

Windows: Ported `mesos-master` for testing.

This patch ports the `mesos-master` executable to Windows. Note that
this is only for testing, as we still lack support for a persistent
registry through `leveldb`, the master can only be run with
`--registry=in_memory` on Windows. However, this with the CLI is
enough to test the whole Mesos stack on a single Windows node.

The change was to temporarily remove support for the
`--ip_discovery_command` flag on Windows, since it uses a deleted
function, `os::shell`, instead emit an appropriate error message. When
`os::shell` is implemented on Windows, we will add support for
`--ip_discovery_command` back to the agent and master.

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


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

Branch: refs/heads/master
Commit: e0552d83e5ec8f17f9116a08a666662734992eea
Parents: 9732158
Author: Sachin Paryani <sa...@gmail.com>
Authored: Wed Feb 28 11:13:31 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Feb 28 16:03:26 2018 -0800

----------------------------------------------------------------------
 src/master/CMakeLists.txt | 11 ++++-------
 src/master/main.cpp       |  6 ++++++
 src/slave/main.cpp        |  2 ++
 3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e0552d83/src/master/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/master/CMakeLists.txt b/src/master/CMakeLists.txt
index ec55211..b8953bd 100644
--- a/src/master/CMakeLists.txt
+++ b/src/master/CMakeLists.txt
@@ -14,10 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# TODO(josephw): Enable this on Windows after sorting out the dependencies.
-if (NOT WIN32)
-  # THE MASTER EXECUTABLE.
-  ########################
-  add_executable(mesos-master main.cpp)
-  target_link_libraries(mesos-master PRIVATE mesos)
-endif ()
+# THE MASTER EXECUTABLE.
+########################
+add_executable(mesos-master main.cpp)
+target_link_libraries(mesos-master PRIVATE mesos)

http://git-wip-us.apache.org/repos/asf/mesos/blob/e0552d83/src/master/main.cpp
----------------------------------------------------------------------
diff --git a/src/master/main.cpp b/src/master/main.cpp
index 8cb52d0..3d93fd4 100644
--- a/src/master/main.cpp
+++ b/src/master/main.cpp
@@ -199,6 +199,7 @@ int main(int argc, char** argv)
   }
 
   if (flags.ip_discovery_command.isSome()) {
+#ifndef __WINDOWS__
     Try<string> ipAddress = os::shell(flags.ip_discovery_command.get());
 
     if (ipAddress.isError()) {
@@ -206,6 +207,11 @@ int main(int argc, char** argv)
     }
 
     os::setenv("LIBPROCESS_IP", strings::trim(ipAddress.get()));
+#else
+    // TODO(andschwa): Support this when `os::shell` is enabled.
+    EXIT(EXIT_FAILURE)
+      << "The `--ip.discovery_command` is not yet supported on Windows";
+#endif // __WINDOWS__
   } else if (flags.ip.isSome()) {
     os::setenv("LIBPROCESS_IP", flags.ip.get());
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/e0552d83/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index b95bb25..6743727 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -328,6 +328,7 @@ int main(int argc, char** argv)
 
     os::setenv("LIBPROCESS_IP", strings::trim(ipAddress.get()));
 #else
+    // TODO(andschwa): Support this when `os::shell` is enabled.
     EXIT(EXIT_FAILURE)
       << "The `--ip_discovery_command` is not yet supported on Windows";
 #endif // __WINDOWS__
@@ -344,6 +345,7 @@ int main(int argc, char** argv)
 
     os::setenv("LIBPROCESS_IP6", strings::trim(ip6Address.get()));
 #else
+    // TODO(andschwa): Support this when `os::shell` is enabled.
     EXIT(EXIT_FAILURE)
       << "The `--ip6_discovery_command` is not yet supported on Windows";
 #endif // __WINDOWS__