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

Cache pages builds #30

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Cache pages builds #30

merged 5 commits into from
Dec 3, 2024

Conversation

dfsnow
Copy link
Member

@dfsnow dfsnow commented Dec 3, 2024

This PR adds caching for our pages build, since it takes awhile and currently runs on every PR commit. I couldn't get sphinx caching to work (it seems to somehow rely on the modified time of files), but caching the jupyter notebook build works fine and brings the build from ~3 minutes to <20 seconds.

@dfsnow dfsnow changed the title Cache pages after build Cache pages builds Dec 3, 2024
@@ -31,12 +38,14 @@ jobs:
run: uv pip install .[docs]

- name: Generate HTML
run: uv run sphinx-build -d _build/doctrees docs/source _build/html
run: |
Copy link
Member Author

Choose a reason for hiding this comment

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

I also set the -j auto flag here to take advantage of parallel building within Sphinx.

@dfsnow dfsnow requested a review from jeancochrane December 3, 2024 17:55
@dfsnow dfsnow marked this pull request as ready for review December 3, 2024 17:55
@dfsnow dfsnow requested a review from wrridgeway as a code owner December 3, 2024 17:55
Copy link

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

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

Looks great! I'm curious to learn more about how Jupyter caching works in Sphinx, but you should go ahead and merge if you're confident this is the correct usage.

@@ -14,3 +14,4 @@
nb_render_image_options = {"width": "450px", "align": "center"}
nb_execution_timeout = 600
html_sidebars = {"**": []}
jupyter_execute_notebooks = "cache"
Copy link

@jeancochrane jeancochrane Dec 3, 2024

Choose a reason for hiding this comment

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

[Question, non-blocking] Can you point me to docs for this config option? I assumed it would be in the jupyter-sphinx docs but I couldn't find anything there.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's part of the Myst NB config.

@dfsnow dfsnow merged commit 446d097 into main Dec 3, 2024
8 checks passed
@dfsnow dfsnow deleted the dfsnow/fix-pages-caching branch December 3, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants