Config
Lightweight config system based on a section in the pyproject.toml file.
PartialClusterConfig
Per-cluster configuration options.
- Reference Config CluvConfig clusters
env
Environment variables to set when running Slurm commands on this cluster.
sbatch_args
Per-cluster sbatch flags, overriding the global sbatch_args.
datasets_path
datasets_path: str | None = None
Different path where the datasets should be replicated on this cluster.
When None, this defaults to the top-level config's datasets_path.
This folder will be synced from the current cluster to all other clusters at their respective dataset_path.
job_script_path
job_script_path: str | None = None
Path to the job script to use by default on this cluster.
ClusterConfig
Per-cluster configuration options.
The path fields in this class are by default 'pure' posix paths, to make it explicit that they
can't be used on the local filesystem, and to avoid errors like trying to call .open/.mkdir/etc.
On the current cluster, when calling current_cluster_config, they are actual Paths.
sbatch_args
Merged sbatch flags (global defaults overridden by per-cluster values).
datasets_path
Different path where the datasets should be replicated on this cluster.
When None, this defaults to the top-level config's datasets_path.
This folder will be synced from the current cluster to all other clusters at their respective dataset_path.
job_script_path
Path to the job script to use by default on this cluster.
CluvConfig
Bases: BaseModel
Configuration options for Cluv, loaded from the pyproject.toml file.
- Reference Config get_cluv_config
- Reference CLI sync fetch_results
env
Global environment variables set on all clusters when running Slurm commands.
sbatch_args
Global sbatch flags applied on all clusters.
These are passed directly to sbatch and complement env (which sets SBATCH_* env vars).
See [tool.cluv.clusters.<name>.sbatch_args] for per-cluster overrides.
results_path
results_path: str
Default path to the results directory for all clusters (may contain env vars like $SCRATCH).
results_symlink
results_symlink: str = 'logs'
Name of the symlink created in the project directory pointing to results_path.
datasets_path
datasets_path: str | None = None
Path to a dataset directory, for example, '$SCRATCH/my_dataset'
This folder will be synced from the current cluster to all other clusters at their respective dataset_path.
job_script_path
job_script_path: str | None = None
Default path to the job script to submit when one is not passed explicitly to cluv submit.
This can be overridden for specific clusters in the clusters section, and can also be
overridden on the fly by passing a different job script to cluv submit.
project_dir
project_dir: str | None = None
Default path where the project should be cloned on clusters.
clusters
clusters: dict[str, PartialClusterConfig] = {}
Configuration options for each cluster.
The keys are cluster names, and values are configs that override options for that cluster.
get_cluster_config
get_cluster_config(cluster: str) -> ClusterConfig
Returns the cluster config for a specific cluster.
The environment variables as part of paths will not be resolved.
get_cluv_config
get_cluv_config() -> CluvConfig
Get the cluv config, loading it from the pyproject.toml if needed.
has_cluv_config
Check if the pyproject.toml contains a cluv config
current_cluster_config
current_cluster_config() -> ClusterConfig[Path] | None
Returns the ClusterConfig of the current cluster, or None if not currently on a cluster.