You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/10/27 01:41:24 UTC

svn commit: r1402722 - in /incubator/mesos/trunk: include/mesos/ src/ src/deploy/ src/local/ src/master/ src/mesos/ src/slave/ src/tests/ src/webui/ src/webui/bottle-0.8.3/ src/webui/bottle-0.8.3/test/ src/webui/bottle-0.8.3/test/views/ src/webui/commo...

Author: benh
Date: Fri Oct 26 23:41:22 2012
New Revision: 1402722

URL: http://svn.apache.org/viewvc?rev=1402722&view=rev
Log:
Removed the old Python-based webui.

From: Ben Mahler <be...@gmail.com>
Review: https://reviews.apache.org/r/7708

Removed:
    incubator/mesos/trunk/src/master/webui.cpp
    incubator/mesos/trunk/src/master/webui.hpp
    incubator/mesos/trunk/src/slave/webui.cpp
    incubator/mesos/trunk/src/slave/webui.hpp
    incubator/mesos/trunk/src/webui/bottle-0.8.3/PKG-INFO
    incubator/mesos/trunk/src/webui/bottle-0.8.3/bottle.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/setup.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_environ.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_jinja2.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_mako.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_mdict.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_outputfilter.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_router.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_securecookies.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_sendfile.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_stpl.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/test_wsgi.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/testall.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/tools.py
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/jinja2_base.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/jinja2_inherit.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/jinja2_simple.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/mako_base.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/mako_inherit.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/mako_simple.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/stpl_include.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/stpl_simple.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/stpl_t2base.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/stpl_t2inc.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/stpl_t2main.tpl
    incubator/mesos/trunk/src/webui/bottle-0.8.3/test/views/stpl_unicode.tpl
    incubator/mesos/trunk/src/webui/common/webui_lib.py
    incubator/mesos/trunk/src/webui/master/framework.tpl
    incubator/mesos/trunk/src/webui/master/index.tpl
    incubator/mesos/trunk/src/webui/master/webui.py
    incubator/mesos/trunk/src/webui/slave/executor.tpl
    incubator/mesos/trunk/src/webui/slave/framework.tpl
    incubator/mesos/trunk/src/webui/slave/index.tpl
    incubator/mesos/trunk/src/webui/slave/webui.py
    incubator/mesos/trunk/src/webui/static/stylesheet.css
    incubator/mesos/trunk/src/webui/webui.cpp
    incubator/mesos/trunk/src/webui/webui.hpp
Modified:
    incubator/mesos/trunk/include/mesos/mesos.proto
    incubator/mesos/trunk/src/Makefile.am
    incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in
    incubator/mesos/trunk/src/local/main.cpp
    incubator/mesos/trunk/src/master/flags.hpp
    incubator/mesos/trunk/src/master/http.cpp
    incubator/mesos/trunk/src/master/main.cpp
    incubator/mesos/trunk/src/mesos/main.cpp
    incubator/mesos/trunk/src/slave/flags.hpp
    incubator/mesos/trunk/src/slave/main.cpp
    incubator/mesos/trunk/src/slave/slave.cpp
    incubator/mesos/trunk/src/tests/state_tests.cpp
    incubator/mesos/trunk/src/webui/master/static/home.html

