diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js index b4de94f271..031dd41be9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js @@ -408,9 +408,9 @@ export default Ember.Component.extend({ contentPath: 'logsLink', cellComponentName: 'em-table-html-cell', getCellContent: function(row) { - var logUrl = self.checkHttpProtocol(row.get('logsLink')); - if (logUrl) { - return `Link`; + var containerLogUrl = row.get('appAttemptContainerLogsURL'); + if (containerLogUrl) { + return `Link`; } else { return 'N/A'; } @@ -490,9 +490,9 @@ export default Ember.Component.extend({ contentPath: 'logUrl', cellComponentName: 'em-table-html-cell', getCellContent: function(row) { - var url = self.checkHttpProtocol(row.get('logUrl')); - if (url) { - return `${url}`; + var containerLogUrl = row.get('appAttemptContainerLogsURL'); + if (containerLogUrl) { + return `Link`; } else { return 'N/A'; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js index 8224011732..e1a8ec8dc2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js @@ -20,8 +20,10 @@ import Ember from 'ember'; import Constants from 'yarn-ui/constants'; export default Ember.Controller.extend({ - queryParams: ["service"], + queryParams: ["service", "attempt", "containerid"], service: undefined, + attempt: undefined, + containerid: undefined, selectedAttemptId: "", attemptContainerList: null, @@ -40,7 +42,7 @@ export default Ember.Controller.extend({ }, actions: { - showContainersForAttemptId(attemptId) { + showContainersForAttemptId(attemptId, containerId = "") { this.set("selectedAttemptId", ""); if (attemptId) { this.set("_isLoadingTopPanel", true); @@ -75,6 +77,9 @@ export default Ember.Controller.extend({ } this.set("attemptContainerList", containers); this.initializeSelect(".js-fetch-logs-containers"); + if (containerId) { + this.send("showLogFilesForContainerId", containerId); + } }) .finally(() => { this.set("_isLoadingTopPanel", false); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js index 026cd7f991..963fc1418c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js @@ -47,7 +47,7 @@ export default Ember.Helper.helper(function(params,hash) { nodeAddr + '/' + containerId + '/' + logFileName + '">' + logFileName + ''; if (i !== logFilesLen - 1) { - html = html + ","; + html = html + ", "; } } html = html + ''; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js index e695ea6ea8..ad0132cd60 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js @@ -113,7 +113,8 @@ function getClusterIdFromYARN(rmhost, application) { function getNodeManagerPort(rmhost, application) { var httpUrl = window.location.protocol + "//" + (ENV.hosts.localBaseAddress ? ENV.hosts.localBaseAddress + '/' : '') + rmhost - + ":" + window.location.port + "/conf?name=yarn.nodemanager.webapp.address"; + + "/conf?name=yarn.nodemanager.webapp.address"; + var port = "8042"; $.ajax({ type: 'GET', @@ -158,6 +159,7 @@ function updateConfigs(application) { ENV.clusterId = clusterIdFromYARN; var nodeManagerPort = getNodeManagerPort(rmhost, application); + Ember.Logger.log("NodeMananger port: " + nodeManagerPort); ENV.nodeManagerPort = nodeManagerPort; if(!ENV.hosts.timelineWebAddress) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js index 6538f2053d..b89db46268 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js @@ -147,4 +147,10 @@ export default DS.Model.extend({ return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`; }.property("nodeId", "nodeHttpAddress"), + appAttemptContainerLogsURL: function() { + const attemptId = this.get("id"); + const containerId = this.get("appMasterContainerId"); + const appId = Converter.attemptIdToAppId(attemptId); + return `#/yarn-app/${appId}/logs?attempt=${attemptId}&containerid=${containerId}`; + }.property("id", "appMasterContainerId") }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js index f13c40536d..6a33e9a2fe 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js @@ -66,5 +66,12 @@ export default DS.Model.extend({ masterNodeURL: function() { var addr = encodeURIComponent(this.get("nodeHttpAddress")); return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`; - }.property("nodeId", "nodeHttpAddress") + }.property("nodeId", "nodeHttpAddress"), + + appAttemptContainerLogsURL: function() { + const containerId = this.get("id"); + const attemptId = Converter.containerIdToAttemptId(containerId); + const appId = Converter.attemptIdToAppId(attemptId); + return `#/yarn-app/${appId}/logs?attempt=${attemptId}&containerid=${containerId}`; + }.property("id") }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js index 104c1a96a6..1a972361af 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-timeline-container.js @@ -67,5 +67,12 @@ export default DS.Model.extend({ masterNodeURL: function() { var addr = encodeURIComponent(this.get("nodeHttpAddress")); return `#/yarn-node/${this.get("nodeId")}/${addr}/info/`; - }.property("nodeId", "nodeHttpAddress") + }.property("nodeId", "nodeHttpAddress"), + + appAttemptContainerLogsURL: function() { + const containerId = this.get("id"); + const attemptId = Converter.containerIdToAttemptId(containerId); + const appId = Converter.attemptIdToAppId(attemptId); + return `#/yarn-app/${appId}/logs?attempt=${attemptId}&containerid=${containerId}`; + }.property("id") }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js index 99e4cff093..b73bc80f17 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js @@ -37,8 +37,14 @@ export default AbstractRoute.extend(AppAttemptMixin, { activate() { const controller = this.controllerFor("yarn-app.logs"); + const { attempt, containerid } = this.paramsFor('yarn-app.logs'); controller.resetAfterRefresh(); controller.initializeSelect(); + if (attempt) { + controller.send("showContainersForAttemptId", attempt, containerid); + } else { + controller.set("selectedAttemptId", ""); + } }, unloadAll() { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js index 388918ed52..0060e2bbb5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-node-container.js @@ -22,12 +22,14 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model(param) { + let nodeAddress = decodeURIComponent(param.node_addr); + nodeAddress = nodeAddress.replace(/(^\w+:|^)\/\//, ''); // Get a specific container running on a specific node. return Ember.RSVP.hash({ nodeContainer: this.store.queryRecord('yarn-node-container', - { nodeHttpAddr: param.node_addr, containerId: param.container_id }), - nmGpuInfo: this.store.findRecord('yarn-nm-gpu', param.node_addr, {reload:true}), - nodeInfo: { id: param.node_id, addr: param.node_addr, containerId: param.container_id } + { nodeHttpAddr: nodeAddress, containerId: param.container_id }), + nmGpuInfo: this.store.findRecord('yarn-nm-gpu', nodeAddress, {reload:true}), + nodeInfo: { id: param.node_id, addr: nodeAddress, containerId: param.container_id } }); }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs index 06dd7541fe..91c7eeaf9a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs @@ -62,10 +62,12 @@ {{attempt.exposedPorts}} {{/if}} - {{#if attempt.logsLink}} + {{#if attempt.appAttemptContainerLogsURL}} - Log - Link + Logs + + Link + {{/if}} {{#if attempt.diagnosticsInfo}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs index 9bdabec626..25d57c5f02 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs @@ -60,10 +60,12 @@ {{container.exposedPorts}} {{/if}} - {{#if container.logUrl}} + {{#if container.appAttemptContainerLogsURL}} - Log - Link + Logs + + Link + {{/if}} {{#if container.nodeHttpAddress}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs index 6e9bc08862..c16a7a5f7c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs @@ -19,7 +19,7 @@ {{breadcrumb-bar breadcrumbs=breadcrumbs}} {{#if actionResponse}} -
+
{{/if}} -
+
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs index f740083b8a..743e2bfa74 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs @@ -20,7 +20,9 @@

Loading...

{{else}} {{#if model.apps}} +
{{em-table columns=columns rows=model.apps definition=tableDefinition}} +
{{else}}

Could not find any applications from this cluster

{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs index a2c708e2ea..59cbbf0abd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node/info.hbs @@ -129,9 +129,7 @@
-
  • - Resources - yarn.io/gpu -
  • + Resources - yarn.io/gpu
    {{donut-chart data=model.rmNode.getGpuDataForDonutChart