Skip to main content

Command-line tool for beaker utilities

Project description

BeakerUtil

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

Installation

  1. Ensure that Beaker is set up locally by following these instructions.
  2. Install this project with pip install beakerutil.

[!NOTE] Instead of installing BeakerUtil, you can use uvx beakerutil to directly run the tool. On my machine, I set up the alias bu="uvx beakerutil" for convenience.

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.10.tar.gz (11.3 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.10-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beakerutil-0.3.10.tar.gz
  • Upload date:
  • Size: 11.3 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.10.tar.gz
Algorithm Hash digest
SHA256 56729de68118f081f644358be24096ce50088fd0ecaabd62f9e3871ce6b78386
MD5 15c9f1d85f4c05f3699a76c17ec00344
BLAKE2b-256 10df33a8f5117443f7ae298d838ac1258149589e849a7c34cd50cd31516727b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for beakerutil-0.3.10.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.10-py3-none-any.whl.

File metadata

  • Download URL: beakerutil-0.3.10-py3-none-any.whl
  • Upload date:
  • Size: 12.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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a00c592c61245c24e4aac7861187fdbe87555746db0c3a4c778bdbc6fd2ecd7c
MD5 036b0fb3616c2a83c9b03bd0755d94b0
BLAKE2b-256 8be63e133278fbc07976b7736fd11a600a52667ee2996bda8aaf921c5dfea852

See more details on using hashes here.

Provenance

The following attestation bundles were made for beakerutil-0.3.10-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