-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZEPPELIN-1928]: Get a rid of preinstalled external dependencies (nodejs and npm) for maven build #2002
[ZEPPELIN-1928]: Get a rid of preinstalled external dependencies (nodejs and npm) for maven build #2002
Changes from 3 commits
d09f9b3
337bc89
eec761f
e730dff
7a160de
07cef04
a4210b3
49506a8
aceb92d
2ed710f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
( sudo apt-get install libfontconfig -y || sudo yum install fontconfig -y ) || exit 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure it's best idea install package on the system without asking user. Shell we remove this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest this is not the best solution. The best solution would be present all dependencies in phantomjs for all planforms. But this workaround just work in linux and provide automatical build with maven and not required from e.g. (backend developers and wondows users) to be familiar with hodejs npm yarn and other UI-specific things like hidden dependencies and so on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then how about print message "Please install xxxxx with apt-get install xxxxx command" when required libraries are not available on the system? I still think installing package without asking user is not really a good idea. And we can't assume that user will build Zeppelin with 'sudo' enabled account. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Leemoonsoo Mmm, the main goal of this PR is give possibility run
(see http://zeppelin.apache.org/docs/snapshot/install/build.html#package) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then how about adjust build order? Move 'zeppelin-web' module to the front of build order, so it can fail early? We never know user want to (or allowed to) install any package on the system or not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Leemoonsoo I can adjust build order but this do not save enough time - its run about 40 minutes until fail. To be honest I don't understand why you so opposite to automatically install package which should be already installed for build? If you have newer version at your workstation package manager will not reinstall old package. This is a safe operation. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,37 @@ | |
<!--plugin versions--> | ||
<plugin.frontned.version>1.3</plugin.frontned.version> | ||
</properties> | ||
|
||
<profiles> | ||
<profile> | ||
<id>linux_profile</id> | ||
<activation> | ||
<os> | ||
<family>linux</family> | ||
</os> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>some-execution</id> | ||
<phase>process-test-resources</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<executable>${basedir}/add_dependencies.sh</executable> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
<build> | ||
<plugins> | ||
|
@@ -98,6 +129,7 @@ | |
<exclude>**/.npmignore</exclude> | ||
<exclude>yarn.lock</exclude> | ||
<exclude>*.md</exclude> | ||
<exclude>*.sh</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
|
@@ -120,34 +152,77 @@ | |
</execution> | ||
|
||
<execution> | ||
<id>yarn install</id> | ||
<goals> | ||
<goal>yarn</goal> | ||
</goals> | ||
<configuration> | ||
<arguments>install --no-lockfile</arguments> | ||
</configuration> | ||
<id>yarn add bower</id> | ||
<goals> | ||
<goal>yarn</goal> | ||
</goals> | ||
<configuration> | ||
<!--ignore-scripts--> | ||
<arguments>add bower --no-lockfile --no-bin-links</arguments> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't need to run 'yarn add bower' and we can just run command defined in 'script' field in 'package.json'. like 'yarn install' we don't want to define the same command in the pom.xml that 'package.json' already has in 'script' field, such as 'bower install' I think all changes made in 'executions' section of 'frontend-maven-plugin' are unnecessary and should be reverted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be you know better... My main goal is to make developers free from local env for start development and build. Also i wanted give easier ability newbies try zeppelin. I don't care about how to UI developers will run these scripts locally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I assume you meant "local env" -> "local env other than osx, linux". Because at least, osx, linux doesn't require any additional steps to build 'zeppelin-web' module except for just run 'mvn package'. Like i mentioned above, run 'yarn add xx' changes 'package.json', which is version controlled file. And many section in 'pom.xml' is duplicated with 'package.json'. How about find alternative way to solve the problem without touching package.json and without duplicating the feature in two different places? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Leemoonsoo, @1ambda Oh, maybe this was misunderstood. In this context I meant environment which already used UI contributors and their scripts were described in "scripts" in package.json. I Didn't want to broke their usual style of build and test. I have done this only for compatibility with their using of CLI.
Or if we want to run tests:
or if we want just create package:
Installation of yarn, bower etc. I can put in phase "post-clean". So use -Dmaven.clean.skip=true can save a lot of time for installation of nodejs, yarn and bower There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current master branch build package with
and run test with
and it does not install nodejs, yarn, bower every time, unless user run So, I'm not quite understand what you're trying to achieve here by running command from maven instead of npm script. Or what problem do you have when you run command from npm script instead of maven. Can you elaborate little more? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Leemoonsoo which box do you use? Could you give me list of preinstalled packages? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Leemoonsoo this is your words:
I have removed "postinstall" from package.json because it is triggered after each
and fail build.
from command line this also failed (duplicates for ZEPPELIN-1928) |
||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>yarn build</id> | ||
<goals> | ||
<goal>yarn</goal> | ||
</goals> | ||
<configuration> | ||
<arguments>run build</arguments> | ||
</configuration> | ||
<id>yarn karma-phantomjs-launcher</id> | ||
<goals> | ||
<goal>yarn</goal> | ||
</goals> | ||
<phase>process-test-resources</phase> | ||
<configuration> | ||
<arguments>add karma-phantomjs-launcher --no-lockfile --no-bin-links</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>bower install</id> | ||
<goals> | ||
<goal>bower</goal> | ||
</goals> | ||
<configuration> | ||
<arguments>install --silent --allow-root</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>yarn test</id> | ||
<goals> | ||
<goal>yarn</goal> | ||
</goals> | ||
<phase>test</phase> | ||
<configuration> | ||
<arguments>run test</arguments> | ||
</configuration> | ||
<id>pre-webpack-dist</id> | ||
<goals> | ||
<goal>grunt</goal> | ||
</goals> | ||
<configuration> | ||
<arguments>pre-webpack-dist</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>webpack build</id> | ||
<goals> | ||
<goal>webpack</goal> | ||
</goals> | ||
<configuration> | ||
<arguments>-p</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>post-webpack-dist</id> | ||
<goals> | ||
<goal>grunt</goal> | ||
</goals> | ||
<configuration> | ||
<arguments>post-webpack-dist</arguments> | ||
</configuration> | ||
</execution> | ||
|
||
<execution> | ||
<id>javascript tests</id> | ||
<goals> | ||
<goal>karma</goal> | ||
</goals> | ||
|
||
<phase>test</phase> | ||
<configuration> | ||
<karmaConfPath>test/karma.conf.js</karmaConfPath> | ||
</configuration> | ||
</execution> | ||
|
||
</executions> | ||
|
@@ -190,6 +265,15 @@ | |
<fileset> | ||
<directory>node_modules</directory> | ||
</fileset> | ||
<fileset> | ||
<directory>target</directory> | ||
</fileset> | ||
<fileset> | ||
<directory>dist</directory> | ||
</fileset> | ||
<fileset> | ||
<directory>.tmp</directory> | ||
</fileset> | ||
</filesets> | ||
</configuration> | ||
</plugin> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm don't think 'rimraf grunt webpack karma karma-phantomjs-launcher' are really a required package installed globally for development. Shell we remove them?
Also shell we not use 'npm-run-all' package?
After this PR, every existing developer will face error, such as
and all developer need to read README.md again and install necessary package. which is big impact compare to benefit that we can get from npm-run-all here.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DmytroShkvyra We don't need to install these packages as global. All packages installed locally (
node_modules
) can be used inscripts
tag inpackage.json
as command likegrunt
,webpack
,karma
... exceptyarn
which is executed by users directly in terminal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DmytroShkvyra
Here is doc for it - https://docs.npmjs.com/misc/scripts#path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doc reference about call script with relative path. In my opinion this is will be a problem because path delimeters are different for Linux and Windows and we should not make zeppelin is platform dependent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo
I was had to install rimraf grunt webpack karma karma-phantomjs-launcher globally for successful build
So I just changed /zeppelin/zeppelin-web/README.md to real state of things.
If you disagree with this i can revert README.md because local UI developmen out of scope ZEPPELIN-1928
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DmytroShkvyra I see. Which environment did you use when it requires install 'rimraf grunt webpack karma karma-phantomjs-launcher' globally?
Because on linux, osx,
mvn package
success without installing them globally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo Please try build project at clear box (without reinstalled nodejs and npm), and you got a lot of failures at zeppelin-web. And try my patch...