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 2016/04/08 23:20:04 UTC
[5/5] mesos git commit: Updated the webui to include GPU information.
Updated the webui to include GPU information.
Review: https://reviews.apache.org/r/45942/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/21937f97
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/21937f97
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/21937f97
Branch: refs/heads/master
Commit: 21937f9743c996892a12102dfa643e901a4189b0
Parents: a741bed
Author: Kevin Klues <kl...@gmail.com>
Authored: Fri Apr 8 14:19:17 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Fri Apr 8 14:19:17 2016 -0700
----------------------------------------------------------------------
src/webui/master/static/framework.html | 2 ++
src/webui/master/static/frameworks.html | 2 ++
src/webui/master/static/home.html | 9 +++++++--
src/webui/master/static/js/controllers.js | 23 ++++++++++++++++++++++-
src/webui/master/static/offers.html | 2 ++
src/webui/master/static/slave.html | 8 ++++++++
src/webui/master/static/slave_executor.html | 13 +++++++++++++
src/webui/master/static/slave_framework.html | 8 ++++++++
src/webui/master/static/slaves.html | 2 ++
9 files changed, 66 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/framework.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/framework.html b/src/webui/master/static/framework.html
index ee42d1a..041513b 100644
--- a/src/webui/master/static/framework.html
+++ b/src/webui/master/static/framework.html
@@ -36,6 +36,8 @@
<dd>{{framework.tasks.length | number}}</dd>
<dt>CPUs:</dt>
<dd>{{framework.resources.cpus | number}}</dd>
+ <dt>GPUs:</dt>
+ <dd>{{framework.resources.gpus | number}}</dd>
<dt>Mem:</dt>
<dd>{{framework.resources.mem * (1024 * 1024) | dataSize}}</dd>
<dt>Disk:</dt>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/frameworks.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/frameworks.html b/src/webui/master/static/frameworks.html
index 15ff1e9..f172e02 100644
--- a/src/webui/master/static/frameworks.html
+++ b/src/webui/master/static/frameworks.html
@@ -15,6 +15,7 @@
<th data-key="name">Name</th>
<th data-key="tasks.length">Active Tasks</th>
<th data-key="resources.cpus">CPUs</th>
+ <th data-key="resources.gpus">GPUs</th>
<th data-key="resources.mem">Mem</th>
<th data-key="resources.disk">Disk</th>
<th data-key="max_share">Max Share</th>
@@ -43,6 +44,7 @@
<td>{{framework.name}}</td>
<td>{{framework.tasks.length}}</td>
<td>{{framework.resources.cpus | number}}</td>
+ <td>{{framework.resources.gpus | number}}</td>
<td>{{framework.resources.mem * (1024 * 1024) | dataSize}}</td>
<td>{{framework.resources.disk * (1024 * 1024) | dataSize}}</td>
<td>{{framework.max_share * 100 | number}}%</td>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/home.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/home.html b/src/webui/master/static/home.html
index a691084..4b201d7 100644
--- a/src/webui/master/static/home.html
+++ b/src/webui/master/static/home.html
@@ -6,7 +6,7 @@
</ol>
<div class="row">
- <div class="col-sm-4 col-md-3 col-lg-2">
+ <div class="col-sm-5 col-md-4 col-lg-3">
<div class="well">
<dl class="inline inline-toggle clearfix">
<dt>Cluster:</dt>
@@ -100,6 +100,7 @@
<tr>
<td></td>
<td class="text-right">CPUs</td>
+ <td class="text-right">GPUs</td>
<td class="text-right">Mem</td>
<td class="text-right">Disk</td>
</tr>
@@ -108,24 +109,28 @@
<tr>
<td>Total</td>
<td class="text-right">{{total_cpus | decimalFloat}}</td>
+ <td class="text-right">{{total_gpus | decimalFloat}}</td>
<td class="text-right">{{total_mem * (1024 * 1024) | dataSize}}</td>
<td class="text-right">{{total_disk * (1024 * 1024) | dataSize}}</td>
</tr>
<tr>
<td>Used</td>
<td class="text-right">{{used_cpus | decimalFloat}}</td>
+ <td class="text-right">{{used_gpus | decimalFloat}}</td>
<td class="text-right">{{used_mem * (1024 * 1024) | dataSize}}</td>
<td class="text-right">{{used_disk * (1024 * 1024) | dataSize}}</td>
</tr>
<tr>
<td>Offered</td>
<td class="text-right">{{offered_cpus | decimalFloat}}</td>
+ <td class="text-right">{{offered_gpus | decimalFloat}}</td>
<td class="text-right">{{offered_mem * (1024 * 1024) | dataSize}}</td>
<td class="text-right">{{offered_disk * (1024 * 1024) | dataSize}}</td>
</tr>
<tr>
<td>Idle</td>
<td class="text-right">{{idle_cpus | decimalFloat}}</td>
+ <td class="text-right">{{idle_gpus | decimalFloat}}</td>
<td class="text-right">{{idle_mem * (1024 * 1024) | dataSize}}</td>
<td class="text-right">{{idle_disk * (1024 * 1024) | dataSize}}</td>
</tr>
@@ -134,7 +139,7 @@
</div>
</div>
- <div class="col-sm-8 col-md-9 col-lg-10">
+ <div class="col-sm-7 col-md-8 col-lg-9">
<table m-table table-content="active_tasks" title="Active Tasks"
class="table table-striped table-bordered table-condensed">
<thead>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/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 f92affa..8d9021c 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -117,12 +117,15 @@
// Update the stats.
$scope.cluster = $scope.state.cluster;
$scope.total_cpus = 0;
+ $scope.total_gpus = 0;
$scope.total_mem = 0;
$scope.total_disk = 0;
$scope.used_cpus = 0;
+ $scope.used_gpus = 0;
$scope.used_mem = 0;
$scope.used_disk = 0;
$scope.offered_cpus = 0;
+ $scope.offered_gpus = 0;
$scope.offered_mem = 0;
$scope.offered_disk = 0;
@@ -132,6 +135,7 @@
_.each($scope.state.slaves, function(slave) {
$scope.slaves[slave.id] = slave;
$scope.total_cpus += slave.resources.cpus;
+ $scope.total_gpus += slave.resources.gpus;
$scope.total_mem += slave.resources.mem;
$scope.total_disk += slave.resources.disk;
});
@@ -153,6 +157,7 @@
_.each(framework.offers, function(offer) {
$scope.offers[offer.id] = offer;
$scope.offered_cpus += offer.resources.cpus;
+ $scope.offered_gpus += offer.resources.gpus;
$scope.offered_mem += offer.resources.mem;
$scope.offered_disk += offer.resources.disk;
offer.framework_name = $scope.frameworks[offer.framework_id].name;
@@ -160,6 +165,7 @@
});
$scope.used_cpus += framework.resources.cpus;
+ $scope.used_gpus += framework.resources.gpus;
$scope.used_mem += framework.resources.mem;
$scope.used_disk += framework.resources.disk;
@@ -168,6 +174,11 @@
framework.cpus_share = framework.resources.cpus / $scope.total_cpus;
}
+ framework.gpus_share = 0;
+ if ($scope.total_gpus > 0) {
+ framework.gpus_share = framework.resources.gpus / $scope.total_gpus;
+ }
+
framework.mem_share = 0;
if ($scope.total_mem > 0) {
framework.mem_share = framework.resources.mem / $scope.total_mem;
@@ -178,7 +189,11 @@
framework.disk_share = framework.resources.disk / $scope.total_disk;
}
- framework.max_share = Math.max(framework.cpus_share, framework.mem_share, framework.disk_share);
+ framework.max_share = Math.max(
+ framework.cpus_share,
+ framework.gpus_share,
+ framework.mem_share,
+ framework.disk_share);
// If the executor ID is empty, this is a command executor with an
// internal executor ID generated from the task ID.
@@ -199,10 +214,12 @@
});
$scope.used_cpus -= $scope.offered_cpus;
+ $scope.used_gpus -= $scope.offered_gpus;
$scope.used_mem -= $scope.offered_mem;
$scope.used_disk -= $scope.offered_disk;
$scope.idle_cpus = $scope.total_cpus - ($scope.offered_cpus + $scope.used_cpus);
+ $scope.idle_gpus = $scope.total_gpus - ($scope.offered_gpus + $scope.used_gpus);
$scope.idle_mem = $scope.total_mem - ($scope.offered_mem + $scope.used_mem);
$scope.idle_disk = $scope.total_disk - ($scope.offered_disk + $scope.used_disk);
@@ -491,12 +508,14 @@
function computeFrameworkStats(framework) {
framework.num_tasks = 0;
framework.cpus = 0;
+ framework.gpus = 0;
framework.mem = 0;
framework.disk = 0;
_.each(framework.executors, function(executor) {
framework.num_tasks += _.size(executor.tasks);
framework.cpus += executor.resources.cpus;
+ framework.gpus += executor.resources.gpus;
framework.mem += executor.resources.mem;
framework.disk += executor.resources.disk;
});
@@ -598,12 +617,14 @@
// Compute the framework stats.
$scope.framework.num_tasks = 0;
$scope.framework.cpus = 0;
+ $scope.framework.gpus = 0;
$scope.framework.mem = 0;
$scope.framework.disk = 0;
_.each($scope.framework.executors, function(executor) {
$scope.framework.num_tasks += _.size(executor.tasks);
$scope.framework.cpus += executor.resources.cpus;
+ $scope.framework.gpus += executor.resources.gpus;
$scope.framework.mem += executor.resources.mem;
$scope.framework.disk += executor.resources.disk;
});
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/offers.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/offers.html b/src/webui/master/static/offers.html
index 01213e9..ec32a64 100644
--- a/src/webui/master/static/offers.html
+++ b/src/webui/master/static/offers.html
@@ -15,6 +15,7 @@
<th data-key="framework_name">Framework</th>
<th data-key="hostname">Host</th>
<th data-key="resources.cpus">CPUs</th>
+ <th data-key="resources.gpus">GPUs</th>
<th data-key="resources.mem">Mem</th>
<th data-key="resources.disk">Disk</th>
</tr>
@@ -35,6 +36,7 @@
</a>
</td>
<td>{{offer.resources.cpus | number}}</td>
+ <td>{{offer.resources.gpus | number}}</td>
<td>{{offer.resources.mem * (1024 * 1024) | dataSize}}</td>
<td>{{offer.resources.disk * (1024 * 1024) | dataSize}}</td>
</tr>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/slave.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/slave.html b/src/webui/master/static/slave.html
index 4419f7c..c908511 100644
--- a/src/webui/master/static/slave.html
+++ b/src/webui/master/static/slave.html
@@ -98,6 +98,11 @@
<td class="text-right">{{state.resources.cpus | number}}</td>
</tr>
<tr>
+ <td>GPUs</td>
+ <td class="text-right">N/A</td>
+ <td class="text-right">{{state.resources.gpus | number}}</td>
+ </tr>
+ <tr>
<td>Memory</td>
<td class="text-right">{{monitor.statistics.mem_rss_bytes | dataSize}}</td>
<td class="text-right">
@@ -126,6 +131,7 @@
<th data-key="name">Name</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>
<th data-key="Mem">Mem (Used / Allocated)</th>
<th data-key="Disk">Disk (Used / Allocated)</th>
</tr>
@@ -162,6 +168,7 @@
<th data-key="name">Name</th>
<th data-key="tasks.length">Active Tasks</th>
<th data-key="resources.cpus">CPUs</th>
+ <th data-key="resources.gpus">GPUs</th>
<th data-key="resources.mem">Mem</th>
<th data-key="resources.disk">Disk</th>
</tr>
@@ -183,6 +190,7 @@
<td>{{completed_framework.name}}</td>
<td>{{completed_framework.num_tasks | number}}</td>
<td>{{completed_framework.cpus | number}}</td>
+ <td>{{completed_framework.gpus | number}}</td>
<td>{{completed_framework.mem * (1024 * 1024) | dataSize}}</td>
<td>{{completed_framework.disk * (1024 * 1024) | dataSize}}</td>
</tr>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/slave_executor.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/slave_executor.html b/src/webui/master/static/slave_executor.html
index 5acb676..99b23ed 100644
--- a/src/webui/master/static/slave_executor.html
+++ b/src/webui/master/static/slave_executor.html
@@ -69,6 +69,13 @@
<td class="text-right">{{executor.resources.cpus | number}}</td>
</tr>
<tr>
+ <td>GPUs</td>
+ <td class="text-right">
+ N/A
+ </td>
+ <td class="text-right">{{executor.resources.gpus | number}}</td>
+ </tr>
+ <tr>
<td>Mem</td>
<td class="text-right">
{{monitor.frameworks[framework.id].executors[executor.id].statistics.mem_rss_bytes | dataSize}}
@@ -98,6 +105,7 @@
<th data-key="id">ID</th>
<th data-key="name">Name</th>
<th data-key="resources.cpus">CPUs</th>
+ <th data-key="resources.gpus">GPUs</th>
<th data-key="resources.mem">Mem</th>
<th data-key="resources.disk">Disk</th>
</tr>
@@ -107,6 +115,7 @@
<td>{{queued_task.id}}</td>
<td>{{queued_task.name}}</td>
<td>{{queued_task.resources.cpus | number}}</td>
+ <td>{{queued_task.resources.gpus | number}}</td>
<td>{{queued_task.resources.mem * (1024 * 1024) | dataSize}}</td>
<td>{{queued_task.resources.disk * (1024 * 1024) | dataSize}}</td>
</tr>
@@ -121,6 +130,7 @@
<th data-key="name">Name</th>
<th data-key="state">State</th>
<th data-key="resources.cpus">CPUs (allocated)</th>
+ <th data-key="resources.gpus">GPUs (allocated)</th>
<th data-key="resources.mem">Mem (allocated)</th>
<th data-key="resources.disk">Disk (allocated)</th>
<th></th>
@@ -132,6 +142,7 @@
<td>{{task.name}}</td>
<td>{{task.state}}</td>
<td>{{task.resources.cpus | number}}</td>
+ <td>{{task.resources.gpus | number}}</td>
<td>{{task.resources.mem * (1024 * 1024) | dataSize}}</td>
<td>{{task.resources.disk * (1024 * 1024) | dataSize}}</td>
<td>
@@ -152,6 +163,7 @@
<th data-key="name">Name</th>
<th data-key="state">State</th>
<th data-key="resources.cpus">CPUs (allocated)</th>
+ <th data-key="resources.gpus">GPUs (allocated)</th>
<th data-key="resources.mem">Mem (allocated)</th>
<th data-key="resources.disk">Disk (allocated)</th>
<th></th>
@@ -163,6 +175,7 @@
<td>{{completed_task.name}}</td>
<td>{{completed_task.state}}</td>
<td>{{completed_task.resources.cpus | number}}</td>
+ <td>{{completed_task.resources.gpus | number}}</td>
<td>{{completed_task.resources.mem * (1024 * 1024) | dataSize}}</td>
<td>{{completed_task.resources.disk * (1024 * 1024) | dataSize}}</td>
<td>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/slave_framework.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/slave_framework.html b/src/webui/master/static/slave_framework.html
index 4b2b156..176e7e9 100644
--- a/src/webui/master/static/slave_framework.html
+++ b/src/webui/master/static/slave_framework.html
@@ -48,6 +48,13 @@
<td class="text-right">{{framework.cpus | number}}</td>
</tr>
<tr>
+ <td>GPUs</td>
+ <td class="text-right">
+ N/A
+ </td>
+ <td class="text-right">{{framework.gpus | number}}</td>
+ </tr>
+ <tr>
<td>Memory</td>
<td class="text-right">
{{monitor.frameworks[framework.id].statistics.mem_rss_bytes | dataSize}}
@@ -79,6 +86,7 @@
<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>
+ <th data-key="resources.gpus">GPUs (Used / Allocated)</th>
<th data-key="resources.mem">Mem (Used / Allocated)</th>
<th data-key="resources.disk">Disk (Used / Allocated)</th>
<th></th>
http://git-wip-us.apache.org/repos/asf/mesos/blob/21937f97/src/webui/master/static/slaves.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/slaves.html b/src/webui/master/static/slaves.html
index 0cb125a..0630317 100644
--- a/src/webui/master/static/slaves.html
+++ b/src/webui/master/static/slaves.html
@@ -14,6 +14,7 @@
<th data-key="id">ID</th>
<th data-key="hostname">Host</th>
<th data-key="resources.cpus">CPUs</th>
+ <th data-key="resources.gpus">GPUs</th>
<th data-key="resources.mem">Mem</th>
<th data-key="resources.disk">Disk</th>
<th data-key="registered_time">Registered</th>
@@ -34,6 +35,7 @@
</td>
<td>{{slave.hostname}}</td>
<td>{{slave.resources.cpus | number}}</td>
+ <td>{{slave.resources.gpus | number}}</td>
<td>{{slave.resources.mem * (1024 * 1024) | dataSize}}</td>
<td>{{slave.resources.disk * (1024 * 1024) | dataSize}}</td>
<td>