Skip to main content

A CLI tool for launching Kubernetes jobs in EIDF

Project description

kblaunch

Test Python Version Ruff PyPI Version

A CLI tool for launching Kubernetes jobs with environment variable and secret management.

Installation

pip install kblaunch

Or using uv:

uv add kblaunch

You can even use uvx to use the cli without installing it:

uvx kblaunch --help

Usage

Setup

Run the setup command to configure the tool (email and slack webhook):

kblaunch setup

Basic Usage

Launch a simple job:

kblaunch launch
    --job-name myjob \
    --command "python script.py"

With Environment Variables

  1. From local environment:

    kblaunch launch \
        --job-name myjob \
        --command "python script.py" \
        --local-env-vars PATH \
        --local-env-vars PYTHONPATH
    
  2. From Kubernetes secrets:

    kblaunch launch \
        --job-name myjob \
        --command "python script.py" \
        --secrets-env-vars mysecret1 \
        --secrets-env-vars mysecret2
    
  3. From .env file:

    kblaunch launch \
        --job-name myjob \
        --command "python script.py" \
        --load-dotenv
    

GPU Jobs

Specify GPU requirements:

kblaunch launch \
    --job-name gpu-job \
    --command "python train.py" \
    --gpu-limit 2 \
    --gpu-product "NVIDIA-A100-SXM4-80GB"

Interactive Mode

Launch an interactive job:

kblaunch launch \
    --job-name interactive \
    --interactive

Options

  • --email: User email
  • --job-name: Name of the Kubernetes job [required]
  • --docker-image: Docker image (default: "nvcr.io/nvidia/cuda:12.0.0-devel-ubuntu22.04")
  • --namespace: Kubernetes namespace (default: "informatics")
  • --queue-name: Kueue queue name
  • --interactive: Run in interactive mode (default: False)
  • --command: Command to run in the container [required if not interactive]
  • --cpu-request: CPU request (default: "1")
  • --ram-request: RAM request (default: "8Gi")
  • --gpu-limit: GPU limit (default: 1)
  • --gpu-product: GPU product (default: "NVIDIA-A100-SXM4-80GB")
  • --secrets-env-vars: List of secret environment variables
  • --local-env-vars: List of local environment variables
  • --load-dotenv: Load environment variables from .env file (default: True)

Features

  • Kubernetes job management
  • Environment variable handling from multiple sources
  • Kubernetes secrets integration
  • GPU job support
  • Interactive mode
  • Automatic job cleanup
  • Slack notifications (when configured)

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

kblaunch-0.1.15.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

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

kblaunch-0.1.15-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file kblaunch-0.1.15.tar.gz.

File metadata

  • Download URL: kblaunch-0.1.15.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.25

File hashes

Hashes for kblaunch-0.1.15.tar.gz
Algorithm Hash digest
SHA256 effc59a4dda7a6868860a832c51cb4d2ebbc3d43b6ab99d2565d26e243130c04
MD5 288ec051278767b7199b4766c13be11e
BLAKE2b-256 06b84863849c77aa2c5770adc307c740a5dc625717ddeb66a4358d3d0d8b8ece

See more details on using hashes here.

File details

Details for the file kblaunch-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: kblaunch-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.25

File hashes

Hashes for kblaunch-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 3349c0376a1eb4b4f7fbbf7ed823ef450df0a59421365652b1f10982a1c6eded
MD5 51ad870398991fc87de081da12c3b463
BLAKE2b-256 1a351225886832535c0bca5e2e7611d3fbd526e5d425e07e1cf578e4aec6e991

See more details on using hashes here.

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