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 pip install slrun

Directly from GitHub

uv pip install git+https://github.com/yashsavani/slurm-tools.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/slurm-tools.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.0.tar.gz (18.4 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.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for slrun-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3c88bf63dd6ac380cccfb521e60fbd83dac135be62f1d3a1ce62747d822450c2
MD5 8de6d5cf820dfee38d87ab2d22418227
BLAKE2b-256 6275f064e5cb2faf95f579ab7730b773650228da4c26a46b190e2f7300373bc8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for slrun-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b394f68fd67460484f3f043c08b73a697600b49ceca9242b2f812a34e0ab7ed
MD5 dcf14aeed033928b9c8846c05bd845ac
BLAKE2b-256 43b5c122f414bb288a52194c4bbc92d803879bb0a4358705b564273dbf5d6144

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