Skip to content
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

Migrate Che Dashboard from bower to yarn #10881

Closed
nickboldt opened this issue Aug 22, 2018 · 3 comments
Closed

Migrate Che Dashboard from bower to yarn #10881

nickboldt opened this issue Aug 22, 2018 · 3 comments
Assignees
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.

Comments

@nickboldt
Copy link
Contributor

Description

Motivation:

  • Bower is deprecated/dead
  • Bower has an https-only registry, which prevents us from building Che Dashboard on a server that's behind an http-only proxy (eg., #projectncl)
  • Yarn is better, faster, newer, maintained.

Reproduction Steps

When building behind an http-only proxy, bower install step fails like this:

    [exec] > [email protected] postinstall /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard
     [exec] > npm run bower && npm run typings && npm run build
     [exec] 
     [exec] npm info it worked if it ends with ok
     [exec] npm verb cli [ '/opt/rh/rh-nodejs6/root/usr/bin/node',
     [exec] npm verb cli   '/opt/rh/rh-nodejs6/root/usr/bin/npm',
     [exec] npm verb cli   'run',
     [exec] npm verb cli   'bower' ]
     [exec] npm info using [email protected]
     [exec] npm info using [email protected]
     [exec] 
     [exec] > [email protected] bower /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard
     [exec] > bower update
     [exec] 
     [exec] npm verb run-script [ 'prebower', 'bower', 'postbower' ]
     [exec] npm info lifecycle [email protected]~prebower: [email protected]
     [exec] npm info lifecycle [email protected]~bower: [email protected]

     [exec] bower                            retry Request to https://registry.bower.io/packages/angular-bootstrap failed with ECONNRESET, retrying in 1.5s
