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.9.tar.gz (10.5 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.9-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beakerutil-0.3.9.tar.gz
  • Upload date:
  • Size: 10.5 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.9.tar.gz
Algorithm Hash digest
SHA256 6bbfc20d53a481a132cc32819fe2ddd60d3cde0c01a5b8c84a66500203739b9b
MD5 239b79e383a8ad69cc50e9aaf9f4bbf5
BLAKE2b-256 483d74c1bb6b6a7c7a773658edc3551a571ac7ba7dab268f4601330ec27d58b1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: beakerutil-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 11.6 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 64fb075b7ed8ea2cbee545aab697718d141d0c387d1e707d2dc1a7830ec2d446
MD5 8c7728ed10b6b2bb5c2d617df45b740b
BLAKE2b-256 0f9c5a7883d8c6961d64b3d8ea430931368317e15d551478c3645ecddee61b84

See more details on using hashes here.

Provenance

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