cluv — sync UV-based Python projects across HPC clusters.
In early development. Commands are functional, but expect bugs or missing features.
- Python >= 3.13
- UV
- SSH access configured for each cluster in
~/.ssh/config(runcluv loginto open ControlMaster sessions) - A GitHub repository with your project
Install as a UV tool:
uv tool install git+https://github.com/mila-iqia/cluvThen you can run cluv directly as a command:
cluv init
cluv login mila
cluv sync mila
cluv submit mila job.sh- Initialize your project with:
cluv init
- Establish SSH connections to all configured clusters:
cluv login
- Sync your project to all clusters and run
uv syncon each:cluv sync
See the examples folder for sample projects using cluv. Each example includes a README with instructions specific to that project.
Add a [tool.cluv] section to the pyproject.toml of your project to manage the behavior of the tool.
The command cluv init will add a default config if it doesn't already exists in the .toml.
See the config at the project root for an example, or refer to the docs.
Initialize the current directory as a cluv project. Must be run from inside your $HOME directory.
cluv init
Default project structure after cluv init:
my_project/
├── README.md
├── logs -> $SCRATCH/logs/my_project # symlink to $SCRATCH
├── pyproject.toml # includes [tool.cluv] config
├── scripts/
│ ├── job.sh # Slurm job script template
│ └── safe_job.sh # Slurm job script template (copies .venv and prior results)
└── src/
└── my_project/
└── __init__.py
Open SSH ControlMaster connections to all configured clusters. Run this before any command that requires a live connection.
cluv login [<cluster> ...]
Push local git changes, then on each cluster: clone or fetch the repo, check out the current branch, and run uv sync. Optionally rsyncs results back if results_path is set in the config.
cluv sync [<cluster> ...]
Display an overview of :
- Cluster: GPU availability, running/queued jobs and disk usage.
- Jobs: cached jobs from
cluv submitwith their status.
cluv status [<table>]
Submit a SLURM job on a remote cluster.
cluv submit <cluster> <job.sh> [<sbatch-flags> ...] [-- <program-args> ...]
For example:
cluv submit rorqual script/job.sh --time=00:10:00 -- python main.pySync the project to a cluster, then run a command there with uv run.
cluv run <cluster> <command> [<args> ...]