From f116226724c7c071c4ec8e48560a7e3806c51ee2 Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Wed, 11 Dec 2019 01:35:13 +0900 Subject: [PATCH 1/5] YARN-10020. Fix build instruction of hadoop-yarn-ui. --- .../hadoop-yarn/hadoop-yarn-ui/README.md | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md index e4135ec275428..2dc2e011db9e6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md @@ -21,7 +21,12 @@ The YARN UI is an Ember based web-app that provides visualization of the applica ## Configurations -* You can point the UI to custom locations by setting the environment variables in `src/main/webapp/config/configs.env` +You can point the UI to custom locations by setting the environment variables in `src/main/webapp/config/configs.env`. + +In order to access RM from UI started by `yarn start`, +you need to enbale CORS by setting `hadoop.http.cross-origin.enabled` to true +and adding `org.apache.hadoop.security.HttpCrossOriginFilterInitializer` +to `hadoop.http.filter.initializers` in core-site.xml. ## Development @@ -32,9 +37,22 @@ All the following commands must be run inside `src/main/webapp`. You will need the following things properly installed on your computer. * Install [Yarn](https://yarnpkg.com) v0.21.3 -* Install [Bower](http://bower.io/) v1.7.7 +* Install [Bower](http://bower.io/) v1.8.8 * Install all dependencies by running `yarn install` & `bower install` +Instead of manual installation, you can reuse locally installed Node.js, +Yarn and Bower after building by maven with `-Pyarn-ui` in this directory. + +``` +$ mvn package -Pyarn-ui +$ export PATH=$PWD/target/webapp/node:$PATH +$ export YARNJS=$PWD/target/webapp/node/yarn/dist/bin/yarn.js +$ cd src/main/webapp/ +$ node $YARNJS install +$ node node_modules/.bin/bower install +$ node $YARNJS start +``` + ### Running UI * `yarn start` From 80f1932a24ee0467d66efc8d1dc568e276c4fc28 Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Tue, 17 Dec 2019 10:05:28 +0900 Subject: [PATCH 2/5] moved added contents to independent sub-section. --- .../hadoop-yarn/hadoop-yarn-ui/README.md | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md index 2dc2e011db9e6..c955aa64e9d32 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md @@ -40,19 +40,6 @@ You will need the following things properly installed on your computer. * Install [Bower](http://bower.io/) v1.8.8 * Install all dependencies by running `yarn install` & `bower install` -Instead of manual installation, you can reuse locally installed Node.js, -Yarn and Bower after building by maven with `-Pyarn-ui` in this directory. - -``` -$ mvn package -Pyarn-ui -$ export PATH=$PWD/target/webapp/node:$PATH -$ export YARNJS=$PWD/target/webapp/node/yarn/dist/bin/yarn.js -$ cd src/main/webapp/ -$ node $YARNJS install -$ node node_modules/.bin/bower install -$ node $YARNJS start -``` - ### Running UI * `yarn start` @@ -80,3 +67,20 @@ YARN UI has replaced NPM with Yarn package manager. And hence Yarn would be used ### Adding new routes (pages), controllers, components etc. * Use ember-cli blueprint generator - [Ember CLI](http://ember-cli.com/extending/#generators-and-blueprints) + +### Building with Maven + +YARN-6278 added build profile using rontend-maven-plugin which +automatically installs Node.js and Yarn locally under target/webapp directory. +After building yarn-ui by `mvn package -Pyarn-ui`, you can reuse +locally installed Node.js and Yarn instead of manually installing them. + +``` +$ mvn package -Pyarn-ui +$ export PATH=$PWD/target/webapp/node:$PATH +$ export YARNJS=$PWD/target/webapp/node/yarn/dist/bin/yarn.js +$ cd src/main/webapp/ +$ node $YARNJS install +$ node node_modules/.bin/bower install +$ node $YARNJS start +``` From a8f12cc4fea4667109d9df95d67f146f06af2e7c Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Tue, 17 Dec 2019 12:22:05 +0900 Subject: [PATCH 3/5] made JIRA issue key hyperlink. --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md index c955aa64e9d32..8f7c8c100cd6b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md @@ -70,7 +70,8 @@ YARN UI has replaced NPM with Yarn package manager. And hence Yarn would be used ### Building with Maven -YARN-6278 added build profile using rontend-maven-plugin which +[YARN-6278](https://issues.apache.org/jira/browse/YARN-6278) +added build profile using rontend-maven-plugin which automatically installs Node.js and Yarn locally under target/webapp directory. After building yarn-ui by `mvn package -Pyarn-ui`, you can reuse locally installed Node.js and Yarn instead of manually installing them. From d969c575b31ea890e86455d27d92bc2ffd1d23a2 Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Tue, 17 Dec 2019 12:26:04 +0900 Subject: [PATCH 4/5] fixed typo. --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md index 8f7c8c100cd6b..49e5209541427 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md @@ -71,7 +71,7 @@ YARN UI has replaced NPM with Yarn package manager. And hence Yarn would be used ### Building with Maven [YARN-6278](https://issues.apache.org/jira/browse/YARN-6278) -added build profile using rontend-maven-plugin which +added build profile using frontend-maven-plugin which automatically installs Node.js and Yarn locally under target/webapp directory. After building yarn-ui by `mvn package -Pyarn-ui`, you can reuse locally installed Node.js and Yarn instead of manually installing them. From 2f8b12f9142f27e268e32c1899bbc1b12377662b Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Tue, 17 Dec 2019 15:27:32 +0900 Subject: [PATCH 5/5] updated wording based on review comments. --- .../hadoop-yarn/hadoop-yarn-ui/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md index 49e5209541427..bc4a8296f8ef7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/README.md @@ -23,10 +23,11 @@ The YARN UI is an Ember based web-app that provides visualization of the applica You can point the UI to custom locations by setting the environment variables in `src/main/webapp/config/configs.env`. -In order to access RM from UI started by `yarn start`, -you need to enbale CORS by setting `hadoop.http.cross-origin.enabled` to true +In order to make the UI running on Ember server (started by `yarn start`) +work with independently running ResouceManager, +you need to enable CORS by setting `hadoop.http.cross-origin.enabled` to true and adding `org.apache.hadoop.security.HttpCrossOriginFilterInitializer` -to `hadoop.http.filter.initializers` in core-site.xml. +to `hadoop.http.filter.initializers` in core-site.xml of the ResourceManager. ## Development @@ -71,10 +72,11 @@ YARN UI has replaced NPM with Yarn package manager. And hence Yarn would be used ### Building with Maven [YARN-6278](https://issues.apache.org/jira/browse/YARN-6278) -added build profile using frontend-maven-plugin which +added `yarn-ui` profile to pom.xml leveraging +[frontend-maven-plugin](https://github.com/eirslett/frontend-maven-plugin) which automatically installs Node.js and Yarn locally under target/webapp directory. After building yarn-ui by `mvn package -Pyarn-ui`, you can reuse -locally installed Node.js and Yarn instead of manually installing them. +the locally installed Node.js and Yarn instead of manually installing them. ``` $ mvn package -Pyarn-ui