Skip to content

ReadTheDocs PR builds are failing #8227

Closed

Description

@charlesbluca

Looks like we're getting timeout errors on RTD builds for PRs:

Truncating the output, here is the failure message:

$ /home/docs/checkouts/readthedocs.org/user_builds/dask/envs/8225/bin/python -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
...
writing output... [ 84%] generated/dask.dataframe.groupby.DataFrameGroupBy.count
writing output... [ 85%] generated/dask.dataframe.groupby.DataFrameGroupBy.cov
writing output... [ 85%] generated/dask.dataframe.groupby.DataFrameGroupBy.cumcount
writing output... [ 85%] generated/dask.dataframe.groupby.DataFrameGroupBy.cumprod
writing output... [ 85%] generated/dask.dataframe.groupby.DataFrameGroupBy.cumsum
writing output... [ 85%] generated/dask.dataframe.groupby.DataFrameGroupBy.first
writing output... [ 85%] generated/dask.dataframe.groupby.DataFrameGroupBy.get_group


Command killed due to excessive memory consumption

Has a recent PR significantly increased the docs size?

Activity

  1. jrbourbeau commented on Oct 6, 2021

    @jrbourbeau
    Member

    Hmm thanks for flagging this @charlesbluca. I've not seen this on other PRs recently. We did make some changes to how we generate our API docs, but that was several weeks ago (cc @jsignell). Are you seeing this error consistently?

  2. added
    documentation
    on Oct 6, 2021
  3. charlesbluca commented on Oct 6, 2021

    @charlesbluca
    MemberAuthor
  4. jsignell commented on Oct 6, 2021

    @jsignell
    Member

    I think it takes longer to build with the new theme @jacobtomlinson do you have any ideas about how to handle this?

  5. jakirkham commented on Oct 6, 2021

    @jakirkham
    Member
  6. jakirkham commented on Oct 6, 2021

    @jakirkham
    Member

    cc @astrojuanlu (in case you have any advice for us so we can debug this further)

  7. astrojuanlu commented on Oct 7, 2021

    @astrojuanlu

    Most importantly, the "excessive memory consumption" is misleading: the builds are failing because of timeout.

    The last passing build of main appears to be https://readthedocs.org/projects/dask/builds/14901502/, which took half the time it's taking now. Suspicious.

    I'll inspect this more closely in the coming hours.

  8. jakirkham commented on Oct 7, 2021

    @jakirkham
    Member

    Thanks Juan! 😄

  9. astrojuanlu commented on Oct 7, 2021

    @astrojuanlu

    tl;dr: Looks like there were no changes in Dask that produced this slowdown, but somehow the newer dask-sphinx-theme seems to make a huge difference. The solution for now is to set dask-sphinx-theme>=1.3.5,<2 in docs/requirements-docs.txt.


    I launched two builds on astrojuanlu#1, one for 049d803 (which passed 3 days ago) and another one for ba29ba3, which failed 2 days ago. They got built on our large builders so they passed - but they took ~1400 seconds, whereas main used to take ~400 seconds.

    This step:

     /home/docs/checkouts/readthedocs.org/user_builds/dask/envs/latest/bin/python -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html 
    

    took 200 seconds on the good build, and

     /home/docs/checkouts/readthedocs.org/user_builds/dask-astrojuanlu/envs/latest/bin/python -m sphinx -T -b html -d _build/doctrees -D language=en . _build/html 
    

    took 1140 s on the bad build. Therefore, there were no code changes in Dask that produced this slowdown.

    The only relevant difference in dependencies I saw was dask-sphinx-theme-1.3.6 vs dask-sphinx-theme-2.0.0. So I went ahead and pinned it, and that seemed to do the trick. https://readthedocs.org/projects/dask-astrojuanlu/builds/14928907/ took less than 400 seconds. Therefore, for now the solution is

    From d67dfdc161bec6ee5e02341a590e0f5e0de173d9 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= <[email protected]>
    Date: Thu, 7 Oct 2021 11:57:11 +0200
    Subject: [PATCH] Try capping dask-sphinx-theme
    
    ---
     docs/requirements-docs.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
    index cedb3ecd06..52e69cb6cf 100644
    --- a/docs/requirements-docs.txt
    +++ b/docs/requirements-docs.txt
    @@ -1,6 +1,6 @@
     numpydoc
     sphinx>=4.0.0
    -dask-sphinx-theme>=1.3.5
    +dask-sphinx-theme>=1.3.5,<2
     sphinx-click
     toolz
     cloudpickle
  10. jacobtomlinson commented on Oct 7, 2021

    @jacobtomlinson
    Member

    @jsignell and I have been doing a bunch of work on the docs lately.

    In version 2 of the dask sphinx theme we now use the executable book theme instead of the read the docs theme as a base. Most of the other Dask projects have already rebuilt docs with the new theme.

    I'm not surprised that it takes longer to build, the new theme is more complex and has more features. It's disappointing that this is long enough to hit a timeout though. Pinning to the old theme, for now, is a fine bandaid but we should get this resolved properly.

    @choldgraf do you have any suggestions on improving performance here?

  11. jsignell commented on Oct 7, 2021

    @jsignell
    Member

    Seems like readthedocs/readthedocs.org#8545 would be a good start :)

  12. choldgraf commented on Oct 7, 2021

    @choldgraf

    Hmmm it is strange to see such a big change in performance. I wonder - does Dask have any really big API docs pages? I wonder if this is pydata/pydata-sphinx-theme#381 as well (the book theme inherits the pydata theme as they reuse much of the same style and components).

  13. jacobtomlinson commented on Oct 7, 2021

    @jacobtomlinson
    Member

    does Dask have any really big API docs pages

    Yeah it does.

  14. jsignell commented on Oct 7, 2021

    @jsignell
    Member

    Yeah that seems like it. In the short-term, I think there are a couple possible solutions:

  15. choldgraf commented on Oct 7, 2021

    @choldgraf

    Just a note that we recently got a little numfocus grant to work on the pydata theme, so I suspect improving performance will be something that happens once that gets rolling

  16. jsignell commented on Oct 7, 2021

    @jsignell
    Member

    In that case my vote would be to either ask or pay for our build times to be increased :)

  17. jsignell commented on Oct 7, 2021

    @jsignell
    Member

    Who's in charge of money things? @mrocklin or maybe @TomAugspurger?

  18. choldgraf commented on Oct 7, 2021

    @choldgraf

    I also think it might be easy to get a quick speed up in the pydata theme, will see if my hunch is correct today

  19. astrojuanlu commented on Oct 7, 2021

    @astrojuanlu

    We can increase build limits on a per-project basis. Send an email to [email protected] providing a good reason why your documentation needs more resources.

    No need to throw money at it :)

  20. choldgraf commented on Oct 7, 2021

    @choldgraf

    I looked into this today and it was more complicated than I was hoping haha. I think that there are still improvements we could make, but there seems to be some fundamental reality that include a ton of API docs on every single page will slow things down considerably.

    However, there was a new feature we implemented in the pydata theme to try and help with this, which is to optionally limit the depth of the navigation bar so that items N levels deep aren't included at all. If your API documentation is nested enough levels deep, then this should be a way that you can prevent them from slowing down your builds. I've got a PR to document and add support for this in the book theme, wanna try it out from there and see if this could fix things?

    executablebooks/sphinx-book-theme#409

  21. choldgraf commented on Oct 8, 2021

    @choldgraf

    Ah one more idea which I think would make a much bigger difference. The autosummary directives currently are being used with a toctree argument:

    Top level functions
    ~~~~~~~~~~~~~~~~~~~
    .. autosummary::
    :toctree: generated/
    add
    all
    allclose

    This means that a toctree entry is being generated for every single API entry. If you remove :toctree: from the directive, I believe that the stub pages are still generated, and you can click through to them from the main API landing page, but they just aren't inserted into the left toctree anymore.

    Can somebody try this and see if this works?

    EDIT: argh I tried this on the pydata docs and it doesn't generate the stub pages properly unless you use :toctree:

  22. choldgraf commented on Oct 8, 2021

    @choldgraf

    Ok i think i figured out a way to selectively remove navigation entries so that you can still autogenerate API docs with stub pages, but not have them show up in the navigation bar. Can you try adding the function here to your docs build and see if that fixes the speed issues? https://github.com/pydata/pydata-sphinx-theme/pull/492/files#diff-381cb883eeefc0f20f80b41392b657f8a6f8c12dc106954c84ed0c7402e37c64R475

  23. jakirkham commented on Oct 8, 2021

    @jakirkham
    Member

    For reference, investigation into these improvements is happening in PR ( #8238 )

  24. jsignell commented on Oct 11, 2021

    @jsignell
    Member

    Thanks for looking into this @choldgraf!

  25. added
    needs attention
    on Nov 15, 2021
  26. jrbourbeau commented on Jan 7, 2022

    @jrbourbeau
    Member

    Closing as this issue has been resolved -- thanks all!

  27. choldgraf commented on Jan 7, 2022

    @choldgraf

    I saw this pop up in my notifications and was like oh god what have we broken now?! 😆

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationneeds attention

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions