OSC / ood-fileexplorer

[MOVED] The Open OnDemand File Explorer
https://osc.github.io/Open-OnDemand/
MIT License
4 stars 1 forks source link

[WIP] Merge cloudcmd #180

Closed ericfranz closed 5 years ago

ericfranz commented 6 years ago

Opening PR for discussion

ericfranz commented 6 years ago

So I did these steps on webtest04:

  1. git clone files app and cd to that directory
  2. npm install # took 1m27.124s
  3. node_modules/yarn/bin/yarn install # took 4m25.460s.
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ du -hcs lib/cloudcmd/node_modules
12M lib/cloudcmd/node_modules
12M total
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ du -hcs node_modules
402M    node_modules
402M    total

Versus the currently installed version:

efranz@webtest04:/var/www/ood/apps/sys/files$ du -hcs node_modules
97M node_modules
97M total

So it would seem that installing yarn is not ideal.

Can we get by with reverting the yarn commit, and then deleting the package.json in the cloudcmd repo and updating the dependencies in package.json with cloudcmd dependencies?

For example:

  "dependencies": {
    "archiver": "^1.0.0",
    "base-uri": "^1.0.1",
    "cloudcmd": "git://github.com/OSC/cloudcmd.git#v5.3.1-osc.29",
    "dotenv": "^4.0.0",
    "express": "^4.13.4",
    "git-rev-sync": "^1.8.0",
    "os-homedir": "^1.0.1",
    "socket.io": "^1.4.5"
  },

would change to

  "dependencies": {
    "archiver": "^1.0.0",
    "base-uri": "^1.0.1",
-   "cloudcmd": "git://github.com/OSC/cloudcmd.git#v5.3.1-osc.29",
+
    "dotenv": "^4.0.0",
    "express": "^4.13.4",
    "git-rev-sync": "^1.8.0",
    "os-homedir": "^1.0.1",
    "socket.io": "^1.4.5"
  },

Oh I guess the test I did with yarn did not install only with production dependencies, so it maybe included devDependencies. Trying a new approach.

ericfranz commented 6 years ago
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ time npm install --production --prefix tmp yarn
/users/PZS0562/efranz/awesim/dev/files/tmp
└── yarn@1.12.1

npm WARN enoent ENOENT: no such file or directory, open '/users/PZS0562/efranz/awesim/dev/files/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.

real    0m1.168s
user    0m0.988s
sys 0m0.134s
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ time tmp/node_modules/yarn/bin/yarn --production install
yarn install v1.12.1
warning npm-shrinkwrap.json found. This will not be updated or respected. See https://yarnpkg.com/en/docs/migrating-from-npm for more information.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 37.55s.

real    0m38.195s
user    0m7.885s
sys 0m4.641s
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ du -hcs lib/cloudcmd/node_modules
13M lib/cloudcmd/node_modules
13M total
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ du -hcs node_modules
78M node_modules
78M total
efranz@webtest04:~/awesim/dev/files (merge_cloudcmd)$ du -hcs --exclude=tmp --exclude=.git
98M .
98M total

That is promising. But will this run?

ericfranz commented 6 years ago

Yes it does! And if we want, we could delete the temporary created production yarn. The total time to install production yarn and production files app was 0m1.168s + 0m38.195s. And the resulting file size looks good. This is actually wonderful.

ericfranz commented 6 years ago

So now that we have this, we want to think about redo-ing the import to preserve part of the history. I don't think the cloudcmd history from the beginning of time is relevant, but from the time of the initial fork from cloudcmd upstream.

ericfranz commented 6 years ago

That is something I can do.

ericfranz commented 5 years ago

@AriettaZ change of plans. Will you update the README with new build instructions?

First the correct SCL package is the newer rh-nodejs6. Second we now will do these steps:

npm install --production --prefix tmp yarn
tmp/node_modules/yarn/bin/yarn --production install

And update the change log with the two big changes here:

  1. integrating cloud commander repo with the history of our modifications since v5.3.1
  2. using yarn to build (because we can use the workspaces feature of yarn)