Skip to main content

A utility to create and launch code experiments on local or remote 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:

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 folder 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 file will be saved in the sbatchman/configs directory with the name you provide. 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.

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.1.tar.gz (11.7 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.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sbatchman-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 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.1.tar.gz
Algorithm Hash digest
SHA256 7c7451ed508398f1c69741218c866e41536580c07c153da443dfe08bb3a62068
MD5 7c632ceff0797b4b6a4b497da9af88ef
BLAKE2b-256 13129bdb2b5528b3aff3ec46de368643dfe97b0a1d39572b90ff7139d954033f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sbatchman-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: sbatchman-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c09b5b88cf3ea70c5b7e495e75ed96f662785f758f589284227a949104acd6f
MD5 fb73bab903d6797faaab24ed94f02a28
BLAKE2b-256 ba370ab33e664cb3c20d534fc616a2d9903f259bf1d6b98123fd404fadbcf872

See more details on using hashes here.

Provenance

The following attestation bundles were made for sbatchman-0.1.1-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