Skip to content

Add initial attempt to keep working dir #12327

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

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

Conversation

ericholscher
Copy link
Member

@ericholscher ericholscher commented Jul 16, 2025

For Enterprise users with dedicated builders,
keeping the checkout around can make their build much faster,
especially in the case of a monorepo.

This is just a draft PR to start testing this concept.

Locally:

Screenshot 2025-07-16 at 2 58 48 PM

For Enterprise users with dedicated builders,
keeping the checkout around can make their build much faster,
especially in the case of a monorepo.

This is just a draft PR to start testing this concept.
@ericholscher ericholscher requested a review from agjohnson July 16, 2025 12:59
@humitos
Copy link
Member

humitos commented Jul 16, 2025

If we need to go in this direction, we should recover the work we've done already. It caches the whole environment and upload it to S3, so other builders can re-use it: #6763

@ericholscher
Copy link
Member Author

@humitos the issue is the download speed of the entire repo on disk, whether from GitHub or S3. The goal is to just keep it checked out on the server to avoid any download penalty for multi-GB repos.

@humitos
Copy link
Member

humitos commented Jul 16, 2025

I see. Keeping the output directory in the builder will only help when the project runs another build in the same builder, tho. That's very unlikely unless we do something to force it. It's hard to make it with spot instances...

@ericholscher
Copy link
Member Author

@humitos as noted in the description, this is for enterprise folks with dedicated builders.

Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

This looks good enough to start with 👍

# Check for existing checkout and skip clone if it exists.
from readthedocs.projects.models import Feature

if self.project.has_feature(Feature.DONT_CLEAN_BUILD) and os.path.exists(
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like plenty to start with. We might eventually use something more specific to test the validity of the repository too, in case the clone is stuck in an unusable state. Something like rev-parse and supporting CLI arguments could probably fit here.

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.

3 participants