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

Store node_modules, static outside the repo #140

Open
natefoo opened this issue Jun 7, 2018 · 4 comments
Open

Store node_modules, static outside the repo #140

natefoo opened this issue Jun 7, 2018 · 4 comments

Comments

@natefoo
Copy link
Member

natefoo commented Jun 7, 2018

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, 0701dcc) and it looks like we will be getting rid of built artifacts in stable branches before long.

@natefoo
Copy link
Member Author

natefoo commented Oct 25, 2019

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.

@dannon
Copy link
Member

dannon commented Oct 25, 2019

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.

@natefoo
Copy link
Member Author

natefoo commented Oct 25, 2019

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

@dannon
Copy link
Member

dannon commented Oct 25, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants