You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2016/11/23 11:58:14 UTC
zeppelin git commit: [ZEPPELIN-1667] Fix maven options while updating
node, npm packages
Repository: zeppelin
Updated Branches:
refs/heads/master 7f6f739ae -> abe03a866
[ZEPPELIN-1667] Fix maven options while updating node, npm packages
### What is this PR for?
Update maven plugin, node vesion, npm package and fix tests to make #1639 pass CI
### What is the Jira issue?
Sub issue of #1639
### Questions:
Does the licenses files need update? NO
Is there breaking changes for older versions? YES (front-end build tool usage changed)
Does this needs documentation? YES (front-end build tool usage changed)
Author: 1ambda <1a...@gmail.com>
Closes #1659 from 1ambda/pr/1639 and squashes the following commits:
e5b414b [1ambda] docs: Add a package installation command
d8c9d36 [1ambda] docs: Update zeppelin-web/README.md
f0fcdff [1ambda] feat: Add start script to package.json
a2aab1f [1ambda] fix: Remove useless script
5cdd813 [1ambda] fix: Print warn, error log only while packing
5e1e746 [1ambda] fix: Caching npm, bower, node directories
ac40b56 [1ambda] test: fix test for jasmine-core 2.x
ded1f2c [1ambda] chore: Update karma, phantom related package version
6bb52cc [1ambda] chore: Add slient option to bower (show error only)
ca2359c [1ambda] fix: Restore bower install option
4c26211 [1ambda] chore: Update node, npm version to avoid proxy error
e085809 [1ambda] chore: Remove bower install root option
488092a [1ambda] chore: fix travis maven option
668a687 [1ambda] chore: Set maven option using mavenrc
f42531a [1ambda] chore: Update assembly plugin version
532f1e6 [1ambda] fix(web): npm tasks in pom.xml
6568960 [1ambda] chore: Add test, build task to npm
314dcd8 [1ambda] chore: Update frontend plugin version
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/abe03a86
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/abe03a86
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/abe03a86
Branch: refs/heads/master
Commit: abe03a866fc9ac2563c057d6edc00d3ec0a7d733
Parents: 7f6f739
Author: 1ambda <1a...@gmail.com>
Authored: Tue Nov 22 13:49:04 2016 +0900
Committer: Alexander Bezzubov <bz...@apache.org>
Committed: Wed Nov 23 20:58:08 2016 +0900
----------------------------------------------------------------------
.travis.yml | 8 ++--
pom.xml | 2 +-
zeppelin-server/pom.xml | 1 -
zeppelin-web/README.md | 50 +++++++++++---------
zeppelin-web/bower | 17 -------
zeppelin-web/grunt | 18 -------
zeppelin-web/package.json | 20 +++++---
zeppelin-web/pom.xml | 27 ++++-------
zeppelin-web/test/spec/controllers/paragraph.js | 6 +--
9 files changed, 61 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 1cb2e1b..cc69ec1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,7 +23,9 @@ cache:
- .spark-dist
- ${HOME}/.m2
- ${HOME}/R
- - .node_modules
+ - zeppelin-web/node
+ - zeppelin-web/node_modules
+ - zeppelin-web/bower_components
addons:
apt:
@@ -65,6 +67,7 @@ matrix:
env: TEST_SELENIUM="true" SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Phadoop-2.3 -Ppyspark -Pexamples" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.AbstractFunctionalSuite -DfailIfNoTests=false"
before_install:
+ - echo "MAVEN_OPTS='-Xms1024M -Xmx2048M -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit'" >> ~/.mavenrc
- "ls -la .spark-dist ${HOME}/.m2/repository/.cache/maven-download-plugin"
- ls .node_modules && cp -r .node_modules zeppelin-web/node_modules || echo "node_modules are not cached"
- mkdir -p ~/R
@@ -75,7 +78,7 @@ before_install:
- ./dev/change_scala_version.sh $SCALA_VER
install:
- - mvn $BUILD_FLAG $PROFILE -B
+ - mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=warn $BUILD_FLAG $PROFILE -B
before_script:
- travis_retry ./testing/downloadSpark.sh $SPARK_VER $HADOOP_VER
@@ -84,7 +87,6 @@ before_script:
script:
- mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=warn $TEST_FLAG $PROFILE -B $TEST_PROJECTS
- - rm -rf .node_modules; cp -r zeppelin-web/node_modules .node_modules
after_success:
- echo "Travis exited with ${TRAVIS_TEST_RESULT}"
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 80b0373..2f7ac3c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -437,7 +437,7 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.4</version>
+ <version>3.0.0</version>
</plugin>
<plugin>
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-server/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-server/pom.xml b/zeppelin-server/pom.xml
index 44af415..3864ef6 100644
--- a/zeppelin-server/pom.xml
+++ b/zeppelin-server/pom.xml
@@ -504,5 +504,4 @@
</profile>
</profiles>
-
</project>
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-web/README.md
----------------------------------------------------------------------
diff --git a/zeppelin-web/README.md b/zeppelin-web/README.md
index 1260479..edb4924 100644
--- a/zeppelin-web/README.md
+++ b/zeppelin-web/README.md
@@ -1,51 +1,57 @@
# Zeppelin Web Application
-This is Zeppelin's frontend project.
-
-
-## Compile Zeppelin web
-### New environment
+This is Zeppelin's frontend project.
-If you want to compile the WebApplication only, you will have to simply run `mvn package` in this folder.
+## Development Guide
-This will Download all the dependencies including node js and npm (you will find the binaries in the folder `zeppelin-web/node`).
+### Packaging
-We are supposed to provide some **helper script** for __bower__ and __grunt__, but they are currently outdated, so you might want install them on your machine and use them instead.
+If you want to package the zeppelin-web only, simply run this command in this folder.
+This will download all the dependencies including node (the binaries in the folder `zeppelin-web/node`)
-### Configured environment
+```
+$ mvn package
+```
-Here are the basic commands to compile the WebApplication with a configured environment (Installed grunt, bower, npm)
+### Local Development
-**Build the application for production**
+It is recommended to install node 6.0.0+ since Zeppelin uses 6.9.1+ (see [creationix/nvm](https://github.com/creationix/nvm))
-`./grunt build`
+All build commands are described in [package.json](./package.json)
-**Run the application in dev mode**
+```sh
+# install required depepdencies and bower packages (only once)
+$ npm install
-``./grunt serve``
+# build zeppelin-web for production
+$ npm run build
-This will launch a Zeppelin WebApplication on port **9000** that will update on code changes.
-(You will need to have Zeppelin running on the side)
+# run frontend application only in dev mode (localhost:9000)
+# you need to run zeppelin backend instance also
+$ npm run start
+# execute tests
+$ npm run test
+```
-#### Troubleshooting
+## Troubleshooting
-**git error**
+#### Git error
In case of the error `ECMDERR Failed to execute "git ls-remote --tags --heads git://xxxxx", exit code of #128`
change your git config with `git config --global url."https://".insteadOf git://`
-**proxy issues**
+#### Proxy issues
Try to add to the `.bowerrc` file the following content:
```
"proxy" : "http://<host>:<port>",
"https-proxy" : "http://<host>:<port>"
- ```
+```
also try to add proxy info to npm install command:
-```
+```xml
<execution>
<id>npm install</id>
<goals>
@@ -57,8 +63,8 @@ also try to add proxy info to npm install command:
</execution>
```
-
and retry to build again.
## Contribute on Zeppelin Web
+
If you wish to help us and contribute to Zeppelin WebApplication, please look at the overall project [contribution guidelines](https://zeppelin.apache.org/contribution/contributions.html) and the more focused [Zeppelin WebApplication's documentation](https://zeppelin.apache.org/contribution/webapplication.html).
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-web/bower
----------------------------------------------------------------------
diff --git a/zeppelin-web/bower b/zeppelin-web/bower
deleted file mode 100755
index ed00320..0000000
--- a/zeppelin-web/bower
+++ /dev/null
@@ -1,17 +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.
-#
-"node/node" "./node_modules/bower/bin/bower" "$@"
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-web/grunt
----------------------------------------------------------------------
diff --git a/zeppelin-web/grunt b/zeppelin-web/grunt
deleted file mode 100755
index 759cae7..0000000
--- a/zeppelin-web/grunt
+++ /dev/null
@@ -1,18 +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.
-#
-"node/node" "./node_modules/.bin/grunt" "$@"
-
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-web/package.json
----------------------------------------------------------------------
diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json
index fc51573..e6ee203 100644
--- a/zeppelin-web/package.json
+++ b/zeppelin-web/package.json
@@ -2,13 +2,20 @@
"name": "zeppelin-web",
"license": "Apache-2.0",
"version": "0.0.0",
+ "engines" : { "node" : ">=6.0.0" },
+ "scripts": {
+ "postinstall": "node_modules/.bin/bower install --silent",
+ "build": "./node_modules/.bin/grunt build",
+ "start": "./node_modules/.bin/grunt serve",
+ "test": "./node_modules/.bin/grunt test"
+ },
"dependencies": {
"grunt-angular-templates": "^0.5.7",
"grunt-dom-munger": "^3.4.0"
},
"devDependencies": {
"autoprefixer": "^6.1.0",
- "bower": "1.7.2",
+ "bower": "^1.8.0",
"grunt": "^0.4.1",
"grunt-cache-bust": "1.3.0",
"grunt-cli": "^0.1.13",
@@ -26,17 +33,18 @@
"grunt-goog-webfont-dl": "^0.1.2",
"grunt-htmlhint": "^0.9.13",
"grunt-jscs": "^2.1.0",
- "grunt-karma": "~0.8.3",
+ "grunt-karma": "~2.0.0",
"grunt-newer": "^0.7.0",
"grunt-ng-annotate": "^0.10.0",
"grunt-postcss": "^0.7.1",
"grunt-svgmin": "^0.4.0",
"grunt-usemin": "^2.1.1",
"grunt-wiredep": "~2.0.0",
- "karma": "~0.12.23",
- "karma-coverage": "^0.5.1",
- "karma-jasmine": "~0.1.5",
- "karma-phantomjs-launcher": "~1.0.0",
+ "jasmine-core": "^2.5.2",
+ "karma": "~1.3.0",
+ "karma-coverage": "^1.1.1",
+ "karma-jasmine": "~1.0.2",
+ "karma-phantomjs-launcher": "~1.0.2",
"load-grunt-tasks": "^0.4.0",
"time-grunt": "^0.3.1"
},
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-web/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-web/pom.xml b/zeppelin-web/pom.xml
index e5dee60..05788bb 100644
--- a/zeppelin-web/pom.xml
+++ b/zeppelin-web/pom.xml
@@ -90,7 +90,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
- <version>1.1</version>
+ <version>1.3</version>
<executions>
<execution>
@@ -99,8 +99,8 @@
<goal>install-node-and-npm</goal>
</goals>
<configuration>
- <nodeVersion>v4.4.7</nodeVersion>
- <npmVersion>2.15.0</npmVersion>
+ <nodeVersion>v6.9.1</nodeVersion>
+ <npmVersion>3.10.8</npmVersion>
</configuration>
</execution>
@@ -109,36 +109,29 @@
<goals>
<goal>npm</goal>
</goals>
- </execution>
-
- <execution>
- <id>bower install</id>
- <goals>
- <goal>bower</goal>
- </goals>
<configuration>
- <arguments>--allow-root install</arguments>
+ <arguments>install</arguments>
</configuration>
</execution>
<execution>
- <id>grunt build</id>
+ <id>npm build</id>
<goals>
- <goal>grunt</goal>
+ <goal>npm</goal>
</goals>
<configuration>
- <arguments>build</arguments>
+ <arguments>run build</arguments>
</configuration>
</execution>
<execution>
- <id>grunt test</id>
+ <id>npm test</id>
<goals>
- <goal>grunt</goal>
+ <goal>npm</goal>
</goals>
<phase>test</phase>
<configuration>
- <arguments>test</arguments>
+ <arguments>run test</arguments>
</configuration>
</execution>
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/abe03a86/zeppelin-web/test/spec/controllers/paragraph.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/test/spec/controllers/paragraph.js b/zeppelin-web/test/spec/controllers/paragraph.js
index 1ba51e4..aae6f22 100644
--- a/zeppelin-web/test/spec/controllers/paragraph.js
+++ b/zeppelin-web/test/spec/controllers/paragraph.js
@@ -61,7 +61,7 @@ describe('Controller: ParagraphCtrl', function() {
it('should call loadTableData() and getGraphMode() should return "table" when the result type is "TABLE"',
function() {
- scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
+ scope.getResultType = jasmine.createSpy('getResultType spy').and.callFake(function() {
return 'TABLE';
});
spyOn(scope, 'setGraphMode');
@@ -71,7 +71,7 @@ describe('Controller: ParagraphCtrl', function() {
});
it('should call renderHtml() when the result type is "HTML"', function() {
- scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
+ scope.getResultType = jasmine.createSpy('getResultType spy').and.callFake(function() {
return 'HTML';
});
spyOn(scope, 'renderHtml');
@@ -80,7 +80,7 @@ describe('Controller: ParagraphCtrl', function() {
});
it('should call renderAngular() when the result type is "ANGULAR"', function() {
- scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
+ scope.getResultType = jasmine.createSpy('getResultType spy').and.callFake(function() {
return 'ANGULAR';
});
spyOn(scope, 'renderAngular');