TEZ-2129. Task and Attempt views should contain links to the logs (jeagles)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/85637c61 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/85637c61 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/85637c61 Branch: refs/heads/TEZ-2980 Commit: 85637c61a2cf2c16c147826b2908d459a7b1b7cf Parents: d5c9649 Author: Jonathan Eagles <[email protected]> Authored: Fri Jan 8 14:37:03 2016 -0600 Committer: Jonathan Eagles <[email protected]> Committed: Fri Jan 8 14:37:03 2016 -0600 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../controllers/task_attempt_controller.js | 6 ++++- .../app/scripts/controllers/task_controller.js | 5 +++- .../controllers/task_index_controller.js | 27 +++++++++++++++++++- .../task_task_attempts_controller.js | 13 ++++++++++ .../main/webapp/app/templates/task/index.hbs | 17 ++++++++++++ .../webapp/app/templates/taskAttempt/index.hbs | 17 ++++++++++++ 7 files changed, 84 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 5e944b6..ea2b1d5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -11,6 +11,7 @@ INCOMPATIBLE CHANGES TEZ-2972. Avoid task rescheduling when a node turns unhealthy ALL CHANGES: + TEZ-2129. Task and Attempt views should contain links to the logs TEZ-3025. InputInitializer creation should use the dag ugi. TEZ-3017. HistoryACLManager does not have a close method for cleanup TEZ-2914. Ability to limit vertex concurrency @@ -302,6 +303,7 @@ INCOMPATIBLE CHANGES TEZ-2949. Allow duplicate dag names within session for Tez. ALL CHANGES + TEZ-2129. Task and Attempt views should contain links to the logs TEZ-3025. InputInitializer creation should use the dag ugi. TEZ-3017. HistoryACLManager does not have a close method for cleanup TEZ-2914. Ability to limit vertex concurrency http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js index 3485c33..de24ccd 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js @@ -69,20 +69,24 @@ App.TaskAttemptController = App.BaseController.extend(App.Helpers.DisplayHelper, loadAdditional: function(attempt) { var that = this; + var applicationId = App.Helpers.misc.getAppIdFromVertexId(attempt.get('vertexID')); var dagLoader = this.store.find('dag', attempt.get('dagID')); var vertexLoader = this.store.find('vertex', attempt.get('vertexID')); var taskLoader = this.store.find('task', attempt.get('taskID')); + var appDetailLoader = App.Helpers.misc.loadApp(this.store, applicationId); var allLoaders = Em.RSVP.hash({ dag: dagLoader, vertex: vertexLoader, - task: taskLoader + task: taskLoader, + appDetail: appDetailLoader }); allLoaders.then(function(results) { attempt.set('task', results.task); attempt.set('task.vertex', results.vertex); attempt.set('task.vertex.dag', results.dag); + attempt.set('appDetail', results.appDetail); }).finally(function() { that.set('loading', false); }); http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js index b7a6036..829881f 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js @@ -64,18 +64,21 @@ App.TaskController = App.PollingController.extend(App.Helpers.DisplayHelper, App var dagLoader = this.store.find('dag', task.get('dagID')); var vertexLoader = this.store.find('vertex', task.get('vertexID')); var tezAppLoader = this.store.find('tezApp', 'tez_' + applicationId); + var appDetailLoader = App.Helpers.misc.loadApp(this.store, applicationId); task.set('progress', undefined); var allLoaders = Em.RSVP.hash({ dag: dagLoader, vertex: vertexLoader, - tezApp: tezAppLoader + tezApp: tezAppLoader, + appDetail: appDetailLoader }); allLoaders.then(function(results) { task.set('vertex', results.vertex); task.set('vertex.dag', results.dag); task.set('tezApp', results.tezApp); + task.set('appDetail', results.appDetail); }).finally(function() { that.set('loading', false); }); http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js index eca4ee1..96258f1 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js @@ -20,6 +20,8 @@ App.TaskIndexController = App.PollingController.extend(App.ModelRefreshMixin, { controllerName: 'TaskIndexController', + needs: "task", + taskStatus: function() { return App.Helpers.misc.getFixedupDisplayStatus(this.get('model.status')); }.property('id', 'model.status'), @@ -40,4 +42,27 @@ App.TaskIndexController = App.PollingController.extend(App.ModelRefreshMixin, { } }, -}); \ No newline at end of file + logsLink: null, + + logsLinkObserver: function() { + + var model = this.get('content'); + var taskAttemptId = model.get('successfulAttemptId') || model.get('attempts.lastObject'); + var store = this.get('store'); + var that = this; + + if (taskAttemptId) { + store.find('taskAttempt', taskAttemptId).then(function(attempt) { + var cellContent = App.Helpers.misc.constructLogLinks( + attempt, + that.get('controllers.task.appDetail.status'), + that.get('controllers.task.tezApp.user') + ); + + cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl; + that.set('logsLink', cellContent); + }); + } + }.observes('id', 'successfulAttemptId'), + +}); http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js index 0f11379..580af05 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js @@ -223,6 +223,8 @@ App.TaskAttemptsController = App.TablePageController.extend(App.AutoCounterColum App.TaskAttemptIndexController = Em.ObjectController.extend(App.ModelRefreshMixin, { controllerName: 'TaskAttemptIndexController', + needs: "taskAttempt", + taskAttemptStatus: function() { return App.Helpers.misc.getFixedupDisplayStatus(this.get('status')); }.property('id', 'status'), @@ -242,4 +244,15 @@ App.TaskAttemptIndexController = Em.ObjectController.extend(App.ModelRefreshMixi } }, + logsLink: function() { + var cellContent = App.Helpers.misc.constructLogLinks( + this.get('content'), + this.get('controllers.taskAttempt.appDetail.status'), + this.get('controllers.taskAttempt.tezApp.user') + ); + + cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl; + return cellContent; + }.property('id', 'controllers.taskAttempt'), + }); http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/tez-ui/src/main/webapp/app/templates/task/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/task/index.hbs b/tez-ui/src/main/webapp/app/templates/task/index.hbs index 05adec4..09cd986 100644 --- a/tez-ui/src/main/webapp/app/templates/task/index.hbs +++ b/tez-ui/src/main/webapp/app/templates/task/index.hbs @@ -64,6 +64,23 @@ <td>{{t 'common.time.duration'}}</td> <td>{{formatDuration startTime endTime}}</td> </tr> + <tr> + <td>Logs</td> + <td> + {{#if logsLink.viewUrl}} + <a target="_blank" href='//{{unbound logsLink.viewUrl}}'>View</a> + + {{/if}} + {{#if logsLink.downloadUrl}} + <a target="_blank" href='{{unbound logsLink.downloadUrl}}' download type="application/octet-stream">Download</a> + {{/if}} + {{#unless logsLink.viewUrl}} + {{#unless logsLink.downloadUrl}} + <span class="message">Not Available!</span> + {{/unless}} + {{/unless}} + </td> + </tr> </tbody> </table> </div> http://git-wip-us.apache.org/repos/asf/tez/blob/85637c61/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs index c7e3330..e1c60d1 100644 --- a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs +++ b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs @@ -72,6 +72,23 @@ <td>{{t 'common.time.duration'}}</td> <td>{{formatDuration startTime endTime}}</td> </tr> + <tr> + <td>Logs</td> + <td> + {{#if logsLink.viewUrl}} + <a target="_blank" href='//{{unbound logsLink.viewUrl}}'>View</a> + + {{/if}} + {{#if logsLink.downloadUrl}} + <a target="_blank" href='{{unbound logsLink.downloadUrl}}' download type="application/octet-stream">Download</a> + {{/if}} + {{#unless logsLink.viewUrl}} + {{#unless logsLink.downloadUrl}} + <span class="message">Not Available!</span> + {{/unless}} + {{/unless}} + </td> + </tr> </tbody> </table> </div>
