NVIDIA / NVIDIA/cloudai

Refactor hardcoded container mount paths to use constants

Open
#819 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
99
Forks
62
Avg merge
6d 12h
Merged PRs (30d)
17

Description

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

  1. Replace hardcoded strings in source files with references to SlurmCommandGenStrategy.CONTAINER_MOUNT_* constants
  2. Update test files to use the constants for consistency
  3. Consider making these constants accessible in a more central location if needed by non-Slurm code

Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.