Skip to content

Improve File installation check to handle binary files and content-mismatch errors #782

@coderabbitai

Description

@coderabbitai

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:

  1. Raises UnicodeDecodeError for binary files
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions