Improve File installation check to handle binary files and content-mismatch errors
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 99
- Forks
- 62
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 17
Description
Description
The current implementation of is_installed_one for File items in both Slurm and Kubernetes installers uses read_text() to compare file contents, which:
- Raises
UnicodeDecodeErrorfor binary files - Returns misleading error messages when a file exists but contents differ (says 'does not exist')
Proposed Enhancement
- Use
read_bytes()instead ofread_text()for binary-safe comparison - Distinguish between 'file does not exist' and 'file exists but contents differ' in error messages
References
- PR #781:
- Comment: https://github.com/NVIDIA/cloudai/pull/781#discussion_r2708354205
Affected Files
src/cloudai/systems/kubernetes/kubernetes_installer.pysrc/cloudai/systems/slurm/slurm_installer.py
/cc @amaslenn
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with is_installed_one in src/cloudai/systems/kubernetes/kubernetes_installer.py and src/cloudai/systems/slurm/slurm_installer.py, then review the comparison and error-reporting paths. The work is done when binary files can be checked without decoding errors and the messages distinguish missing files from content mismatches in both installers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, python
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100