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

Yarn install deploy step takes over 9 minutes on staging! #957

Closed
1 task
sandbergja opened this issue Nov 15, 2023 · 6 comments
Closed
1 task

Yarn install deploy step takes over 9 minutes on staging! #957

sandbergja opened this issue Nov 15, 2023 · 6 comments
Assignees

Comments

@sandbergja
Copy link
Member

sandbergja commented Nov 15, 2023

Excerpt from my cap staging deploy today:

00:21 yarn:install
      01 yarn install --silent --no-progress
      01 warning "lux-design-system > [email protected]" has unmet …
      01 warning " > [email protected]" has unmet peer dependency "css-loader@…
      01 warning " > [email protected]" has unmet peer dependency "webpack@^3.…
      01 warning " > [email protected]" has unmet peer dependency "@bab…
      01 warning " > [email protected]" has unmet peer dependency "webpack@>=…
      01 warning "lux-design-system > [email protected]" has unmet …
      01 warning " > [email protected]" has unmet peer dependency "css-loader@…
      01 warning " > [email protected]" has unmet peer dependency "webpack@^3.…
      01 warning " > [email protected]" has unmet peer dependency "@bab…
      01 warning " > [email protected]" has unmet peer dependency "webpack@>=…
    ✔ 01 deploy@lib-approvals-staging2 545.325s
    ✔ 01 deploy@lib-approvals-staging1 549.197s
09:31 deploy:assets:precompile

Note that this step took over 9 minutes on both staging boxes. I re-ran this deploy, just to make sure it wasn't a fluke. It wasn't. The second deploy took 8.5 minutes on the yarn:install step.

Prod deploys in a reasonable amount of time.

Success criteria

  • Deploying to staging is reasonably fast

Implementation notes

See this information from @carolyncole.

@christinach
Copy link
Member

christinach commented Nov 16, 2023

Related issue #930

@sandbergja sandbergja self-assigned this Nov 20, 2023
@sandbergja
Copy link
Member Author

On lib-approvals-staging2, yarn quickly installs all the dependencies. However, after all directories are present in node_modules, it spends several minutes maxing out the CPU.

@sandbergja
Copy link
Member Author

sandbergja commented Nov 21, 2023

Prod could be fast because yarn install is a disk-heavy operation, and prod is on the nice new HPE Alletra storage.

@sandbergja
Copy link
Member Author

sandbergja commented Nov 22, 2023

Interestingly, npm i is much faster on these boxes: 2 minutes without a package-lock.json, 35 seconds with one. This is compared to 4 minutes for yarn install with a yarn.lock and with plenty of packages already available in /home/deploy/.cache.

@christinach
Copy link
Member

@sandbergja will replace yarn with npm.

@sandbergja
Copy link
Member Author

It seems that rails requires yarn to a very high extent, and I couldn't find a way to precompile assets without invoking yarn. It seems that yarn is a bit less required in Rails 7, but we're not there yet.

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