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
UnicodeDecodeError for binary files
- Returns misleading error messages when a file exists but contents differ (says 'does not exist')
Proposed Enhancement
- Use
read_bytes() instead of read_text() for binary-safe comparison
- Distinguish between 'file does not exist' and 'file exists but contents differ' in error messages
References
Affected Files
src/cloudai/systems/kubernetes/kubernetes_installer.py
src/cloudai/systems/slurm/slurm_installer.py
/cc @amaslenn
Description
The current implementation of
is_installed_oneforFileitems in both Slurm and Kubernetes installers usesread_text()to compare file contents, which:UnicodeDecodeErrorfor binary filesProposed Enhancement
read_bytes()instead ofread_text()for binary-safe comparisonReferences
Affected Files
src/cloudai/systems/kubernetes/kubernetes_installer.pysrc/cloudai/systems/slurm/slurm_installer.py/cc @amaslenn