You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2017/03/02 21:54:24 UTC

[1/2] mesos git commit: Updated WebUI to display role information under tab 'Agents'.

Repository: mesos
Updated Branches:
  refs/heads/master cc15db4b1 -> 1e2b2ad1b


Updated WebUI to display role information under tab 'Agents'.

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


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

Branch: refs/heads/master
Commit: abfabb9e7b4ab9d043a2162ceec5826997a78d68
Parents: cc15db4
Author: Jay Guo <gu...@gmail.com>
Authored: Thu Mar 2 12:25:26 2017 -0800
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Thu Mar 2 13:49:41 2017 -0800

----------------------------------------------------------------------
 src/webui/master/static/agent.html           | 12 ++++++++
 src/webui/master/static/agent_executor.html  |  8 +++++
 src/webui/master/static/agent_framework.html | 10 ++++++
 src/webui/master/static/js/controllers.js    | 37 +++++++++++++++++++++++
 4 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/abfabb9e/src/webui/master/static/agent.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/agent.html b/src/webui/master/static/agent.html
index 416e6c2..03ba7a8 100644
--- a/src/webui/master/static/agent.html
+++ b/src/webui/master/static/agent.html
@@ -129,6 +129,7 @@
           <th data-key="id">ID</th>
           <th data-key="user">User</th>
           <th data-key="name">Name</th>
+          <th data-key="roles">Roles</th>
           <th data-key="num_tasks">Active Tasks</th>
           <th data-key="cpus">CPUs (Used / Allocated)</th>
           <th data-key="gpus">GPUs (Used / Allocated)</th>
@@ -151,6 +152,11 @@
           </td>
           <td>{{framework.user}}</td>
           <td>{{framework.name}}</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.num_tasks | number}}</td>
           <td>{{monitor.frameworks[framework.id].statistics.cpus_total_usage | number}} / {{framework.cpus | number}}</td>
           <!-- TODO(haosdent): We need to show statistics for gpu once it is provided in monitor endpoint. -->
@@ -168,6 +174,7 @@
           <th data-key="id">ID</th>
           <th data-key="user">User</th>
           <th data-key="name">Name</th>
+          <th data-key="roles">Roles</th>
           <th data-key="tasks.length">Active Tasks</th>
           <th data-key="resources.cpus">CPUs</th>
           <th data-key="resources.gpus">GPUs</th>
@@ -190,6 +197,11 @@
           </td>
           <td>{{completed_framework.user}}</td>
           <td>{{completed_framework.name}}</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>{{completed_framework.roles.toString()}}</td>
           <td>{{completed_framework.num_tasks | number}}</td>
           <td>{{completed_framework.cpus | number}}</td>
           <td>{{completed_framework.gpus | number}}</td>

http://git-wip-us.apache.org/repos/asf/mesos/blob/abfabb9e/src/webui/master/static/agent_executor.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/agent_executor.html b/src/webui/master/static/agent_executor.html
index 95e921d..d9427c1 100644
--- a/src/webui/master/static/agent_executor.html
+++ b/src/webui/master/static/agent_executor.html
@@ -29,6 +29,8 @@
         <dd>{{executor.name}}</dd>
         <dt>Executor Source:</dt>
         <dd>{{executor.source}}</dd>
+        <dt>Executor Role:</dt>
+        <dd>{{executor.role}}</dd>
       </dl>
 
       <dl class="inline clearfix">
@@ -106,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="resources.cpus">CPUs</th>
           <th data-key="resources.gpus">GPUs</th>
           <th data-key="resources.mem">Mem</th>
@@ -116,6 +119,7 @@
         <tr ng-repeat="queued_task in $data">
           <td>{{queued_task.id}}</td>
           <td>{{queued_task.name}}</td>
+          <td>{{queued_task.role}}</td>
           <td>{{queued_task.resources.cpus | number}}</td>
           <td>{{queued_task.resources.gpus | number}}</td>
           <td>{{queued_task.resources.mem * (1024 * 1024) | dataSize}}</td>
@@ -130,6 +134,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="resources.cpus">CPUs (allocated)</th>
           <th data-key="resources.gpus">GPUs (allocated)</th>
@@ -142,6 +147,7 @@
         <tr ng-repeat="task in $data">
           <td>{{task.id}}</td>
           <td>{{task.name}}</td>
+          <td>{{task.role}}</td>
           <td>{{task.state}}</td>
           <td>{{task.resources.cpus | number}}</td>
           <td>{{task.resources.gpus | number}}</td>
@@ -163,6 +169,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="resources.cpus">CPUs (allocated)</th>
           <th data-key="resources.gpus">GPUs (allocated)</th>
@@ -175,6 +182,7 @@
         <tr ng-repeat="completed_task in $data">
           <td>{{completed_task.id}}</td>
           <td>{{completed_task.name}}</td>
