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 --ci mode to uv cache prune #5391

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Add --ci mode to uv cache prune #5391

merged 2 commits into from
Jul 24, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jul 24, 2024

Summary

Users can now run uv cache prune --ci (open to feedback on the name of that flag) to remove all pre-built wheels from the cache, leaving behind zipped, built wheels (which tend to be the most expensive assets to re-create). This should greatly increase cache performance in CI environments, since uploading unzipped wheels can actually hurt performance if you're persisting the uv cache.

Closes #5282.

@charliermarsh charliermarsh added enhancement New feature or request cli Related to the command line interface labels Jul 24, 2024
@charliermarsh charliermarsh force-pushed the charlie/extract branch 3 times, most recently from c912530 to 149fb26 Compare July 24, 2024 03:11
remove_dir(path)?;
} else {
remove_file(path)?;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bug. We have handling for this below (for entries), but not for the top-level thing we passed to rm_rf.

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

💯

/// cache may have a negative impact on cache performance. Pruning unzipped wheels will leave
/// the cache with any built wheels in their zipped form.
#[arg(long)]
pub all_unzipped: bool,
Copy link
Member

Choose a reason for hiding this comment

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

What about calling it --ci and documenting it as keeping only the artifacts you want to upload to the CI cache?

Choose a reason for hiding this comment

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

From a user perspective, I do feel this would be the main use-case. It would also make it immediately clear to me that I probably should use this in CI pipelines.

@charliermarsh charliermarsh changed the title Add --all-unzipped to uv cache prune Add --ci mode to uv cache prune Jul 24, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) July 24, 2024 19:21
@zanieb
Copy link
Member

zanieb commented Jul 24, 2024

Would you be interested in adding documentation for this to:

  • docs/cache.md
  • docs/integration/github.md (needs cache docs in general, okay to skip now)

It could be brief.

@charliermarsh charliermarsh merged commit 4bc04f9 into main Jul 24, 2024
55 checks passed
@charliermarsh charliermarsh deleted the charlie/extract branch July 24, 2024 19:34
@charliermarsh
Copy link
Member Author

Yeah I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --extracted flag to uv cache prune to remove unzipped wheels
4 participants