You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@livy.apache.org by js...@apache.org on 2017/07/18 04:21:40 UTC

[13/13] incubator-livy git commit: LIVY-343. Web UI: Create Session Page

LIVY-343. Web UI: Create Session Page

[LIVY-343](https://issues.cloudera.org/browse/LIVY-343)

Created a Session Summery Page for Interactive Sessions. Batch Sessions do not have Session Summery Pages because all relevant info is displayed on the All Sessions page Batches table.

The Session Summery Page displays session info (same as in All Sessions table) at the top of the page similar to the Job or Stage Pages in Spark. Below the session info section is a statements table. The statements table contains statement information including statement output. The statement output columns account for empty, error, and data output.

Other new features and updates include:
 - Added a link to the Session Page in the Interactive Sessions table on the All Sessions Page
 - Reorganized static files into a standard directory structure
 - Added bootstrap fonts to fix jQuery DataTables Column headers
 - Added link to the Yarn driver logs to All Sessions tables
 - Updated CSS to use full page width like Spark (was causing issues with statements table)
 - Added a 404 page to the UI

Point of Discussion:
 - Should I change the column order in the Statements table? I played around with it for a while before setting on the current ordering.

Tested manually and passed Livy tests locally.

Screenshots:
![1-empty](https://user-images.githubusercontent.com/13952758/28145846-583eb6ce-672a-11e7-9f03-06f194516e7c.png)
![2-applist](https://user-images.githubusercontent.com/13952758/28145848-5857cb5a-672a-11e7-99a2-098f2c8baf7b.png)
![3-session0](https://user-images.githubusercontent.com/13952758/28145849-585841de-672a-11e7-9236-9d7d814c93c5.png)
![4-session1](https://user-images.githubusercontent.com/13952758/28145851-5859158c-672a-11e7-923b-f59412e7be35.png)
![5-session2](https://user-images.githubusercontent.com/13952758/28145852-585ca418-672a-11e7-9827-2ccafe02689f.png)
![6-session3](https://user-images.githubusercontent.com/13952758/28145850-5858b0b0-672a-11e7-90ee-eef17610080d.png)
![7-session4inprog](https://user-images.githubusercontent.com/13952758/28145847-584ef2e6-672a-11e7-95c8-ae1d86548cea.png)
![8-session4](https://user-images.githubusercontent.com/13952758/28145853-5864b52c-672a-11e7-887f-75a2b7081b39.png)
![9-session5](https://user-images.githubusercontent.com/13952758/28145854-586f1ae4-672a-11e7-9098-20c1df8b4c3d.png)

Author: Alex Bozarth <aj...@us.ibm.com>

Closes #16 from ajbozarth/session-ui.


Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/27625a0b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/27625a0b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/27625a0b

Branch: refs/heads/master
Commit: 27625a0b2174c5d5d5c8c3ee7b274c94c825388a
Parents: 9d82f1f
Author: Alex Bozarth <aj...@us.ibm.com>
Authored: Mon Jul 17 21:21:22 2017 -0700
Committer: jerryshao <ss...@hortonworks.com>
Committed: Mon Jul 17 21:21:22 2017 -0700

----------------------------------------------------------------------
 .rat-excludes                                   |   1 +
 .../livy/server/ui/static/all-sessions.js       |  93 ------
 .../livy/server/ui/static/batches-table.html    |  42 ---
 .../livy/server/ui/static/bootstrap.min.css     |  14 -
 .../livy/server/ui/static/bootstrap.min.js      |   7 -
 .../livy/server/ui/static/css/bootstrap.min.css |   6 +
 .../ui/static/css/dataTables.bootstrap.min.css  |   1 +
 .../livy/server/ui/static/css/livy-ui.css       |  37 +++
 .../ui/static/dataTables.bootstrap.min.css      |   1 -
 .../ui/static/dataTables.bootstrap.min.js       |   8 -
 .../fonts/glyphicons-halflings-regular.eot      | Bin 0 -> 20127 bytes
 .../fonts/glyphicons-halflings-regular.svg      | 288 +++++++++++++++++++
 .../fonts/glyphicons-halflings-regular.ttf      | Bin 0 -> 45404 bytes
 .../fonts/glyphicons-halflings-regular.woff     | Bin 0 -> 23424 bytes
 .../fonts/glyphicons-halflings-regular.woff2    | Bin 0 -> 18028 bytes
 .../server/ui/static/html/batches-table.html    |  52 ++++
 .../server/ui/static/html/sessions-table.html   |  69 +++++
 .../server/ui/static/html/statements-table.html |  63 ++++
 .../server/ui/static/img/livy-mini-logo.png     | Bin 0 -> 1121 bytes
 .../livy/server/ui/static/jquery-3.2.1.min.js   |   4 -
 .../server/ui/static/jquery.dataTables.min.js   | 167 -----------
 .../livy/server/ui/static/js/all-sessions.js    |  78 +++++
 .../livy/server/ui/static/js/bootstrap.min.js   |   7 +
 .../ui/static/js/dataTables.bootstrap.min.js    |   8 +
 .../server/ui/static/js/jquery-3.2.1.min.js     |   4 +
 .../ui/static/js/jquery.dataTables.min.js       | 167 +++++++++++
 .../apache/livy/server/ui/static/js/livy-ui.js  |  88 ++++++
 .../apache/livy/server/ui/static/js/session.js  | 101 +++++++
 .../livy/server/ui/static/livy-mini-logo.png    | Bin 1121 -> 0 bytes
 .../apache/livy/server/ui/static/livy-ui.css    |  20 --
 .../livy/server/ui/static/sessions-table.html   |  59 ----
 .../org/apache/livy/server/LivyServer.scala     |   2 +-
 .../org/apache/livy/server/ui/UIServlet.scala   |  73 +++--
 33 files changed, 1025 insertions(+), 435 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/27625a0b/.rat-excludes
----------------------------------------------------------------------
diff --git a/.rat-excludes b/.rat-excludes
index fe6e7ec..033ecec 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -17,6 +17,7 @@ conf/*
 **/dataTables.bootstrap.min.js
 **/jquery.dataTables.min.js
 **/jquery-3.2.1.min.js
+**/fonts/**
 **/livy_python_api.egg-info/*
 **/*.txt
 **/MANIFEST.in

http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/27625a0b/server/src/main/resources/org/apache/livy/server/ui/static/all-sessions.js
----------------------------------------------------------------------
diff --git a/server/src/main/resources/org/apache/livy/server/ui/static/all-sessions.js b/server/src/main/resources/org/apache/livy/server/ui/static/all-sessions.js
deleted file mode 100644
index 4fe3f8f..0000000
--- a/server/src/main/resources/org/apache/livy/server/ui/static/all-sessions.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-function appIdLink(session) {
-  var appUiUrl = session.appInfo.sparkUiUrl;
-  if (appUiUrl != null) {
-    return '<a href="' + appUiUrl + '">' + session.appId + "</a>";
-  } else {
-    return session.appId;
-  }
-}
-
-function tdWrap(str) {
-  return "<td>" + str + "</td>";
-}
-
-function loadSessionsTable(sessions) {
-  $.each(sessions, function(index, session) {
-    $("#interactive-sessions .sessions-table-body").append(
-      "<tr>" +
-        tdWrap(session.id) +
-        tdWrap(appIdLink(session)) +
-        tdWrap(session.owner) +
-        tdWrap(session.proxyUser) +
-        tdWrap(session.kind) +
-        tdWrap(session.state) +
-       "</tr>"
-    );
-  });
-}
-
-function loadBatchesTable(sessions) {
-  $.each(sessions, function(index, session) {
-    $("#batches .sessions-table-body").append(
-      "<tr>" +
-        tdWrap(session.id) +
-        tdWrap(appIdLink(session)) +
-        tdWrap(session.state) +
-       "</tr>"
-    );
-  });
-}
-
-var numSessions = 0;
-var numBatches = 0;
-
-$(document).ready(function () {
-  $.extend( $.fn.dataTable.defaults, {
-    stateSave: true,
-  });
-
-  var sessionsReq = $.getJSON(location.origin + "/sessions", function(response) {
-    if (response && response.total > 0) {
-      $("#interactive-sessions").load("/static/sessions-table.html .sessions-template", function() {
-        loadSessionsTable(response.sessions);
-        $("#interactive-sessions-table").DataTable();
-        $('#interactive-sessions [data-toggle="tooltip"]').tooltip();
-      });
-    }
-    numSessions = response.total;
-  });
-
-  var batchesReq = $.getJSON(location.origin + "/batches", function(response) {
-    if (response && response.total > 0) {
-      $("#batches").load("/static/batches-table.html .sessions-template", function() {
-        loadBatchesTable(response.sessions);
-        $("#batches-table").DataTable();
-        $('#batches [data-toggle="tooltip"]').tooltip();
-      });
-    }
-    numBatches = response.total;
-  });
-
-  $.when(sessionsReq, batchesReq).done(function () {
-    if (numSessions + numBatches == 0) {
-      $("#all-sessions").append('<h4>No Sessions or Batches have been created yet.</h4>');
-    }
-  });
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/27625a0b/server/src/main/resources/org/apache/livy/server/ui/static/batches-table.html
----------------------------------------------------------------------
diff --git a/server/src/main/resources/org/apache/livy/server/ui/static/batches-table.html b/server/src/main/resources/org/apache/livy/server/ui/static/batches-table.html
deleted file mode 100644
index e0b3213..0000000
--- a/server/src/main/resources/org/apache/livy/server/ui/static/batches-table.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<h4 id="batches-header" class="sessions-template">Batch Sessions</h4>
-
-<table id="batches-table" class="table table-striped sessions-table sessions-template">
-  <thead class="sessions-table-head">
-  <tr>
-    <th>Batch Id</th>
-    <th>
-      <span data-toggle="tooltip"
-            title="Spark Application Id for this session.
-            If available, links to Spark Application Web UI">
-        Application Id
-      </span>
-    </th>
-    <th>
-      <span data-toggle="tooltip"
-            title="Session State (not_started, starting, idle, busy,
-            shutting_down, error, dead, success)">
-        State
-      </span>
-    </th>
-  </tr>
-  </thead>
-  <tbody class="sessions-table-body">
-  </tbody>
-</table>
\ No newline at end of file