Skip to content

Conversation

@marc-hb
Copy link
Contributor

@marc-hb marc-hb commented May 22, 2023

The ability to make a one-line .rst change and quickly regenerate the docs has been broken at least three times in the past: #13159, #36033 and #57624. Add a small, final check to make sure this can't happen again.

@marc-hb marc-hb force-pushed the time-doc-build branch 5 times, most recently from e62669d to 80567e3 Compare May 23, 2023 06:33
The ability to make a one-line .rst change and quickly regenerate the
docs has been broken at least three times in the past: zephyrproject-rtos#13159, zephyrproject-rtos#36033
and zephyrproject-rtos#57624. Add a small, final check to make sure this can't happen
again.

Signed-off-by: Marc Herbert <[email protected]>
Comment on lines +117 to +126
# Keep this last not to break upload and other "functional" tests above.
- name: time-incremental-build
if: github.event_name == 'pull_request'
run: |
# Catch major incremental build time regressions like the ones
# fixed by commits 52842317505f, a140a249b33b and 9d119431945f.
sed -i -e 's/Zephyr /Xephyr /' doc/index.rst # make a small .rst change
export DOC_TAG=development SPHINXOPTS='-j auto -t publish' # as above
time timeout 35 make -C doc/ html-fast # ${DOC_TARGET} as above
git checkout HEAD -- doc/index.rst # restore to be safe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need to add such hacks in CI. If something breaks, one can open an issue. GH actions also support timeouts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion on what to do here; though, given that there were multiple changes in the past that resulted in increased incremental build time and that seems to be a recurring problem, I can see this being useful in catching problems like that before they get merged; moreover, at most, it only adds 35 seconds to the workflow run time.

Copy link
Contributor Author

@marc-hb marc-hb May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need to add such hacks in CI. If something breaks, one can open an issue.

The purpose of CI is to catch regressions when they happen. It took me a day to isolate the numfig regression, long after it was merged. I don't make doc changes every day, very far from it.

Few people contribute to documentation at all and from past experience it seems many of them don't notice how slow the incremental build becomes; they just assume that "building documentation is very slow" - which I think makes even fewer people contribute to documentation.

GH actions also support timeouts.

I will take a look, thanks. See comments below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Re: GH Actions, it's not clear if this would allow to set a timeout of less than a minute https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would not want to use the timeout-minutes here since that is supposed to be the last resort when something gets stuck, which is not the case here. We want the job result to be "failed" (i.e. not "timeout") when incremental build takes too long.

# fixed by commits 52842317505f, a140a249b33b and 9d119431945f.
sed -i -e 's/Zephyr /Xephyr /' doc/index.rst # make a small .rst change
export DOC_TAG=development SPHINXOPTS='-j auto -t publish' # as above
time timeout 35 make -C doc/ html-fast # ${DOC_TARGET} as above
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to be explicit about the timeout units.

Suggested change
time timeout 35 make -C doc/ html-fast # ${DOC_TARGET} as above
time timeout 35s make -C doc/ html-fast # ${DOC_TARGET} as above

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Sep 18, 2023
@Thalley Thalley removed the request for review from mbolivar-nordic September 18, 2023 07:55
@github-actions github-actions bot removed the Stale label Sep 19, 2023
@Thalley Thalley removed their request for review September 19, 2023 07:38
@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Nov 19, 2023
@github-actions github-actions bot closed this Dec 4, 2023
@marc-hb
Copy link
Contributor Author

marc-hb commented Jun 4, 2024

I started making some doc changes again and the incremental, zero-change, hot cache build is now over 30 seconds on my server system with 72 cores and 300G of RAM.

I don't know why: time seems to be spent a little bit everywhere now.

So this PR was really a lost cause.

There's probably an equivalent to Zawinkski's "Law of Software Envelopment" but for documentation builds.

@kartben
Copy link
Contributor

kartben commented Jun 4, 2024

@marc-hb #73671 should be a significant improvement -- while still a draft, it's complete enough that you might want to give it a spin and provide feedback. Thanks!

@marc-hb
Copy link
Contributor Author

marc-hb commented Jun 4, 2024

Interesting, thanks!

I once tried to debug an incremental build issue in Breathe and I had to stop for mental health reasons so for sure I won't miss breathe:

I see your PR 73671 brags about a 3 minutes build time from scratch which seems very impressive! However I don't see yet any claim about incremental build times which is what I believe people use most of the time (or at least should) and also what this PR was about.

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.

6 participants