aurora-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McLaughlin <da...@dmclaughlin.com>
Subject Re: Review Request 61864: Bootstrap the build pipeline for new Preact UI.
Date Thu, 24 Aug 2017 17:44:15 GMT


> On Aug. 24, 2017, 5:30 p.m., Kai Huang wrote:
> > build.gradle
> > Lines 140 (patched)
> > <https://reviews.apache.org/r/61864/diff/2/?file=1802780#file1802780line140>
> >
> >     I ran into some build issues when I ran ./gradlew build command from my laptop
(MacOS).
> >     
> >     The build log says:
> >     ```
> >     kaih@tw-mbp-kaih aurora (ui)*$ ./gradlew build
> >     ......
> >     npm WARN react-router-dom@4.2.0 requires a peer of react@>=15 but none was
installed.
> >     npm WARN react-router@4.2.0 requires a peer of react@>=15 but none was installed.
> >     npm ERR! Darwin 16.7.0
> >     npm ERR! argv "/Users/kaih/workspace/aurora/ui/.gradle/nodejs/node-v6.9.1-darwin-x64/bin/node"
"/Users/kaih/workspace/aurora/ui/.gradle/nodejs/node-v6.9.1-darwin-x64/bin/npm" "install"
> >     npm ERR! node v6.9.1
> >     npm ERR! npm  v3.10.8
> >     npm ERR! code ELIFECYCLE
> >     
> >     npm ERR! preact@8.2.2 postinstall: `node ./config/donation-message.js`
> >     npm ERR! Exit status 1
> >     npm ERR!
> >     npm ERR! Failed at the preact@8.2.2 postinstall script 'node ./config/donation-message.js'.
> >     npm ERR! Make sure you have the latest version of node.js and npm installed.
> >     npm ERR! If you do, this is most likely a problem with the preact package,
> >     npm ERR! not with npm itself.
> >     npm ERR! Tell the author that this fails on your system:
> >     npm ERR!     node ./config/donation-message.js
> >     npm ERR! You can get information on how to open an issue for this project with:
> >     npm ERR!     npm bugs preact
> >     npm ERR! Or if that isn't available, you can get their info via:
> >     npm ERR!     npm owner ls preact
> >     npm ERR! There is likely additional logging output above.
> >     
> >     npm ERR! Please include the following file with any support request:
> >     npm ERR!     /Users/kaih/workspace/aurora/ui/npm-debug.log
> >     :ui:install FAILED
> >     
> >     FAILURE: Build failed with an exception.
> >     
> >     * What went wrong:
> >     Execution failed for task ':ui:install'.
> >     > Process 'command '/Users/kaih/workspace/aurora/ui/.gradle/nodejs/node-v6.9.1-darwin-x64/bin/npm''
finished with non-zero exit value 1
> >     
> >     * Try:
> >     Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
> >     
> >     BUILD FAILED
> >     
> >     Total time: 2 mins 8.144 secs
> >     ```
> >     
> >     The pre-installed node and npm versions on my laptop are:
> >     ```
> >     [10:10 AM] Kai Huang:
> >         kaih@tw-mbp-kaih aurora (ui)*$ node -v
> >         v6.10.2
> >         kaih@tw-mbp-kaih aurora (ui)*$ npm -v
> >         3.10.10
> >     ```
> >     
> >     The npm-debug.log says:
> >     ```
> >     [10:10 AM] Kai Huang: The gradle build says:
> >     [10:11 AM] Kai Huang:
> >         87950 error node v6.9.1
> >         87951 error npm  v3.10.8
> >         87952 error code ELIFECYCLE
> >         87953 error preact@8.2.2 postinstall: `node ./config/donation-message.js`
> >         87953 error Exit status 1
> >         87954 error Failed at the preact@8.2.2 postinstall script 'node ./config/donation-message.js'.
> >         87954 error Make sure you have the latest version of node.js and npm installed.
> >         87954 error If you do, this is most likely a problem with the preact package,
> >         87954 error not with npm itself.
> >     ```
> >     
> >     
> >     The `aurorabuild all` command also fails in a vagrant box(Ubuntu).
> >     ```
> >     vagrant@aurora:~$ aurorabuild all
> >     sending incremental file list
> >     deleting ui/npm-debug.log
> >     ......
> >     :ui:nodeSetup UP-TO-DATE
> >     :ui:npmSetup SKIPPED
> >     :ui:install
> >     
> >     > preact@8.2.2 postinstall /home/vagrant/aurora/ui/node_modules/preact
> >     > node ./config/donation-message.js
> >     
> >     module.js:471
> >         throw err;
> >         ^
> >     
> >     Error: Cannot find module '/home/vagrant/aurora/ui/node_modules/preact/config/donation-message.js'
> >         at Function.Module._resolveFilename (module.js:469:15)
> >         at Function.Module._load (module.js:417:25)
> >         at Module.runMain (module.js:604:10)
> >         at run (bootstrap_node.js:394:7)
> >         at startup (bootstrap_node.js:149:9)
> >         at bootstrap_node.js:509:3
> >     npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
> >     npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2:
wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
> >     npm WARN react-router@4.2.0 requires a peer of react@>=15 but none was installed.
> >     npm WARN react-router-dom@4.2.0 requires a peer of react@>=15 but none was
installed.
> >     npm ERR! Linux 3.13.0-116-generic
> >     npm ERR! argv "/home/vagrant/aurora/ui/.gradle/nodejs/node-v6.9.1-linux-x64/bin/node"
"/home/vagrant/aurora/ui/.gradle/nodejs/node-v6.9.1-linux-x64/bin/npm" "install"
> >     npm ERR! node v6.9.1
> >     npm ERR! npm  v3.10.8
> >     npm ERR! code ELIFECYCLE
> >     
> >     npm ERR! preact@8.2.2 postinstall: `node ./config/donation-message.js`
> >     npm ERR! Exit status 1
> >     npm ERR!
> >     npm ERR! Failed at the preact@8.2.2 postinstall script 'node ./config/donation-message.js'.
> >     npm ERR! Make sure you have the latest version of node.js and npm installed.
> >     npm ERR! If you do, this is most likely a problem with the preact package,
> >     npm ERR! not with npm itself.
> >     npm ERR! Tell the author that this fails on your system:
> >     npm ERR!     node ./config/donation-message.js
> >     npm ERR! You can get information on how to open an issue for this project with:
> >     npm ERR!     npm bugs preact
> >     npm ERR! Or if that isn't available, you can get their info via:
> >     npm ERR!     npm owner ls preact
> >     npm ERR! There is likely additional logging output above.
> >     
> >     npm ERR! Please include the following file with any support request:
> >     npm ERR!     /home/vagrant/aurora/ui/npm-debug.log
> >     :ui:install FAILED
> >     
> >     FAILURE: Build failed with an exception.
> >     
> >     * What went wrong:
> >     Execution failed for task ':ui:install'.
> >     > Process 'command '/home/vagrant/aurora/ui/.gradle/nodejs/node-v6.9.1-linux-x64/bin/npm''
finished with non-zero exit value 1
> >     
> >     * Try:
> >     Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
> >     
> >     BUILD FAILED
> >     
> >     Total time: 8.418 secs
> >     ```

