usegalaxy-playbook icon indicating copy to clipboard operation
usegalaxy-playbook copied to clipboard

Store node_modules, static outside the repo

Open natefoo opened this issue 7 years ago • 4 comments

Because the client build process modifies the repository, when we update we perform a forced update with Ansible's git module that restores the repo to its pristine unmodified version. This means that client/node_modules is removed every time, and every time it is recreated for the client build. This process is excruciatingly slow.

If at all possible, it would be great if client/node_modules/, and the rest of the built objects (e.g. static/) could be stored outside the repo.

Especially relevant as we need to run yarn even on stable branches (galaxyproject/galaxy#6297, 0701dcc565b5936d99d03337448a49b9eca6137e) and it looks like we will be getting rid of built artifacts in stable branches before long.

natefoo avatar Jun 07 '18 17:06 natefoo

We don't (normally) force anymore so this is less of an issue, however I'm testing removing node_modules since yarn caches anyway. This is a reminder for myself to also remove config/plugins/*/node_modules before publishing.

natefoo avatar Oct 25 '19 20:10 natefoo

I didn't know there was an issue here for this, though I know we talked about it directly and I tried to get this working. Beyond particular expected paths needing updates in the Galaxy codebase, which we can fix, I had a lot of trouble getting just yarn's package scripts work as expected. My notes were:

Yarn's --modules-folder works for installation at a specific path IFF you also set the NODE_PATH env var, otherwise some dependencies will fail to build.

Actually calling the package scripts for the various tasks is another issue. Node seems to make a lot of assumptions about where dependencies will be, and using .yarnrc to define this location doesn't change anything; when actually building executables will fail to be resolved, etc.

What might work is to stage elsewhere and create a symlink to make it all think it's working like it's supposed to.

dannon avatar Oct 25 '19 20:10 dannon

D'oh, thanks for looking in to it and the update. Hopefully nuking node_modules will be good enough.

natefoo avatar Oct 25 '19 20:10 natefoo

Yeah, it should be totally fine to delete those contents after successful builds as a part of the update procedure.

dannon avatar Oct 25 '19 20:10 dannon