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

Option to make docs build in parallel #1803

Merged
merged 4 commits into from Nov 8, 2021

Conversation

isaacgsmith
Copy link
Member

@isaacgsmith isaacgsmith commented Sep 27, 2021

Description
See https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-j

Now, make html allows a CORES argument to let you build the documentation in parallel. In the GitHub pipelines, we use CORES=auto which makes the documentation build with all available cores.

Motivation and context

The documentation build is very slow.

How has this been tested?

  • Testing pipeline.
  • Other.
    Documentation built locally and on GitHub.

Examples

Compare https://github.com/tardis-sn/tardis/actions/runs/1381526801 with https://github.com/smithis7/tardis/actions/runs/1387845143.

See the note: https://smithis7.github.io/tardis/branch/speed_up_doc/development/documentation_guidelines.html

Type of change

  • Bug fix.
  • New feature.
  • Breaking change.
  • None of the above.

Checklist

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • (optional) I have built the documentation on my fork following the instructions.
  • I have assigned and requested two reviewers for this pull request.

@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

2 similar comments
@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #1803 (3755d75) into master (60e044e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1803   +/-   ##
=======================================
  Coverage   58.22%   58.22%           
=======================================
  Files          66       66           
  Lines        6722     6722           
=======================================
  Hits         3914     3914           
  Misses       2808     2808           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60e044e...3755d75. Read the comment docs.

@epassaro
Copy link
Member

Hi @smithis7, sorry for not reviewing this lately.

I think make allows you to do something like this:

  1. Read a variable from the shell environment
  2. If that variable is not set, use a default value

That variable could be called N_SPHINX_JOBS or something like that, and stored in .bashrc or any shell configuration file. In this way, users are not forced to use all their cores to build the documentation.

What do you think? @jaladh-singhal @wkerzendorf

@isaacgsmith
Copy link
Member Author

isaacgsmith commented Oct 26, 2021

Hi @smithis7, sorry for not reviewing this lately.

I think make allows you to do something like this:

  1. Read a variable from the shell environment
  2. If that variable is not set, use a default value

That variable could be called N_SPHINX_JOBS or something like that, and stored in .bashrc or any shell configuration file. In this way, users are not forced to use all their cores to build the documentation.

What do you think? @jaladh-singhal @wkerzendorf

We can see what they think -- I feel like in general though, people building the documentation locally would like it to be built fast and are not as concerned about their cores for the 10-15 minutes that the build is occurring. If someone is really concerned about their cores, they are always able to type in the full sphinx command sphinx-build -b html -d _build/doctrees . _build/html.

@isaacgsmith isaacgsmith changed the title Making docs build in parallel Option to make docs build in parallel Oct 26, 2021
@andrewfullard andrewfullard requested review from jaladh-singhal and andrewfullard and removed request for epassaro November 2, 2021 17:08
@epassaro
Copy link
Member

epassaro commented Nov 7, 2021

@smithis7 Can you post the result of runs with cores 1 and auto and check if the difference is noticeable?

@isaacgsmith
Copy link
Member Author

isaacgsmith commented Nov 8, 2021

@epassaro Two recent builds:
https://github.com/tardis-sn/tardis/runs/4142758941?check_suite_focus=true
and
https://github.com/smithis7/tardis/runs/4142812289?check_suite_focus=true

CORES=auto takes roughly 4:30 off the build step. It does even more locally.

Additionally, this difference will become greater as we add more notebooks.

@epassaro
Copy link
Member

epassaro commented Nov 8, 2021

@epassaro Two recent builds: https://github.com/tardis-sn/tardis/runs/4142758941?check_suite_focus=true and https://github.com/smithis7/tardis/runs/4142812289?check_suite_focus=true

CORES=auto takes roughly 4:30 off the build step. It does even more locally.

Additionally, this difference will become greater as we add more notebooks.

I see, great work!

I've implemented caching the conda env in carsus pipelines, that should cut other ~3 mins.

@epassaro epassaro self-requested a review November 8, 2021 19:30
@isaacgsmith isaacgsmith merged commit 7553744 into tardis-sn:master Nov 8, 2021
@isaacgsmith isaacgsmith deleted the speed_up_doc branch November 8, 2021 20:00
@isaacgsmith isaacgsmith mentioned this pull request May 3, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants