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

Use yarn-deduplicate instead of cleaning #5775

Merged
merged 1 commit into from
Apr 25, 2019

Conversation

vidartf
Copy link
Member

@vidartf vidartf commented Dec 17, 2018

Speed up lab build by using yarn-deduplicate instead of cleaning out yarn lock every build.

Question: There were previously two cleaning steps involved, the pre_clean and the explicit removal of a yarn lock file in staging. The PR changes the default of pre_clean to False, and removes the yarn lock clean step. While the yarn lock step should now be safe, some care should be taken to ensure that changing the pre_clean default doesn't surface any other issues.

@vidartf
Copy link
Member Author

vidartf commented Dec 17, 2018

Note on performance: Quick informal tests locally on my Windows machine indicate that this change brings the yarn time on rebuilds down from 30-50 s to 1-6 s. The webpack build time is unaffected.

@vidartf
Copy link
Member Author

vidartf commented Dec 17, 2018

PS: This should be doubled checked against previous issues: #4543 and #3827.

@bollwyvl
Copy link
Contributor

bollwyvl commented Dec 18, 2018 via email

@vidartf
Copy link
Member Author

vidartf commented Dec 18, 2018

@bollwyvl There's definitely more than can be done for improving build times (I'm exploring some things for webpack), and I'd be happy to discuss that in more detail. That said, if you want to write up your current thoughts in a new issue, I think that would be a lot cleaner. I don't want this PR to become an omnibus for all optimizations ;)

@vidartf
Copy link
Member Author

vidartf commented Dec 18, 2018

@blink1073 The CI failures are relevant: It fails when trying to do yarn install in <root>\node_modules\@jupyterlab\application-top, as there is no yarn.lock there. Any clues about what is going on? 😕

@blink1073
Copy link
Member

Hmm, the issue is that there is no yarn.lock in the dev_mode folder. I think we instead need to insert the post install script as part of this script: https://github.com/jupyterlab/jupyterlab/blob/master/buildutils/src/update-core-mode.ts

@vidartf
Copy link
Member Author

vidartf commented Jan 28, 2019

@blink1073 I've just gotten back from a break. From what I understand, you are saying that:

  • yarn-deduplicate yarn.lock should be added to the update-core-mode script. (between jlpm and jlpm run build:prod ?)
  • The postinstall script should be removed from the dev_mode and/or staging package.json file(s). If so, which one(s)?

@vidartf
Copy link
Member Author

vidartf commented Jan 28, 2019

Or would it maybe be enough to remove this line?

@blink1073
Copy link
Member

Yeah, I think removing that line should be sufficient.

@vidartf vidartf force-pushed the yarn-opt branch 2 times, most recently from c1e590b to 9b8ecfe Compare February 8, 2019 15:55
@vidartf
Copy link
Member Author

vidartf commented Feb 8, 2019

After having thought a bit more about this, I think the current pattern should be a lot better. Again, this should be tested manually against some known previous problem case.

@jasongrout
Copy link
Contributor

I think the current pattern should be a lot better

Do you mean this PR should be better than the current codebase, or that the current codebase should be better than this PR?

@vidartf
Copy link
Member Author

vidartf commented Feb 11, 2019

I mean, the current design in this PR is better than the first attempt made in this PR.

@blink1073
Copy link
Member

@vidartf, I don't know of a good way to replicate the original error we saw. I say we try this in a pre-release in the wild and see if any problems arise. The PR needs a rebase though...

@jasongrout jasongrout changed the title Use yarn-deduplicate instead of cleaning [WIP] Use yarn-deduplicate instead of cleaning Apr 22, 2019
@jasongrout
Copy link
Contributor

Adding [WIP] since it needs a rebase. Whoever does a rebase, please remove [WIP] from the title when done.

Use yarn-deduplicate instead of cleaning out yarn lock every build.
@vidartf vidartf changed the title [WIP] Use yarn-deduplicate instead of cleaning Use yarn-deduplicate instead of cleaning Apr 25, 2019
@vidartf
Copy link
Member Author

vidartf commented Apr 25, 2019

All green 🍀

@blink1073
Copy link
Member

Thanks!

@blink1073 blink1073 merged commit f40af6c into jupyterlab:master Apr 25, 2019
@vidartf vidartf deleted the yarn-opt branch April 25, 2019 17:34
@bollwyvl bollwyvl mentioned this pull request May 2, 2019
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants