Description
As introduced in PR #814, three new constants were added to SlurmCommandGenStrategy for container mount paths:
CONTAINER_MOUNT_INSTALL = "/cloudai_install"
CONTAINER_MOUNT_OUTPUT = "/cloudai_run_results"
CONTAINER_MOUNT_HF_HOME = "/cloudai_install/huggingface"
These constants should be used consistently across the codebase instead of hardcoded strings.
Files with hardcoded paths
Source files:
src/cloudai/systems/slurm/slurm_command_gen_strategy.py (line 309)
src/cloudai/workloads/nemo_run/slurm_command_gen_strategy.py (line 124)
src/cloudai/workloads/ai_dynamo/ai_dynamo.sh (lines 4-6, 17)
src/cloudai/workloads/triton_inference/slurm_command_gen_strategy.py (line 147)
Test files:
tests/test_single_sbatch_runner.py (lines 268-269, 277)
tests/workloads/slurm_container/test_command_gen_strategy_slurm.py (lines 49-50, 67-68, 87-88)
tests/workloads/nemo_run/test_command_gen_strategy_slurm.py (line 74)
tests/systems/slurm/test_command_gen_strategy.py (lines 239-240, 258-259, 272-273)
Proposed refactoring
- Replace hardcoded strings in source files with references to
SlurmCommandGenStrategy.CONTAINER_MOUNT_* constants
- Update test files to use the constants for consistency
- Consider making these constants accessible in a more central location if needed by non-Slurm code
Context
Description
As introduced in PR #814, three new constants were added to
SlurmCommandGenStrategyfor container mount paths:CONTAINER_MOUNT_INSTALL = "/cloudai_install"CONTAINER_MOUNT_OUTPUT = "/cloudai_run_results"CONTAINER_MOUNT_HF_HOME = "/cloudai_install/huggingface"These constants should be used consistently across the codebase instead of hardcoded strings.
Files with hardcoded paths
Source files:
src/cloudai/systems/slurm/slurm_command_gen_strategy.py(line 309)src/cloudai/workloads/nemo_run/slurm_command_gen_strategy.py(line 124)src/cloudai/workloads/ai_dynamo/ai_dynamo.sh(lines 4-6, 17)src/cloudai/workloads/triton_inference/slurm_command_gen_strategy.py(line 147)Test files:
tests/test_single_sbatch_runner.py(lines 268-269, 277)tests/workloads/slurm_container/test_command_gen_strategy_slurm.py(lines 49-50, 67-68, 87-88)tests/workloads/nemo_run/test_command_gen_strategy_slurm.py(line 74)tests/systems/slurm/test_command_gen_strategy.py(lines 239-240, 258-259, 272-273)Proposed refactoring
SlurmCommandGenStrategy.CONTAINER_MOUNT_*constantsContext