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

DOCS: Ordering of cache step in GH Action YAML example #2145

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jnywong
Copy link

@jnywong jnywong commented Apr 26, 2024

In the example GitHub Action YAML provided at the bottom of https://jupyterbook.org/en/stable/publish/gh-pages.html, the caching of executable content is placed before the jupyter-book build . command, when there are no outputs to cache at that point. This results in a GH action log message such as

Run actions/cache@v3
Cache not found for input keys: jupyter-book-cache-511116b794a1ce6b75d5156b58ce1314db3e65a10292d7e9f072cad18f7711b3

This PR places the caching step after the jupyter-book build . , which should result in a successful GH action log message such as

Run actions/cache@v3
Cache Size: ~1 MB (1110285 B)
/usr/bin/tar -xf /home/runner/work/_temp/21854ee6-0f37-4c55-9aa7-0f64d703126c/cache.tzst -P -C /home/runner/work/czi-catalystproject.github.io/czi-catalystproject.github.io --use-compress-program unzstd
Cache restored successfully
Cache restored from key: jupyter-book-cache-511116b794a1ce6b75d5156b58ce1314db3e65a10292d7e9f072cad18f7711b3

Copy link

welcome bot commented Apr 26, 2024

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@agoose77 agoose77 self-assigned this Apr 26, 2024
@agoose77
Copy link
Collaborator

agoose77 commented Apr 26, 2024

@jnywong thanks for this PR! I think the current ordering looks correct to me; the cache action should restore any previous artifacts before the book build, so that the build does not execute any notebooks that it does not need to. After the job finishes running, the cache action updates the cache for the next invocation.

Does this match your understanding? I think this documentation change was fairly quick in the process of getting 1.0 out!

@jnywong
Copy link
Author

jnywong commented Apr 26, 2024

Hm okay then it may be the case that if you are generating a cache from a GH action for the first time ever, then we need to store the cached outputs after the book has been built. Then subsequently for all GH actions after that, your logic for pulling the cache before the book build makes sense.

I can do a little more testing to establish this! This was just based on my recent experience on the Catalyst Project website repo.

@jnywong jnywong marked this pull request as draft April 26, 2024 15:54
@jnywong
Copy link
Author

jnywong commented Apr 26, 2024

(Marking this as a draft for now while I test this further)

@jnywong jnywong changed the title DOCS: Reorder cache step in GH Action YAML example DOCS: Ordering of cache step in GH Action YAML example Apr 26, 2024
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.

None yet

2 participants