Modified: incubator/mesos/trunk/include/mesos/mesos.proto
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/include/mesos/mesos.proto?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/include/mesos/mesos.proto (original)
+++ incubator/mesos/trunk/include/mesos/mesos.proto Fri Oct 26 23:41:22 2012
@@ -156,8 +156,8 @@ message MasterInfo {
 message SlaveInfo {
   required string hostname = 1;
   // TODO(benh,andyk): Send bound ports, not just hostname.
-  required string webui_hostname = 2;
-  optional int32 webui_port = 4 [default = 8081];
+  required string webui_hostname = 2;             // Deprecated!
+  optional int32 webui_port = 4 [default = 8081]; // Deprecated!
   repeated Resource resources = 3;
   repeated Attribute attributes = 5;
   optional SlaveID id = 6;

Modified: incubator/mesos/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/Makefile.am?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/Makefile.am (original)
+++ incubator/mesos/trunk/src/Makefile.am Fri Oct 26 23:41:22 2012
@@ -97,7 +97,7 @@ endif
 # convenience libraries (that is, libraries that do not get installed
 # but we can use as building blocks to vary compile flags as necessary
 # and then aggregate into final archives): libmesos_no_third_party.la
-# libbuild.la, liblog.la, libwebui.la, libjava.la.
+# libbuild.la, liblog.la, libjava.la.
 
 # First, let's define necessary protocol buffer files.
 
@@ -203,7 +203,7 @@ libmesos_no_third_party_la_SOURCES += co
 	master/frameworks_manager.hpp					\
 	master/hierarchical_allocator_process.hpp master/http.hpp	\
 	master/master.hpp master/slaves_manager.hpp master/sorter.hpp	\
-	master/webui.hpp messages/messages.hpp slave/constants.hpp	\
+	messages/messages.hpp slave/constants.hpp			\
 	slave/flags.hpp slave/gc.hpp slave/http.hpp			\
 	slave/isolation_module.hpp slave/isolation_module_factory.hpp	\
 	slave/cgroups_isolation_module.hpp				\
@@ -211,7 +211,7 @@ libmesos_no_third_party_la_SOURCES += co
 	slave/paths.hpp slave/state.hpp					\
 	slave/process_based_isolation_module.hpp slave/reaper.hpp	\
 	slave/slave.hpp slave/solaris_project_isolation_module.hpp	\
-	slave/webui.hpp tests/environment.hpp tests/script.hpp		\
+	tests/environment.hpp tests/script.hpp				\
 	tests/zookeeper_test.hpp tests/flags.hpp tests/utils.hpp	\
 	tests/filter.hpp                                                \
 	tests/zookeeper_test_server.hpp zookeeper/authentication.hpp	\
@@ -235,7 +235,7 @@ BUILD_FLAGS = $(echo $(MESOS_CPPFLAGS) $
               $(echo $(AM_CFLAGS) $(CFLAGS) | sed 's/\"/\\\"/g') \
               $(echo $(AM_CXXFLAGS) $(CXXFLAGS) | sed 's/\"/\\\"/g')
 
-# TODO(benh): Provide other build flags such as WEBUI_FLAGS, etc.
+# TODO(benh): Provide other build flags.
 
 libbuild_la_CPPFLAGS += -DBUILD_FLAGS="\"$$BUILD_FLAGS\""
 
@@ -266,27 +266,6 @@ libstate_la_CPPFLAGS = -I../$(LEVELDB)/i
 
 libmesos_no_third_party_la_LIBADD += libstate.la
 
-
-# Convenience library for the webui to include Python specific flags.
-if WEBUI
-noinst_LTLIBRARIES += libwebui.la
-libwebui_la_SOURCES = master/webui.cpp slave/webui.cpp webui/webui.cpp
-libwebui_la_SOURCES += master/webui.hpp slave/webui.hpp webui/webui.hpp
-libwebui_la_CPPFLAGS = $(MESOS_CPPFLAGS) $(WEBUI_CPPFLAGS)
-libwebui_la_LIBADD = $(WEBUI_LDFLAGS)
-
-# Also define WEBUI_LIB to include the webui so when we build the
-# binaries (e.g., mesos-master, mesos-slave) the webui will get
-# included (we don't include it by default in either
-# libmesos_no_third_party.la or libmesos.la because that would force a
-# dependency on Python, but in the future we might want to support
-# this when we want a "local" run to include support for the webui).
-WEBUI_LIB = libwebui.la
-else
-WEBUI_LIB =
-endif
-
-
 # The final result!
 lib_LTLIBRARIES += libmesos.la
 
@@ -323,12 +302,12 @@ libmesos_la_LIBADD += ../$(LIBPROCESS)/l
 sbin_PROGRAMS += mesos-master
 mesos_master_SOURCES = master/main.cpp
 mesos_master_CPPFLAGS = $(MESOS_CPPFLAGS)
-mesos_master_LDADD = $(WEBUI_LIB) libmesos.la
+mesos_master_LDADD = libmesos.la
 
 sbin_PROGRAMS += mesos-slave
 mesos_slave_SOURCES = slave/main.cpp
 mesos_slave_CPPFLAGS = $(MESOS_CPPFLAGS)
-mesos_slave_LDADD = $(WEBUI_LIB) libmesos.la
+mesos_slave_LDADD = libmesos.la
 
 bin_PROGRAMS += mesos-local
 mesos_local_SOURCES = local/main.cpp
@@ -361,15 +340,6 @@ mesos_mesos_SOURCES = mesos/main.cpp
 mesos_mesos_CPPFLAGS = $(MESOS_CPPFLAGS)
 mesos_mesos_LDADD = libmesos.la
 
-
-# Need to distribute/install Python webui.
-nobase_dist_webui_DATA += webui/bottle-0.8.3/bottle.py	\
-  webui/common/webui_lib.py webui/master/framework.tpl	\
-  webui/master/index.tpl webui/master/webui.py		\
-  webui/slave/framework.tpl webui/slave/executor.tpl	\
-  webui/slave/index.tpl webui/slave/webui.py		\
-  webui/static/stylesheet.css
-
 # Need to distribute/install webui javascript.
 nobase_dist_webui_DATA += webui/master/static/controllers.js		\
   webui/master/static/app.js webui/master/static/dashboard.js		\

Modified: incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in (original)
+++ incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in Fri Oct 26 23:41:22 2012
@@ -32,6 +32,6 @@ done
 @sbindir@/mesos-start-masters.sh && sleep 1 && @sbindir@/mesos-start-slaves.sh
 
 # TODO(benh): Check the health of the masters (and possibly slaves)
-# and print the masters webui address (or just the leading master).
+# and print the master's webui address (or just the leading master).
 
 echo "Everything's started!"
\ No newline at end of file

Modified: incubator/mesos/trunk/src/local/main.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/local/main.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/local/main.cpp (original)
+++ incubator/mesos/trunk/src/local/main.cpp Fri Oct 26 23:41:22 2012
@@ -60,12 +60,6 @@ int main(int argc, char **argv)
 {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
-  // TODO(benh): Add master and slave flags! This is impossible right
-  // now because both have 'webui_dir' and 'webui_port' that
-  // conflict. For now, all the flags will still get "validated" when
-  // we load them (i.e., in local::launch), they just won't be visible
-  // when you do '--help' (which is probably not a huge issue for
-  // mesos-local).
   flags::Flags<logging::Flags, local::Flags> flags;
 
   // The following flags are executable specific (e.g., since we only

Modified: incubator/mesos/trunk/src/master/flags.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/flags.hpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/flags.hpp (original)
+++ incubator/mesos/trunk/src/master/flags.hpp Fri Oct 26 23:41:22 2012
@@ -51,11 +51,6 @@ public:
         "Location of the webui files/assets",
         MESOS_WEBUI_DIR);
 
-    add(&Flags::webui_port,
-        "webui_port",
-        "Web UI port (deprecated)",
-        8080);
-
     add(&Flags::whitelist,
         "whitelist",
         "Path to a file with a list of slaves\n"
@@ -92,7 +87,6 @@ public:
   bool root_submissions;
   std::string slaves;
   std::string webui_dir;
-  uint16_t webui_port;
   std::string whitelist;
   std::string user_sorter;
   std::string framework_sorter;

Modified: incubator/mesos/trunk/src/master/http.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/http.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/http.cpp (original)
+++ incubator/mesos/trunk/src/master/http.cpp Fri Oct 26 23:41:22 2012
@@ -201,8 +201,6 @@ JSON::Object model(const Slave& slave)
   object.values["id"] = slave.id.value();
   object.values["pid"] = string(slave.pid);
   object.values["hostname"] = slave.info.hostname();
-  object.values["webui_hostname"] = slave.info.webui_hostname();
-  object.values["webui_port"] = slave.info.webui_port();
   object.values["registered_time"] = slave.registeredTime;
   object.values["resources"] = model(slave.info.resources());
   object.values["attributes"] = model(slave.info.attributes());

Modified: incubator/mesos/trunk/src/master/main.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/main.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/main.cpp (original)
+++ incubator/mesos/trunk/src/master/main.cpp Fri Oct 26 23:41:22 2012
@@ -34,7 +34,6 @@
 
 #include "master/allocator.hpp"
 #include "master/master.hpp"
-#include "master/webui.hpp"
 
 using namespace mesos::internal;
 using namespace mesos::internal::master;
@@ -127,10 +126,6 @@ int main(int argc, char** argv)
   CHECK(detector.isSome())
     << "Failed to create a master detector: " << detector.error();
 
-#ifdef MESOS_WEBUI
-  webui::start(master->self(), flags);
-#endif
-
   process::wait(master->self());
   delete master;
   delete allocator;

Modified: incubator/mesos/trunk/src/mesos/main.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/mesos/main.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/mesos/main.cpp (original)
+++ incubator/mesos/trunk/src/mesos/main.cpp Fri Oct 26 23:41:22 2012
@@ -37,9 +37,6 @@ int main(int argc, char** argv)
   // to advertise the port and ip option once, here).
   configurator.addOption<int>("port", 'p', "Port to listen on", 5050);
   configurator.addOption<string>("ip", "IP address to listen on");
-#ifdef MESOS_WEBUI
-  configurator.addOption<int>("webui_port", "Web UI port", 8080);
-#endif
   configurator.addOption<string>(
       "master",
       'm',

Modified: incubator/mesos/trunk/src/slave/flags.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/flags.hpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/flags.hpp (original)
+++ incubator/mesos/trunk/src/slave/flags.hpp Fri Oct 26 23:41:22 2012
@@ -61,11 +61,6 @@ public:
         "Location of the webui files/assets",
         MESOS_WEBUI_DIR);
 
-    add(&Flags::webui_port,
-        "webui_port",
-        "Web UI port (deprecated)",
-        8081);
-
     add(&Flags::hadoop_home,
         "hadoop_home",
         "Where to find Hadoop installed (for\n"
@@ -119,7 +114,6 @@ public:
   std::string work_dir;
   std::string launcher_dir;
   std::string webui_dir;
-  uint16_t webui_port;
   std::string hadoop_home; // TODO(benh): Make an Option.
   bool switch_user;
   std::string frameworks_home;  // TODO(benh): Make an Option.

Modified: incubator/mesos/trunk/src/slave/main.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/main.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/main.cpp (original)
+++ incubator/mesos/trunk/src/slave/main.cpp Fri Oct 26 23:41:22 2012
@@ -34,7 +34,6 @@
 
 #include "slave/isolation_module_factory.hpp"
 #include "slave/slave.hpp"
-#include "slave/webui.hpp"
 
 using namespace mesos::internal;
 using namespace mesos::internal::slave;
@@ -141,10 +140,6 @@ int main(int argc, char** argv)
   CHECK(detector.isSome())
     << "Failed to create a master detector: " << detector.error();
 
-#ifdef MESOS_WEBUI
-  webui::start(slave->self(), flags);
-#endif
-
   process::wait(slave->self());
   delete slave;
 

Modified: incubator/mesos/trunk/src/slave/slave.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.cpp (original)
+++ incubator/mesos/trunk/src/slave/slave.cpp Fri Oct 26 23:41:22 2012
@@ -187,8 +187,7 @@ void Slave::initialize()
 
   // Initialize slave info.
   info.set_hostname(hostname);
-  info.set_webui_hostname(webui_hostname);
-  info.set_webui_port(flags.webui_port);
+  info.set_webui_hostname(webui_hostname); // Deprecated!
   info.mutable_resources()->MergeFrom(resources);
   info.mutable_attributes()->MergeFrom(attributes);
 

Modified: incubator/mesos/trunk/src/tests/state_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/state_tests.cpp?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/state_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/state_tests.cpp Fri Oct 26 23:41:22 2012
@@ -55,13 +55,9 @@ using namespace process;
 void GetSetGet(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-
-  variable.await();
-
-  ASSERT_TRUE(variable.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(variable);
 
   Variable<Slaves> slaves1 = variable.get();
-
   EXPECT_TRUE(slaves1->infos().size() == 0);
 
   SlaveInfo info;
@@ -94,13 +90,9 @@ void GetSetGet(State<ProtobufSerializer>
 void GetSetSetGet(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-
-  variable.await();
-
-  ASSERT_TRUE(variable.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(variable);
 
   Variable<Slaves> slaves1 = variable.get();
-
   EXPECT_TRUE(slaves1->infos().size() == 0);
 
   SlaveInfo info;
@@ -142,23 +134,15 @@ void GetSetSetGet(State<ProtobufSerializ
 void GetGetSetSetGet(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-
-  variable.await();
-
-  ASSERT_TRUE(variable.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(variable);
 
   Variable<Slaves> slaves1 = variable.get();
-
   EXPECT_TRUE(slaves1->infos().size() == 0);
 
   variable = state->get<Slaves>("slaves");
-
-  variable.await();
-
-  ASSERT_TRUE(variable.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(variable);
 
   Variable<Slaves> slaves2 = variable.get();
-
   EXPECT_TRUE(slaves2->infos().size() == 0);
 
   SlaveInfo info2;
@@ -181,17 +165,11 @@ void GetGetSetSetGet(State<ProtobufSeria
   slaves1->add_infos()->MergeFrom(info1);
 
   result = state->set(slaves1);
-
-  result.await();
-
-  ASSERT_TRUE(result.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(result);
   EXPECT_TRUE(result.get().isNone());
 
   variable = state->get<Slaves>("slaves");
-
-  variable.await();
-
-  ASSERT_TRUE(variable.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(variable);
 
   slaves1 = variable.get();
 
@@ -204,13 +182,9 @@ void GetGetSetSetGet(State<ProtobufSeria
 void Names(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-
-  variable.await();
-
-  ASSERT_TRUE(variable.isReady());
+  ASSERT_FUTURE_WILL_SUCCEED(variable);
 
   Variable<Slaves> slaves1 = variable.get();
-
   EXPECT_TRUE(slaves1->infos().size() == 0);
 
   SlaveInfo info;

Modified: incubator/mesos/trunk/src/webui/master/static/home.html
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/webui/master/static/home.html?rev=1402722&r1=1402721&r2=1402722&view=diff
==============================================================================
--- incubator/mesos/trunk/src/webui/master/static/home.html (original)
+++ incubator/mesos/trunk/src/webui/master/static/home.html Fri Oct 26 23:41:22 2012
@@ -281,7 +281,7 @@
           </td>
           <td><a href="{{'#/framework/' + offer.framework_id}}">{{offer.framework_name}}</a></td>
           <td>
-            <a href="http://{{slaves[offer.slave_id].webui_hostname}}:{{slaves[offer.slave_id].webui_port}}/">
+            <a href="#/slaves/{{slaves[offer.slave_id].id}}">
               {{offer.hostname}}
             </a>
           </td>