Because of how npm works by default, we're not pinning to explicit releases. So when I submitted
this patch it was Preact 8.2.1. When you ran it, it downloaded 8.2.2 - and that was a bad
release they pushed https://github.com/developit/preact/issues/834. I guess that's the difference
between React and Preact :) But they also just pushed a fix for 8.2.3, so it should work now.


I'm happy to remove the semantic versioning from our package.json file - in practice I've
ran into these problems a lot, with very little gain.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/61864/#review183750
-----------------------------------------------------------


On Aug. 23, 2017, 11:53 p.m., David McLaughlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61864/
> -----------------------------------------------------------
> 
> (Updated Aug. 23, 2017, 11:53 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen, Kai Huang, Santhosh Kumar Shanmugham, and Stephan
Erb.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Bootstrap the build pipeline for new Preact UI. Obviously due to the disappointing decision
by Facebook to keep their PATENTS clause, we can no longer use React or jest or any of the
other Facebook OSS projects. Thankfully Preact has a compatibility layer that mostly hides
this (see code), so it's really only jest (which is so much simpler than Karma) that is missed
here. 
> 
> Right now we only insert a "Hello, World" message under a new path in the Scheduler.
The goal here is to verify that this works in the Apache infrastructure, and that people can
download the patch and confirm their local development environment is built correctly by gradle.
Will be particularly useful if you don't have any of the modern Node/UI stack installed, because
the idea is that Gradle will do it all for you.
> 
> Note: this will add time, perhaps significant time, to the Scheduler build process the
first time it sets up the environment. I've made sure to set up input/output directories in
Gradle to make sure the UP-TO-DATE mechanism is respected and the work isn't repeated. 
> 
> The following tasks become available:
> 
> ./gradlew ui:install (runs npm install and fetches 3rd party JS dependencies)
> ./gradlew ui:webpack (the main build step - performed by webpack)
> ./gradlew ui:test (runs Karma-Jasmine-Webpack-Chai powered test suite) 
> ./gradlew ui:lint (runs eslint on the source code)
> 
> And all of these are now performed as part of the root ./gradlew build step. This also
maintains feature parity with ./gradlew processResources --continuous. 
> 
> This is the first time I've ever really had to do significant changes to our Gradle build,
so any feedback on my changes there are particularly appreciated.
> 
> 
> Diffs
> -----
> 
>   .gitignore b4e2bcbef6fdb1c049acda7c4fda4bd47988bea2 
>   build.gradle c2c402f3ed0043b1e9befb6f9c4423649ee5c105 
>   settings.gradle b097e2fd958fa0ce6076fc104eb3890c4029295d 
>   src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java f7e72e77e50680d937d727cb4c0eb8940aabf03b

>   src/main/resources/scheduler/assets/scheduler/new-index.html PRE-CREATION 
>   ui/.babelrc PRE-CREATION 
>   ui/.eslintrc PRE-CREATION 
>   ui/karma.conf.js PRE-CREATION 
>   ui/package.json PRE-CREATION 
>   ui/src/main/js/components/Home.js PRE-CREATION 
>   ui/src/main/js/components/__tests__/Home-test.js PRE-CREATION 
>   ui/src/main/js/index.js PRE-CREATION 
>   ui/webpack.config.js PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/61864/diff/2/
> 
> 
> Testing
> -------
> 
> The Scheduler is running in my Vagrant image with the Hello World message served under
/beta.
> 
> 
> Thanks,
> 
> David McLaughlin
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message