...
     [exec] bower jsonlint#1.6.0        ECONNRESET Request to https://registry.bower.io/packages/jsonlint failed: tunneling socket could not be established, cause=socket hang up


          [exec] 
     [exec] npm verb lifecycle [email protected]~bower: unsafe-perm in lifecycle true
     [exec] npm verb lifecycle [email protected]~bower: PATH: /opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/bin/node-gyp-bin:/tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard/node_modules/.bin:/opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/bin/node-gyp-bin:/tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard/node_modules/.bin:/opt/rh/rh-nodejs6/root/usr/bin:/opt/app-root/src/node_modules/.bin/:/opt/app-root/src/.npm-global/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
     [exec] npm verb lifecycle [email protected]~bower: CWD: /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard
     [exec] npm info lifecycle [email protected]~bower: Failed to exec bower script
     [exec] npm verb stack Error: [email protected] bower: `bower update`
     [exec] npm verb stack Exit status 1
     [exec] npm verb stack     at EventEmitter.<anonymous> (/opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
     [exec] npm verb stack     at emitTwo (events.js:106:13)
     [exec] npm verb stack     at EventEmitter.emit (events.js:191:7)
     [exec] npm verb stack     at ChildProcess.<anonymous> (/opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
     [exec] npm verb stack     at emitTwo (events.js:106:13)
     [exec] npm verb stack     at ChildProcess.emit (events.js:191:7)
     [exec] npm verb stack     at maybeClose (internal/child_process.js:920:16)
     [exec] npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
     [exec] npm verb pkgid [email protected]
     [exec] npm verb cwd /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard
     [exec] npm ERR! Linux 3.10.0-693.11.6.el7.x86_64
     [exec] npm ERR! argv "/opt/rh/rh-nodejs6/root/usr/bin/node" "/opt/rh/rh-nodejs6/root/usr/bin/npm" "run" "bower"
     [exec] npm ERR! node v6.11.3
     [exec] npm ERR! npm  v3.10.9
     [exec] npm ERR! code ELIFECYCLE
     [exec] npm ERR! [email protected] bower: `bower update`
     [exec] npm ERR! Exit status 1
     [exec] npm ERR! 
     [exec] npm ERR! Failed at the [email protected] bower script 'bower update'.
     [exec] npm ERR! Make sure you have the latest version of node.js and npm installed.
     [exec] npm ERR! If you do, this is most likely a problem with the che-dashboard package,
     [exec] npm ERR! not with npm itself.
     [exec] npm ERR! Tell the author that this fails on your system:
     [exec] npm ERR!     bower update
     [exec] npm ERR! You can get information on how to open an issue for this project with:
     [exec] npm ERR!     npm bugs che-dashboard
     [exec] npm ERR! Or if that isn't available, you can get their info via:
     [exec] npm ERR!     npm owner ls che-dashboard
     [exec] npm ERR! There is likely additional logging output above.
     [exec] npm verb exit [ 1, true ]
     [exec] 
     [exec] npm ERR! Please include the following file with any support request:
     [exec] npm ERR!     /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard/npm-debug.log
     [exec] 
     [exec] npm verb lifecycle [email protected]~postinstall: unsafe-perm in lifecycle true
     [exec] npm verb lifecycle [email protected]~postinstall: PATH: /opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/bin/node-gyp-bin:/tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard/node_modules/.bin:/opt/rh/rh-nodejs6/root/usr/bin:/opt/app-root/src/node_modules/.bin/:/opt/app-root/src/.npm-global/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
     [exec] npm verb lifecycle [email protected]~postinstall: CWD: /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard
     [exec] npm info lifecycle [email protected]~postinstall: Failed to exec postinstall script
     [exec] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
     [exec] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
     [exec] npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
     [exec] npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
     [exec] npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
     [exec] npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
     [exec] npm verb stack Error: [email protected] postinstall: `npm run bower && npm run typings && npm run build`
     [exec] npm verb stack Exit status 1
     [exec] npm verb stack     at EventEmitter.<anonymous> (/opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
     [exec] npm verb stack     at emitTwo (events.js:106:13)
     [exec] npm verb stack     at EventEmitter.emit (events.js:191:7)
     [exec] npm verb stack     at ChildProcess.<anonymous> (/opt/rh/rh-nodejs6/root/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
     [exec] npm verb stack     at emitTwo (events.js:106:13)
     [exec] npm verb stack     at ChildProcess.emit (events.js:191:7)
     [exec] npm verb stack     at maybeClose (internal/child_process.js:920:16)
     [exec] npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
     [exec] npm verb pkgid [email protected]
     [exec] npm verb cwd /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard
     [exec] npm ERR! Linux 3.10.0-693.11.6.el7.x86_64
     [exec] npm ERR! argv "/opt/rh/rh-nodejs6/root/usr/bin/node" "/opt/rh/rh-nodejs6/root/usr/bin/npm" "install"
     [exec] npm ERR! node v6.11.3
     [exec] npm ERR! npm  v3.10.9
     [exec] npm ERR! code ELIFECYCLE
     [exec] npm ERR! [email protected] postinstall: `npm run bower && npm run typings && npm run build`
     [exec] npm ERR! Exit status 1
     [exec] npm ERR! 
     [exec] npm ERR! Failed at the [email protected] postinstall script 'npm run bower && npm run typings && npm run build'.
     [exec] npm ERR! Make sure you have the latest version of node.js and npm installed.
     [exec] npm ERR! If you do, this is most likely a problem with the che-dashboard package,
     [exec] npm ERR! not with npm itself.
     [exec] npm ERR! Tell the author that this fails on your system:
     [exec] npm ERR!     npm run bower && npm run typings && npm run build
     [exec] npm ERR! You can get information on how to open an issue for this project with:
     [exec] npm ERR!     npm bugs che-dashboard
     [exec] npm ERR! Or if that isn't available, you can get their info via:
     [exec] npm ERR!     npm owner ls che-dashboard
     [exec] npm ERR! There is likely additional logging output above.
     [exec] npm verb exit [ 1, true ]
     [exec] 
     [exec] npm ERR! Please include the following file with any support request:
     [exec] npm ERR!     /tmp/eclipse-che-6.9-phantomjs-2.1.1-from-mirror/dashboard/npm-debug.log
23:46:04 [INFO] ------------------------------------------------------------------------

OS and version:

+ cd eclipse-che-6.9-phantomjs-2.1.1-from-mirror
+ git reset --hard 6.9.0.t20180821-181807-877-redhat-00001
HEAD is now at 9242a22 Repour
+ uname -a
Linux pnc-ba-pod-7ca88b 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
+ go version
go version go1.9.4 linux/amd64
+ node -v
v6.11.3
+ npm version
{ npm: '3.10.9',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '58.2',
  modules: '48',
  node: '6.11.3',
  openssl: '1.0.1e-fips',
  uv: '1.9.1',
  v8: '5.1.281.107',
  zlib: '1.2.7' }
+ mvn -v
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Maven home: /usr/share/maven
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-693.11.6.el7.x86_64", arch: "amd64", family: "unix"
+ nodeDownloadRoot=http://nodejs.org:80/dist/
+ npmDownloadRoot=http://registry.npmjs.org:80/npm/-/
+ npmRegistryURL=http://registry.npmjs.org:80/

Diagnostics:

Having done a cursory attempt to migrate from bower to yarn using bower-away, I get this error:

$➔ yarn
yarn install v1.9.4
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
error Couldn't find package "gulp@^3.9.0" required by "@bower_components/angular-file-upload@nervgh/angular-file-upload#2.0.0" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "webpack-stream@^2.0.0" required by "@bower_components/angular-file-upload@nervgh/angular-file-upload#2.0.0" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/lib/node_modules/yarn/lib/cli.js:243:66)
    at new MessageError (/usr/lib/node_modules/yarn/lib/cli.js:272:123)
    at PackageRequest.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:38988:17)
    at Generator.throw (<anonymous>)
    at step (/usr/lib/node_modules/yarn/lib/cli.js:92:30)
    at /usr/lib/node_modules/yarn/lib/cli.js:105:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Error: Couldn't find package "webpack@^1.10.1" required by "@bower_components/angular-file-upload@nervgh/angular-file-upload#2.0.0" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/lib/node_modules/yarn/lib/cli.js:243:66)
    at new MessageError (/usr/lib/node_modules/yarn/lib/cli.js:272:123)
    at PackageRequest.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:38988:17)
    at Generator.throw (<anonymous>)
    at step (/usr/lib/node_modules/yarn/lib/cli.js:92:30)
    at /usr/lib/node_modules/yarn/lib/cli.js:105:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

So I'm wondering if we also need to migrate angular-file-upload@2.0.0 to something newer, like this example ?

If so, affected files are:

https://github.com/eclipse/che/tree/master/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.controller.ts
https://github.com/eclipse/che/tree/master/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.html

@ashumilova
Copy link
Contributor

It's used on factory creation, when you go to config tab. We could try to replace uploading by input for factory config.
And thus avoid that old library usage.

screenshot from 2018-08-22 17-31-08

nickboldt added a commit to nickboldt/che that referenced this issue Aug 22, 2018
Change-Id: Ic93a1191bcb25fdc564b481bc5c5877fc233a617
Signed-off-by: nickboldt <[email protected]>
nickboldt added a commit to nickboldt/che that referenced this issue Aug 23, 2018
move devDeps to prod deps; migrate to bootstrap-styl (replaces bootstrap-stylus); make mvn clean delete yarn.lock; remove ref to tty.isatty

Change-Id: Ic93a1191bcb25fdc564b481bc5c5877fc233a617
Signed-off-by: nickboldt <[email protected]>
@ghost ghost added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Aug 31, 2018
nickboldt added a commit to nickboldt/che that referenced this issue Sep 18, 2018
… dashboard to a separate file, so we can build Che Server w/o dashboard (until Bower -> Yarn migration done)

Change-Id: I2a035e8e0e1ca18fa9e2b65d512270b3e9939eb8
Signed-off-by: nickboldt <[email protected]>
@nickboldt
Copy link
Contributor Author

nickboldt commented Sep 18, 2018

Pull request to optionally remove the dashboard from root pom reactor, and from assembly-main:

#11271

This will let me continue the Che build in NCL, which is currently failing if I simply comment out the dashboard. I still can't build the dashboard because of bower dependency.

@slemeur
Copy link
Contributor

slemeur commented Sep 20, 2018

What is the status of this work? cc @ashumilova and @olexii4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

No branches or pull requests

4 participants