perf: use hardlinks for code snapshots to reduce disk and inode usage#2476
Draft
kajalj22 wants to merge 2 commits into
Draft
perf: use hardlinks for code snapshots to reduce disk and inode usage#2476kajalj22 wants to merge 2 commits into
kajalj22 wants to merge 2 commits into
Conversation
Replace full rsync copies with hardlinked copies via --link-dest. Each test snapshot still gets its own isolated directory, but files share storage on disk until modified. On Lustre this is near-instant and reduces nightly CI disk usage from ~N*repo_size to ~1*repo_size (e.g. 254 GB → ~13 GB on pretyche for one pipeline). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Align test scripts with PY_EXECUTABLES and the uv design doc (docs/design-docs/uv.md), which mandate --locked to prevent accidental lockfile updates. This also prevents uv.lock corruption when snapshots use hardlinks (see previous commit). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Contributor
Author
|
/ok to test 2d43719 |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rsynccopies with hardlinked copies via--link-destintools/code_snapshot.shMotivation
In nightly CI with ~20 tests,
code_snapshot.shcreates ~20 full copies of the repo on Lustre — identical code, differing only in output logs written per job. This wastes ~254 GB and ~194K files per pipeline.How it works
rsync --link-destcreates hardlinks to the source files when content matches. Hardlinks share the same inode on disk, so no additional storage is consumed. If a file is later modified (e.g., by an editor doing save-as-rename), the hardlink breaks automatically and only that copy diverges — preserving snapshot isolation.Safety analysis
continue.sh,$JOB_ID-logs/,metrics.json, etc.) create new filesTest plan
du -sh code_snapshots/before/after)ls -lishows shared inodes across snapshot directories🤖 Generated with Claude Code