Minimal Slurm experiment runner with persistent SSH, YAML configs, and log streaming
Project description
slurmster
A minimal Python tool to run parameter-grid experiments on a Slurm cluster with persistent SSH, log streaming, and simple YAML configs — inspired by a small Bash prototype.
Highlights
- CLI with subcommands:
submit,monitor,status,fetch,cancel - YAML config (explicitly provided via
--config) - Persistent SSH connection for low latency
- Per-run working directories on the remote side
- Automatic log redirection to
stdout.loginside each run directory - Live log streaming (and re-attach later)
- Local workspace to track runs and “fetched” state
- Cancel jobs from local machine
Install (editable)
cd slurmster
pip install -e .
Or use a virtual environment first.
Quick start
- Prepare a config (see
example/config.yaml). - Submit jobs — the tool automatically uploads and schedules
env_setup.shas a lightweight Slurm job (idempotent) so preparation runs on a compute node:
slurmster --config config.yaml --user <remote_user> --host <remote_host> --password-env SLURM_PASS submit # optional; otherwise you'll be prompted
- Stream logs (auto-starts on submit unless
--no-monitoris passed), or re-attach later:
slurmster --config config.yaml --user <remote_user> --host <remote_host> monitor --exp exp_lr_0.01_epochs_5 # or --job <jobid>
- Check status of non-fetched runs:
slurmster --config config.yaml --user <u> --host <h> status
- Fetch finished runs (downloads each run dir into your local workspace):
slurmster --config config.yaml --user <u> --host <h> fetch
- Cancel a job:
slurmster --config example/config.yaml --user <u> --host <h> cancel --exp exp_lr_0.01_epochs_5
# or: --job 1234567
YAML schema
YAML skeleton
remote:
base_dir: ~/experiments # remote working root
files:
push:
- example/train.py # any code/data files you need on remote
fetch:
- "model.pth" # optional; if omitted we fetch the entire run dir
- "log.txt"
slurm:
directives: | # SBATCH lines; placeholders allowed
#SBATCH --job-name={base_dir}
#SBATCH --partition=gpu
#SBATCH --time=00:10:00
#SBATCH --cpus-per-gpu=40
#SBATCH --nodes=1
#SBATCH --gres=gpu:1
#SBATCH --mem=32G
run:
command: | # your run command; placeholders allowed
source venv/bin/activate
python example/train.py --lr {lr} --epochs {epochs} --save_model "{run_dir}/model.pth" --log_file "{run_dir}/log.txt"
# ONE of the following:
grid:
lr: [0.1, 0.01, 0.001]
epochs: [1, 2, 5, 10]
# experiments:
# - { lr: 0.1, epochs: 1 }
# - { lr: 0.001, epochs: 10 }
Placeholders
{base_dir}: resolved remote base directory (e.g./home/you/experiments)- Any run parameter placeholder, e.g.
{lr},{epochs} {remote_dir}: the configuredremote.base_dir{run_dir}: the per-run directory (underremote.base_dir/runs/{exp_name})
Local workspace
Under the .slurmster directory next to your config.yaml (<config-dir>/.slurmster/<user>@<host>/<sanitized-remote-base>), we store:
runs.json— run registry (job id, exp name, fetched flag, etc.)results/<exp_name>_<job_id>/...— fetched run directories
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slurmster-0.1.0.tar.gz.
File metadata
- Download URL: slurmster-0.1.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
900c5e2f9391a4ff130ba4f9808fdc1dfce5e9db2ebe3dc98415c83e2d174748
|
|
| MD5 |
b48e0474f34274b9c5ba61ac082bf205
|
|
| BLAKE2b-256 |
8914bf34236b46e1b1836809d5ac6ede5ba6c2f1bc27bec2f6e59860375282d9
|
Provenance
The following attestation bundles were made for slurmster-0.1.0.tar.gz:
Publisher:
python-publish.yml on dyigitpolat/slurmster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slurmster-0.1.0.tar.gz -
Subject digest:
900c5e2f9391a4ff130ba4f9808fdc1dfce5e9db2ebe3dc98415c83e2d174748 - Sigstore transparency entry: 346642895
- Sigstore integration time:
-
Permalink:
dyigitpolat/slurmster@3c07aff39b54aaea1123e14cdbf1600951f5efd3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dyigitpolat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3c07aff39b54aaea1123e14cdbf1600951f5efd3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file slurmster-0.1.0-py3-none-any.whl.
File metadata
- Download URL: slurmster-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59669c619635eef9c5c5cedf8efc02c621adf8c76fca1586526dfa65f90b256e
|
|
| MD5 |
37b7aca9b9ee1e22088d9774a5167190
|
|
| BLAKE2b-256 |
572efa8cf4882f959cefdee8c4036bba2ec31529bf506b0c50cc0dfe5252d4f2
|
Provenance
The following attestation bundles were made for slurmster-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on dyigitpolat/slurmster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slurmster-0.1.0-py3-none-any.whl -
Subject digest:
59669c619635eef9c5c5cedf8efc02c621adf8c76fca1586526dfa65f90b256e - Sigstore transparency entry: 346642896
- Sigstore integration time:
-
Permalink:
dyigitpolat/slurmster@3c07aff39b54aaea1123e14cdbf1600951f5efd3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dyigitpolat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3c07aff39b54aaea1123e14cdbf1600951f5efd3 -
Trigger Event:
release
-
Statement type: