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

Basic Usage

Launch a simple job:

kblaunch \
    --email your.email@ed.ac.uk \
    --job-name myjob \
    --command "python script.py"

With Environment Variables

  1. From local environment:

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

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

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

GPU Jobs

Specify GPU requirements:

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

Interactive Mode

Launch an interactive job:

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

Options

  • --email: User email [required]
  • --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]
  • --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-80GB-PCIe")
  • --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.1.tar.gz (75.4 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.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kblaunch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9f783692b5715432a09f4f83e9035554f87a87bda56fa4f4105102c715937ebd
MD5 17f837e6ec957119ef7c3ea71ab6f8da
BLAKE2b-256 220d6726a2614ae5b775f4a282be699c80f913cd8aafb3b5dd91491e2152c43c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kblaunch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db31fd68ee49579d5b7ed551d08f0edc77f227fd4fe692c5ee63fa88edf9c843
MD5 01c4f1f715da960802ae8a80f02f237a
BLAKE2b-256 2ac85f34ea5f5ce3605f432c0c99645df7fedf5bd98ac7a14ed0b6cf96656436

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