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

Add cross-PR caching within CircleCI for gallery examples #3837

Merged
merged 3 commits into from
May 17, 2021

Conversation

NicolasHug
Copy link
Member

This PR adds cross-PR caching for the gallery examples. They're long to build ATM but this will be very much needed when we start building lengthy tutorials

According to my experiments on a custom branch it seems to work fine, see e.g. https://app.circleci.com/pipelines/github/pytorch/vision/8105/workflows/9b74c75a-d0c3-42c0-a812-90b3baf8df2e/jobs/579037 where we can read "after excluding 1 file that had previously been run (based on MD5)."

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

This LGTM, but for my understanding, could you clarify a few things?

It looks like sphinx already avoids full recompilation if the gallery files were already present and nothing has changed, but if a change happens it recompiles only the changed files, is that correct?

@NicolasHug
Copy link
Member Author

It looks like sphinx already avoids full recompilation if the gallery files were already present and nothing has changed, but if a change happens it recompiles only the changed files, is that correct?

Yes that's true, although for sphinx-gallery this is slightly more subtle, because SG generates .rst files that sphinx will consider as sources. In order not to re-generate files that didn't changed (so that sphinx doesn't consider those sources as "new"), SG keeps track of the md5 hashes of the examples in the auto_examples folder.

Locally everything works as expected, but in the CI it's different: the auto_examples folder isn't shared across PRs which means the examples are always re-computed. This PR is about caching within CircleCI.

@NicolasHug NicolasHug changed the title Add cross-PR caching for gallery examples Add cross-PR caching within CircleCI for gallery examples May 17, 2021
@NicolasHug NicolasHug merged commit 0fece1f into pytorch:master May 17, 2021
@fmassa
Copy link
Member

fmassa commented May 17, 2021

Thanks for the clarification!

facebook-github-bot pushed a commit that referenced this pull request May 19, 2021
…3837)

Reviewed By: cpuhrsch

Differential Revision: D28538754

fbshipit-source-id: 72075afcbb90c24f8f301f322dd9156c7d3363d1
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.

3 participants