Skip to main content

Command-line tool for beaker utilities

Project description

BeakerUtil

This project is a collection of command-line utilities for Beaker.

Installation

  1. Ensure that Beaker is set up locally by following these instructions.
  2. Install this project with pip install git+https://github.com/abhaybd/BeakerUtil.git@latest

Usage

The main script is beakerutil, which is the entrypoint for all utilities, which are specified as subcommands. Run beakerutil -h for more information.

Using beakerutil launch

With BeakerUtil, you can specify different launch configurations in ~/.beakerutil/launch.conf with different parameters, which can effectively be used as an alias to launch sessions quickly. For example, with my config below, I can run beakerlaunch phobos to quickly launch a CPU-only job on phobos for managing files on WEKA.

Clusters can be specified with a regex to match to multiple clusters. Additionally, the DEFAULT configuration specify parameters to be applied for every launch configuration, but can be overridden. For reference, this is my launch.conf:

DEFAULT:
    budget: ai2/prior
    workspace: ai2/abhayd
    env_secrets:
        AWS_SECRET_ACCESS_KEY: AWS_ACCESS_KEY
        AWS_ACCESS_KEY_ID: AWS_ACCESS_KEY_ID
        WANDB_API_KEY: WANDB_API_KEY
        HF_TOKEN: HF_TOKEN
        GEMINI_API_KEY: GEMINI_API_KEY
        OPENAI_API_KEY: OPENAI_API_KEY
        DOCKER_PAT: DOCKER_PAT

phobos:
    cluster: ai2/phobos-cirrascale
    mounts:
        - src: weka
          ref: prior-default
          dst: /weka/prior
        - src: weka
          ref: oe-training-default
          dst: /weka/oe-training-default

gpu:
    cluster: ".*-cirrascale.*"
    gpus: 1
    mounts:
        - src: weka
          ref: prior-default
          dst: /weka/prior
        - src: weka
          ref: oe-training-default
          dst: /weka/oe-training-default

elanding:
    cluster: "ai2/prior-elanding.*"

Extra Arguments

Extra arguments to pass to beaker session create can also be passed as additional positional arguments preceded by the delimeter --. For example, to name the interactive session, you could do:

beakerlaunch phobos -- -n foo

Using beakerutil monitor

beakerutil monitor can be used to monitor the resource usage of your running experiments. Example output could look like this:

07/17/2025 13:05:59
+----------------------------+---------------------------------+---------+---------------------+-----------------------+-------------------+---------+--------------------+---------------------+
| Job                        | Hostname                        | CPU %   | RAM                 | GPU(s)                | VRAM              | GPU %   | Network (In/Out)   | Disk (Write/Read)   |
+============================+=================================+=========+=====================+=======================+===================+=========+====================+=====================+
| 01K0CZTBC3AFQ91945TFSFH80G | jupiter-cs-aus-145.reviz.ai2.in | 2.90%   | 793.5MiB / 1.968TiB | NVIDIA H100 80GB HBM3 | 1 MiB / 81559 MiB | 0 %     | 41.7MB / 634kB     | 3.92MB / 60.4MB     |
+----------------------------+---------------------------------+---------+---------------------+-----------------------+-------------------+---------+--------------------+---------------------+
| 01K0CSRRM61YE677QB3BG1CAY4 | neptune-cs-aus-265.reviz.ai2.in | 542.51% | 14.83GiB / 1008GiB  |                       |                   |         | 3.57GB / 3.59MB    | 183MB / 14.5GB      |
+----------------------------+---------------------------------+---------+---------------------+-----------------------+-------------------+---------+--------------------+---------------------+

By default, it monitors continuously, updating every 2 seconds. Use the -n flag to modify the update interval, or use --once to print the usage once before exiting.

Using beakerutil list

beakerutil list is a straightforward command, it takes no arguments and prints the currently running beaker jobs, both interactive and noninteractive. For example, the output may look like this:

Interactive sessions:
    0: Session 01JBWFVSS0HNZWW5CT8C84F0J1 using 1 GPU(s) on prior-elanding-62.reviz.ai2.in, status=idle

In this case, there is only one session, with index 0 and ID 01JBWFVSS0HNZWW5CT8C84F0J1.

Using beakerutil attach

beakerutil attach is a utility for connecting to an existing session with beaker session attach. For example, say the output of beakerutil list looks like this:

Interactive sessions:
    0: Session 01JBWFVSS0HNZWW5CT8C84F0J1 using 1 GPU(s) on prior-elanding-62.reviz.ai2.in, status=idle

Running beakerutil attach 0 will connect to the session at index 0. Alternatively, you can specify the session ID or name with the --id or --name flags, respectively. If you only have one session running (as is the case here), you can simply run beakerutil attach (with no arguments) to attach to that session.

Using beakerutil stop

beakerutil stop can be used to easily cancel jobs or sessions. It has a similar usage as beakerutil attach, simply specify an index, ID, or name.

Shortcuts

Some shorthand commands are provided for convenience:

  • beakerlaunch is a shorthand for beakerutil launch. All arguments are forwarded.

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

beakerutil-0.3.8.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

beakerutil-0.3.8-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file beakerutil-0.3.8.tar.gz.

File metadata

  • Download URL: beakerutil-0.3.8.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for beakerutil-0.3.8.tar.gz
Algorithm Hash digest
SHA256 775521d43301566fde8fb4ad9d201ad3f67aa5609dcddd90b9283ab062a16f6d
MD5 1fd95bc3b467538ce299d39a21719dd0
BLAKE2b-256 e860950c2390a87ca6d585bd9ddc5c2d48064424ddd024173d25221c52066b22

See more details on using hashes here.

Provenance

The following attestation bundles were made for beakerutil-0.3.8.tar.gz:

Publisher: publish-pypi.yml on abhaybd/BeakerUtil

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

File details

Details for the file beakerutil-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: beakerutil-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for beakerutil-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d528eb7892adb55a62b6bb8528789ff947ff3dfbf7dff8ce1fb6a0e09909ff9e
MD5 8c4c0a9f152ea0d399a73eb8fa561afc
BLAKE2b-256 c1719159f1e9a84ec0ab9e92d9e2e651886698b11ad5596cb006cf93bdff9bc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for beakerutil-0.3.8-py3-none-any.whl:

Publisher: publish-pypi.yml on abhaybd/BeakerUtil

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