mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmah...@apache.org
Subject [2/2] mesos git commit: Updated WebUI to display role information under tab 'Frameworks'.
Date Thu, 02 Mar 2017 21:54:25 GMT
Updated WebUI to display role information under tab 'Frameworks'.

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


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

Branch: refs/heads/master
Commit: 1e2b2ad1b70480a7932ca5d6f9418ac7bc9e1cb3
Parents: abfabb9
Author: Jay Guo <guojiannan1101@gmail.com>
Authored: Thu Mar 2 12:25:42 2017 -0800
Committer: Benjamin Mahler <bmahler@apache.org>
Committed: Thu Mar 2 13:53:07 2017 -0800

----------------------------------------------------------------------
 src/webui/master/static/framework.html    | 15 +++++++++++++--
 src/webui/master/static/frameworks.html   | 24 ++++++++++++++++++------
 src/webui/master/static/js/controllers.js | 10 ++++++++++
 3 files changed, 41 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1e2b2ad1/src/webui/master/static/framework.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/framework.html b/src/webui/master/static/framework.html
index 37e0b31..79dd1a7 100644
--- a/src/webui/master/static/framework.html
+++ b/src/webui/master/static/framework.html
@@ -23,8 +23,13 @@
         <dd ng-show="framework.webui_url"><a href="{{framework.webui_url}}">{{framework.webui_url}}</a></dd>
         <dt>User:</dt>
         <dd>{{framework.user}}</dd>
-        <dt>Role:</dt>
-        <dd>{{framework.role}}</dd>
+        <!-- TODO(bmahler): Consider having a break between each role
+             in order to increase readability. Also, this doesn't
+             display well when there are a lot of roles (e.g. a large
+             organization with a lot of teams & services, using roles
+             like /engineering/frontend/webserver, etc). -->
+        <dt>Roles:</dt>
+        <dd>{{framework.roles.toString()}}</dd>
         <dt>Principal:</dt>
         <dd>{{framework.principal}}</dd>
         <dt>Registered:</dt>
@@ -57,6 +62,7 @@
         <tr>
           <th data-key="id">ID</th>
           <th data-key="name">Name</th>
+          <th data-key="role">Role</th>
           <th data-key="state">State</th>
           <th data-key="start_time">Started</th>
           <th data-key="host">Host</th>
@@ -71,6 +77,7 @@
             </a>
           </td>
           <td>{{task.name}}</td>
+          <td>{{task.role}}</td>
           <td>{{task.state | truncateMesosState}}</td>
           <td>
             <m-timestamp value="{{task.start_time}}"></m-timestamp>
@@ -101,6 +108,7 @@
         <tr>
           <th data-key="id">ID</th>
           <th data-key="name">Name</th>
+          <th data-key="role">Role</th>
           <th data-key="start_time">Started</th>
           <th data-key="agent_id">Agent ID</th>
         </tr>
@@ -109,6 +117,7 @@
         <tr ng-repeat="task in $data">
           <td>{{task.id}}</td>
           <td>{{task.name}}</td>
+          <td>{{task.role}}</td>
           <td>
             <m-timestamp value="{{task.start_time}}"></m-timestamp>
           </td>
@@ -123,6 +132,7 @@
         <tr>
           <th data-key="id">ID</th>
           <th data-key="name">Name</th>
+          <th data-key="role">Role</th>
           <th data-key="state">State</th>
           <th data-key="start_time">Started</th>
           <th data-key="finish_time">Stopped</th>
@@ -134,6 +144,7 @@
         <tr ng-repeat="task in $data">
           <td>{{task.id}}</td>
           <td>{{task.name}}</td>
+          <td>{{task.role}}</td>
           <td>{{task.state | truncateMesosState}}</td>
           <td>
             <m-timestamp value="{{task.start_time}}"></m-timestamp>

http://git-wip-us.apache.org/repos/asf/mesos/blob/1e2b2ad1/src/webui/master/static/frameworks.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/frameworks.html b/src/webui/master/static/frameworks.html
index 0c6fc1c..7debadb 100644
--- a/src/webui/master/static/frameworks.html
+++ b/src/webui/master/static/frameworks.html
@@ -13,7 +13,7 @@
       <th data-key="hostname">Host</th>
       <th data-key="user">User</th>
       <th data-key="name">Name</th>
