slrun - SLURM Tools
Run commands on SLURM as if they were local, with seamless detach/reattach capabilities.
Features
- Seamless job submission: Run commands on SLURM with minimal syntax changes
- Real-time output streaming: See stdout/stderr as if running locally
- Detach/reattach capability: Start a job, detach, and reconnect later
- Job management: List all detached jobs and their statuses
- Configuration profiles: Store different resource configurations in config file
- Automatic cleanup: Temporary files are removed when jobs complete
Installation
Using UV (recommended)
uv add slrun
Directly from GitHub
uv pip install git+https://github.com/yashsavani/slrun.git
Using pip
pip install slrun
Quick Start
Launch a job
slrun launch python train_model.py --epochs 100
With custom SLURM resources
slrun launch --mem 128GB --time 2-00:00:00 --gres gpu:A100:2 python train_model.py
Using a configuration profile
slrun launch --profile large python train_model.py
Handling argument conflicts
When your command uses arguments that might conflict with slrun, use the -- separator:
slrun launch --timeout 7200 -- python script.py --timeout 3600
List all detached jobs
slrun list
Reattach to a job
slrun attach 12345 # Replace with your job ID
Configuration
You can customize default settings by creating a configuration file:
# Edit your configuration file
slrun config edit
# View your current configuration
slrun config show
Example configuration (~/.slrun/config.toml):
[defaults]
time = "2-00:00:00"
mem = "128GB"
gres = "gpu:A100:1"
[profiles.large]
time = "7-00:00:00"
mem = "256GB"
gres = "gpu:A100:4"
[profiles.debug]
time = "0-01:00:00"
mem = "16GB"
gres = "gpu:K80:1"
Development
Local Development Setup
# Clone the repository
git clone https://github.com/yashsavani/slrun.git
cd slurm-tools
# Install in development mode
uv pip install -e .
Building the Package
uv build
Documentation
For complete usage instructions, see the detailed documentation.
Requirements
- Python 3.6+
- Access to a SLURM cluster with
sbatch,squeue, andsacctcommands
License
MIT
Metadata
Release files for slrun 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| slrun-0.1.4.tar.gz | 25.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| slrun-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.9 kB
Release files / slrun-0.1.4.tar.gz
| Download URL | slrun-0.1.4.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a97fe9d2c865a113e0d3ee7021dcf984b7d553f9809f0b2af93a8d982137555d
|
|
BLAKE2b-256 checksum How to use checksums |
ebaebf38f124d13499c4968c9e542c8d55fe17dafec367cbff882c6699e1951a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / slrun-0.1.4-py3-none-any.whl
| Download URL | slrun-0.1.4-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70342207a23154f432fdc14ef1fe41ee9ba2593dcdc8a285a5c6f8cc5ac7f15d
|
|
BLAKE2b-256 checksum How to use checksums |
4f5c357edf6290f922c7ae0e36fd7f568095b26624c9b7b9d2f6ecaa0b023021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|