Repository navigation
Conversation
…nslothai#9259) The system-info endpoint read only the root filesystem's usage. A user who symlinks ~/.cache/huggingface (or any configured HF cache) onto a secondary drive sees the root drive's numbers while the models live elsewhere — the monitor under-reports exactly the storage that matters. The HF cache root is now resolved through its symlinks (realpath, so the usage describes the mount holding the bytes, not the one holding the link) and unioned with the root. Entries dedup by (total, free), so a cache still under / reports the same single filesystem and the same numbers as before; a symlinked cache on a second drive adds its bytes. Verified against the real filesystems on this machine: two same-fs paths collapse to one, cross-fs paths union (E:/ + C:/ cache -> two filesystems). Four tests pin the dedup rule (same rule and key as the endpoint's aggregator): cache-under-root stays one fs with unchanged numbers, a second drive adds its bytes, percent blends the union, and the documented symmetric-mirror edge of the (total, free) key.
99dea85 to
9ac2c65
Compare
|
Narrowed and rebased off main — the PR is now exactly the disk-usage aggregation in |
…test the real helper
|
Pushed 4bd0c22 on top of a merge with current main:
Checked on a host whose HF cache sits on a second volume: |
|
Closing in favour of #12724. Summing the system disk and the models drive into one number still hid the drive #9259 asks about (a full models drive can read as healthy next to an empty root), and it relabelled the combined total as "System disk" in Storage. #12724 keeps the system disk as is and reports the models drive separately when it sits on another volume. Thanks for digging into this. |
Closes #9259.
The gap
The
/api/systemendpoint read only the root filesystem (psutil.disk_usage("/")), so a user who symlinks~/.cache/huggingface(or points the HF cache setting) at a secondary drive saw the root drive's usage in Settings > Resources > Live Monitor while the models lived elsewhere.Fix
utils/system_disk.py:system_disk_usage()reads the root filesystem plus the active HF hub cache (get_hf_cache_paths().hub_cache), resolved withos.path.realpathso a symlinked cache is measured on the mount holding the bytes. Volumes are deduplicated byst_devand summed:/: one filesystem, same numbers as before (percent uses psutil's formula);The payload shape is unchanged (
total_gb,free_gb,percent_used).Verification
studio/backend/tests/test_disk_usage_aggregation.py: 5 tests against the real helper./api/systemdisk went from 2079 GB total (root only) to 32476 GB total (root plus cache volume).