Skip to main content

A utility to create, launch and monitor code experiments on SLURM, PBS, or local machines.

Project description

SbatchMan

SbatchMan

A utility to create, launch, and monitor code experiments on SLURM, PBS, or local machines.

🚀 Installation

The recommended way to install SbatchMan is with pipx. This will install the package and its dependencies in an isolated environment.

If you don't have pipx, you can install it with:

python3 -m pip install --user pipx
python3 -m pipx ensurepath

You may need to restart your terminal for the changes to take effect.

Once pipx is installed, you can install sbatchman from PyPI:

pipx install sbatchman

Now try running sbatchman --help!

For development, clone the repository and install the package in editable mode from the local repository:

# For developers
pip install -e .

This allows you to make changes to the code and have them reflected immediately without needing to reinstall.

🛠️ Usage

The tool is organized into three main commands: configure, launch, and status.

⚙️ Configure an Experiment

Before launching an experiment, you need to create a configuration for your target environment (SLURM, PBS, or local). The configure command helps you create and save these settings.

When you first run this command in a project directory, SbatchMan will ask for confirmation to create a sbatchman directory. This directory will store all your configurations and experiment results.

Check out the available options for each environment:

sbatchman configure slurm --help # Show options for SLURM
sbatchman configure pbs --help   # Show options for PBS
sbatchman configure local --help # Show options for local execution

The configuration file will be saved in the sbatchman/configs directory with the name you provided. You can use this name later to launch your experiment. If you need to change the configuration, you can simply run the configure command again with the same name, and it will overwrite the existing configuration.

SLURM Example:

sbatchman configure slurm --name my-gpu-job \
--partition gpu_queue \
--cpus-per-task 4 \
--mem "16G" \
--gpus 1 \
--time "01:00:00" \
--env "CUDA_VISIBLE_DEVICES=0"

PBS Example:

sbatchman configure pbs --name my-pbs-job \
--queue standard \
--cpus 4 \
--mem "16gb" \
--walltime "01:00:00"

Local Example:

sbatchman configure local --name my-local-job \
--env "MY_VAR=hello"

쏘 Launch an Experiment

Use the configuration name to launch your code.

sbatchman launch --config my-gpu-job \
"python my_project/train.py --learning-rate 0.001 --epochs 50"

The command to execute must be passed in quotes.

📊 Check Experiment Status

To monitor your experiments, launch the interactive interface:

sbatchman status

The TUI provides a real-time view of your jobs, categorized into queued, running, and finished states. You can navigate through the list of jobs and select one to view its live standard output and error logs.

⌨️ Keybindings:

  • Up/Down Arrows: Navigate through jobs and tabs.
  • Enter: View logs for the selected job.
  • q: Go back to the previous view or quit the application.

SbatchMan TUI

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

sbatchman-0.1.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

sbatchman-0.1.3-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sbatchman-0.1.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sbatchman-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c6af50b20c9188a9bd6984c7df9d47e1dae11f7d1ad04223a55b61af9e059c97
MD5 71754daa7157544259155218324bc2d3
BLAKE2b-256 04b740c35b203db75551bc162f58a7d02d79c2d12b3980fc9e7a59f24e438461

See more details on using hashes here.

Provenance

The following attestation bundles were made for sbatchman-0.1.3.tar.gz:

Publisher: pypi-publish.yml on LorenzoPichetti/SbatchMan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: sbatchman-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sbatchman-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73a1112bb2e1e19c97a953a00609b9bb1cfaacbdf033b42157ad859572e256c2
MD5 e6150c8fd6433e5cdd30ffff9dd6113f
BLAKE2b-256 d1f1b3a5e70aea303e31f269c9f7b207245bb06763c0e7b5407421b8ca3bea99

See more details on using hashes here.

Provenance

The following attestation bundles were made for sbatchman-0.1.3-py3-none-any.whl:

Publisher: pypi-publish.yml on LorenzoPichetti/SbatchMan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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