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.2.tar.gz (18.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.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for slrun-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a6291c7b57b2a16f965d2bb0e00cc8599a9f50905c95796a4ed1d494c7dfa5e8
MD5 0dc25c754e2133ce5d922a91a0884121
BLAKE2b-256 979592ab1cd9afb834a5a0509d075297037729973da786807e1980b7e93fde45

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for slrun-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 45e9206c62cd51ecce68f2b93fa06a83e03fbaa55b125a2245b0dd585d2b8834
MD5 826f37fea578700b8a50f68396a05f84
BLAKE2b-256 400ce2f73aa5fece2ef076348d235938c2dfe845c401dcbf04393fe2474cca4a

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