Skip to main content

Run commands on SLURM as if local with seamless detach/reattach

Project description

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
  • 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

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

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, and sacct commands

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slrun-0.1.3.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slrun-0.1.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file slrun-0.1.3.tar.gz.

File metadata

  • Download URL: slrun-0.1.3.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for slrun-0.1.3.tar.gz
Algorithm Hash digest
SHA256 12759a5c60ec4eccb08867b25fe4a82dec4ea69565ece81be64be4418caefcc0
MD5 9d0ec04ad9b32703daac92ad16869fab
BLAKE2b-256 4d08f43b1350915624e3a52d9f03e52ec486d8db5e25d15d808a57846fcd1b9f

See more details on using hashes here.

File details

Details for the file slrun-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: slrun-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for slrun-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d2ee13a3cd0983dae707422e248811ac189522339eb199248485d1a281ef0f1d
MD5 abb8594d0fc41e47f62637a46846b3a6
BLAKE2b-256 0d6dbcd8ac718305a1bf46fb1fd89b00fb3fb22c93da6d2ddbc3a8373344649c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page