+          <td>{{completed_task.role}}</td>
           <td>{{completed_task.state}}</td>
           <td>{{completed_task.resources.cpus | number}}</td>
           <td>{{completed_task.resources.gpus | number}}</td>

http://git-wip-us.apache.org/repos/asf/mesos/blob/abfabb9e/src/webui/master/static/agent_framework.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/agent_framework.html b/src/webui/master/static/agent_framework.html
index 806ab06..e2a4033 100644
--- a/src/webui/master/static/agent_framework.html
+++ b/src/webui/master/static/agent_framework.html
@@ -23,6 +23,12 @@
       <dl class="inline clearfix">
         <dt>Name:</dt><dd>{{framework.name}}</dd>
         <dt>Master:</dt><dd>{{state.master_hostname}}</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>
       </dl>
 
       <dl class="inline clearfix">
@@ -83,6 +89,7 @@
           <th data-key="id">ID</th>
           <th data-key="name">Name</th>
           <th data-key="source">Source</th>
+          <th data-key="role">Role</th>
           <th data-key="tasks.length">Active Tasks</th>
           <th data-key="queued_tasks.length">Queued Tasks</th>
           <th data-key="resources.cpus">CPUs (Used / Allocated)</th>
@@ -101,6 +108,7 @@
           </td>
           <td>{{executor.name}}</td>
           <td>{{executor.source}}</td>
+          <td>{{executor.role}}</td>
           <td>{{executor.tasks.length | number}}</td>
           <td>{{executor.queued_tasks.length | number}}</td>
           <td>{{monitor.frameworks[framework.id].executors[executor.id].statistics.cpus_total_usage | number}} /
@@ -128,6 +136,7 @@
           <th data-key="id">ID</th>
           <th data-key="name">Name</th>
           <th data-key="source">Source</th>
+          <th data-key="role">Role</th>
           <th data-key="sandbox">Sandbox</th>
         </tr>
       </thead>
@@ -140,6 +149,7 @@
           </td>
           <td>{{completed_executor.name}}</td>
           <td>{{completed_executor.source}}</td>
+          <td>{{completed_executor.role}}</td>
           <td>
             <a href="{{'#/agents/' + agent_id + '/browse?path=' +
                        encodeURIComponent(completed_executor.directory)}}">

http://git-wip-us.apache.org/repos/asf/mesos/blob/abfabb9e/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 2ea8275..3620047 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -578,11 +578,21 @@
           _.each($scope.state.frameworks, function(framework) {
             $scope.agent.frameworks[framework.id] = framework;
             computeFrameworkStats(framework);
+
+            // Fill in the `roles` field for non-MULTI_ROLE schedulers.
+            if (framework.role) {
+              framework.roles = [framework.role];
+            }
           });
 
           _.each($scope.state.completed_frameworks, function(framework) {
             $scope.agent.completed_frameworks[framework.id] = framework;
             computeFrameworkStats(framework);
+
+            // Fill in the `roles` field for non-MULTI_ROLE schedulers.
+            if (framework.role) {
+              framework.roles = [framework.role];
+            }
           });
 
           $('#agent').show();
@@ -662,6 +672,11 @@
             return;
           }
 
+          // Fill in the `roles` field for non-MULTI_ROLE schedulers.
+          if ($scope.framework.role) {
+            $scope.framework.roles = [$scope.framework.role];
+          }
+
           // Compute the framework stats.
           $scope.framework.num_tasks = 0;
           $scope.framework.cpus = 0;
@@ -675,6 +690,11 @@
             $scope.framework.gpus += executor.resources.gpus;
             $scope.framework.mem += executor.resources.mem;
             $scope.framework.disk += executor.resources.disk;
+
+            // If 'role' is not present in executor, we are talking
+            // to a non-MULTI_ROLE capable agent. This means that we
+            // can use the 'role' of the framework.
+            executor.role = executor.role || $scope.framework.role;
           });
 
           $('#agent').show();
@@ -754,6 +774,23 @@
             return;
           }
 
+          // If 'role' is not present in the task, we are talking
+          // to a non-MULTI_ROLE capable agent. This means that we
+          // can use the 'role' of the framework.
+          if (!("role" in $scope.executor)) {
+            $scope.executor.role = $scope.framework.role;
+
+            function setRole(tasks) {
+              _.each(tasks, function(task) {
+                task.role = $scope.framework.role;
+              });
+            }
+
+            setRole($scope.executor.tasks);
+            setRole($scope.executor.queued_tasks);
+            setRole($scope.executor.completed_tasks);
+          }
+
           setTaskSandbox($scope.executor);
 
           $('#agent').show();


[2/2] mesos git commit: Updated WebUI to display role information under tab 'Frameworks'.

Posted by bm...@apache.org.
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 <gu...@gmail.com>
Authored: Thu Mar 2 12:25:42 2017 -0800
Committer: Benjamin Mahler <bm...@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);
     });