Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8475C200BA1 for ; Mon, 17 Oct 2016 20:34:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 82F37160AEC; Mon, 17 Oct 2016 18:34:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A4B14160AE2 for ; Mon, 17 Oct 2016 20:34:15 +0200 (CEST) Received: (qmail 69763 invoked by uid 500); 17 Oct 2016 18:34:14 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 69754 invoked by uid 99); 17 Oct 2016 18:34:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2016 18:34:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8B794E0579; Mon, 17 Oct 2016 18:34:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangda@apache.org To: common-commits@hadoop.apache.org Message-Id: <4b36cca6a99d4d9ebdc30979f8931494@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-5145. [YARN-3368] Move new YARN UI configuration to HADOOP_CONF_DIR. (Sunil G and Kai Sasaki via wangda) [Forced Update!] Date: Mon, 17 Oct 2016 18:34:14 +0000 (UTC) archived-at: Mon, 17 Oct 2016 18:34:16 -0000 Repository: hadoop Updated Branches: refs/heads/YARN-3368 5382eb25f -> 754b30234 (forced update) YARN-5145. [YARN-3368] Move new YARN UI configuration to HADOOP_CONF_DIR. (Sunil G and Kai Sasaki via wangda) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/754b3023 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/754b3023 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/754b3023 Branch: refs/heads/YARN-3368 Commit: 754b302341df7145518115993092bc44483fef69 Parents: 314bcba Author: Wangda Tan Authored: Mon Oct 17 11:30:16 2016 -0700 Committer: Wangda Tan Committed: Mon Oct 17 11:33:48 2016 -0700 ---------------------------------------------------------------------- .../src/site/markdown/YarnUI2.md | 6 +- .../src/main/webapp/app/initializers/loader.js | 86 ++++++++++++++++++++ .../tests/unit/initializers/loader-test.js | 40 +++++++++ 3 files changed, 129 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/754b3023/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnUI2.md ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnUI2.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnUI2.md index ff48183..9ebb148 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnUI2.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnUI2.md @@ -34,8 +34,8 @@ Configurations | Configuration Property | Description | |:---- |:---- | -| `yarn.resourcemanager.webapp.ui2.enable` | In the server side it indicates whether the new YARN-UI v2 is enabled or not. Defaults to `false`. | -| `yarn.resourcemanager.webapp.ui2.address` | Specify the address of ResourceManager and port which host YARN-UI v2, defaults to `localhost:8288`. | +| `yarn.webapp.ui2.enable` | In the server side it indicates whether the new YARN-UI v2 is enabled or not. Defaults to `false`. | +| `yarn.webapp.ui2.war-file-path` | WAR file path for launching yarn UI2 web application. | *In $HADOOP_PREFIX/share/hadoop/yarn/webapps/rm/config/configs.env* @@ -44,4 +44,4 @@ Configurations Use it ------------- -Open your browser, go to `rm-address:8288` and try it! +Open your browser, go to `rm-address:8088/ui2` and try it! http://git-wip-us.apache.org/repos/asf/hadoop/blob/754b3023/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js ---------------------------------------------------------------------- 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 new file mode 100644 index 0000000..08e4dbd --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js @@ -0,0 +1,86 @@ +/** + * 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 getTimeLineURL(parameters) { + return '/conf?name=yarn.timeline-service.webapp.address'; +} + +function updateConfigs(application) { + var hostname = window.location.hostname; + var rmhost = hostname + + (window.location.port ? ':' + window.location.port: ''); + + Ember.Logger.log("RM Address:" + rmhost); + + if(!ENV.hosts.rmWebAddress) { + ENV = { + hosts: { + rmWebAddress: rmhost, + }, + }; + } + + if(!ENV.hosts.timelineWebAddress) { + var result = []; + var timelinehost = ""; + $.ajax({ + type: 'GET', + dataType: 'json', + async: true, + context: this, + url: getTimeLineURL(), + success: function(data) { + timelinehost = data.property.value; + ENV.hosts.timelineWebAddress = timelinehost; + + var address = timelinehost.split(":")[0]; + var port = timelinehost.split(":")[1]; + + Ember.Logger.log("Timeline Address from RM:" + address + ":" + port); + + if(address == "0.0.0.0" || address == "localhost") { + var updatedAddress = hostname + ":" + port; + + /* Timeline v2 is not supporting CORS, so make as default*/ + ENV = { + hosts: { + rmWebAddress: rmhost, + timelineWebAddress: updatedAddress, + }, + }; + Ember.Logger.log("Timeline Updated Address:" + updatedAddress); + } + application.advanceReadiness(); + }, + }); + } else { + application.advanceReadiness(); + } +} + +export function initialize( application ) { + application.deferReadiness(); + updateConfigs(application); +} + +export default { + name: 'loader', + before: 'env', + initialize +}; http://git-wip-us.apache.org/repos/asf/hadoop/blob/754b3023/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js new file mode 100644 index 0000000..cc32e92 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/initializers/loader-test.js @@ -0,0 +1,40 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import LoaderInitializer from '../../../initializers/loader'; +import { module, test } from 'qunit'; + +let application; + +module('Unit | Initializer | loader', { + beforeEach() { + Ember.run(function() { + application = Ember.Application.create(); + application.deferReadiness(); + }); + } +}); + +// Replace this with your real tests. +test('it works', function(assert) { + LoaderInitializer.initialize(application); + + // you would normally confirm the results of the initializer here + assert.ok(true); +}); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org