-      <th data-key="role">Role</th>
+      <th data-key="roles">Roles</th>
       <th data-key="principal">Principal</th>
       <th data-key="tasks.length">Active Tasks</th>
       <th data-key="used_resources.cpus">CPUs</th>
@@ -44,7 +44,11 @@
       </td>
       <td>{{framework.user}}</td>
       <td>{{framework.name}}</td>
-      <td>{{framework.role}}</td>
+      <!-- TODO(bmahler): This doesn't display well when there are a lot
+           of roles (e.g. a large organization with a lot of teams &
+           services, using roles like /engineering/frontend/webserver, etc).
+           Figure out a way to display this without bloating the table. -->
+      <td>{{framework.roles.toString()}}</td>
       <td>{{framework.principal}}</td>
       <td>{{framework.tasks.length}}</td>
       <td>{{framework.used_resources.cpus | number}}</td>
@@ -71,7 +75,7 @@
     <th data-key="hostname">Host</th>
     <th data-key="user">User</th>
     <th data-key="name">Name</th>
-    <th data-key="role">Role</th>
+    <th data-key="roles">Roles</th>
     <th data-key="principal">Principal</th>
     <th data-key="tasks.length">Active Tasks</th>
     <th data-key="used_resources.cpus">CPUs</th>
@@ -102,7 +106,11 @@
     </td>
     <td>{{framework.user}}</td>
     <td>{{framework.name}}</td>
-    <td>{{framework.role}}</td>
+    <!-- TODO(bmahler): This doesn't display well when there are a lot
+         of roles (e.g. a large organization with a lot of teams &
+         services, using roles like /engineering/frontend/webserver, etc).
+         Figure out a way to display this without bloating the table. -->
+    <td>{{framework.roles.toString()}}</td>
     <td>{{framework.principal}}</td>
     <td>{{framework.tasks.length}}</td>
     <td>{{framework.used_resources.cpus | number}}</td>
@@ -129,7 +137,7 @@
       <th data-key="hostname">Host</th>
       <th data-key="user">User</th>
       <th data-key="name">Name</th>
-      <th data-key="role">Role</th>
+      <th data-key="roles">Roles</th>
       <th data-key="principal">Principal</th>
       <th data-key="registered_time">Registered</th>
       <th data-key="unregistered_time">Unregistered</th>
@@ -151,7 +159,11 @@
       <td>{{framework.hostname}}</td>
       <td>{{framework.user}}</td>
       <td>{{framework.name}}</td>
-      <td>{{framework.role}}</td>
+      <!-- TODO(bmahler): This doesn't display well when there are a lot
+           of roles (e.g. a large organization with a lot of teams &
+           services, using roles like /engineering/frontend/webserver, etc).
+           Figure out a way to display this without bloating the table. -->
+      <td>{{framework.roles.toString()}}</td>
       <td>{{framework.principal}}</td>
       <td>
         <m-timestamp value="{{framework.registered_time * 1000}}"></m-timestamp>

http://git-wip-us.apache.org/repos/asf/mesos/blob/1e2b2ad1/src/webui/master/static/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/controllers.js b/src/webui/master/static/js/controllers.js
index 3620047..4e1d07e 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -177,6 +177,11 @@
     _.each($scope.state.frameworks, function(framework) {
       $scope.frameworks[framework.id] = framework;
 
+      // Fill in the `roles` field for non-MULTI_ROLE schedulers.
+      if (framework.role) {
+        framework.roles = [framework.role];
+      }
+
       _.each(framework.offers, function(offer) {
         $scope.offers[offer.id] = offer;
         $scope.offered_cpus += offer.resources.cpus;
@@ -235,6 +240,11 @@
     _.each($scope.state.completed_frameworks, function(framework) {
       $scope.completed_frameworks[framework.id] = framework;
 
+      // Fill in the `roles` field for non-MULTI_ROLE schedulers.
+      if (framework.role) {
+        framework.roles = [framework.role];
+      }
+
       _.each(framework.completed_tasks, setTaskMetadata);
     });
 


Mime
View raw message