Skip to main content
Coming Soon — Fully Managed GPU InfrastructureWe’re building automated infrastructure management across cloud providers so your research and MLE teams can run GPU workloads directly in their own cloud accounts without ever thinking about infrastructure. If you’d like early access or want to learn more, reach out at support@usechamber.io.
The client.run() method is designed for scientists and ML practitioners who want to submit GPU workloads without needing expertise in Docker or Kubernetes. Point it at your training project and let the SDK handle the rest.
Install with the run extra to use this feature:

Why Use client.run()?

Traditional GPU workload submission requires:
  1. Writing a Dockerfile optimized for your ML framework
  2. Choosing the right base image (CUDA version, framework version, etc.)
  3. Building and pushing the container image
  4. Authenticating to your container registry
  5. Writing a Kubernetes manifest
  6. Submitting via the API
With client.run(), all of this happens automatically:

What It Does Automatically

1

Framework Detection

Analyzes your requirements.txt to identify PyTorch, TensorFlow, JAX, or other frameworks and selects the optimal NVIDIA NGC base image.
2

Dockerfile Generation

Creates an optimized Dockerfile with proper CUDA configuration, dependency installation, and entrypoint setup.
3

Container Build & Push

Uses docker buildx build --push to build and push in a single efficient step. For AWS ECR and Google Artifact Registry, authentication and repository creation are handled automatically. Pulls the :latest tag to seed the layer cache for faster rebuilds.
4

Kubernetes Manifest

Generates the appropriate manifest (Job or RayJob) with correct GPU resource requests, environment variables, and volume mounts.
5

Workload Submission

Submits the workload to Chamber with proper workload class, priority, and team assignment.

Supported Container Registries

Chamber automatically handles authentication and repository creation for major cloud registries. Just provide your registry URL and the SDK does the rest.

Google Artifact Registry

Full auto-authentication via gcloud CLI. Repositories are created automatically if they don’t exist.

AWS ECR

Full auto-authentication via AWS CLI. Repositories are created automatically if they don’t exist.

Prerequisites

Docker

Docker must be installed and running on your machine. The SDK uses Docker to build and push images.

gcloud CLI

For Google Artifact Registry. Install and run gcloud auth login.

AWS CLI

For AWS ECR. Install and run aws configure.
Setup:
Required IAM Permissions:
  • artifactregistry.repositories.get
  • artifactregistry.repositories.create
  • artifactregistry.repositories.uploadArtifacts

Basic Usage

Minimal Example

With Progress Callbacks

Monitor each stage of the pipeline:

Wait for Completion

Block until the workload finishes:

Registry Configuration

Configure your container registries once and reference them by name. This makes it easy to switch between dev/staging/prod environments.

Setting Up Named Registries

Add registries to ~/.chamber/config.json:
Or configure programmatically:

Using Named Registries

Once configured, use registries by name:

Configuration File

Create a .chamber.yaml file in your project directory to avoid repeating parameters:
Then submit with minimal arguments:

Dry Run (Preview Mode)

Preview exactly what will happen without building or submitting:

Save Generated Files

Inspect the generated Dockerfile and manifest:

Framework Detection

The SDK automatically detects your ML framework from requirements.txt and selects the optimal base image: Override the base image if needed:

Distributed Training

The SDK auto-detects distributed training frameworks and configures the appropriate launch command: Force a specific distributed mode:

Using an Existing Dockerfile

Skip Dockerfile generation and use your own:

Registry Auto-Authentication

The SDK automatically detects your registry type and handles authentication seamlessly. No manual docker login required.
When using Google Artifact Registry, the SDK automatically:
  1. Detects GAR registry URLs (pattern: {region}-docker.pkg.dev/{project}/{repo})
  2. Authenticates Docker using your gcloud CLI credentials
  3. Creates the repository if it doesn’t exist
Supported regions: All GCP regions (us-central1, us-east1, europe-west1, asia-northeast1, etc.)
Ensure your gcloud CLI is authenticated (gcloud auth login) before running.

How It Works

When you call client.run(), the SDK: This means you can switch between registries just by changing the URL—no code changes required.

All Parameters

Error Handling

Configuration Priority

Settings are resolved in this order (highest priority first):
  1. Function argumentsclient.run(..., gpus=8) overrides everything
  2. Project .chamber.yaml — Project-specific settings
  3. Global ~/.chamber/config.json — Default registry and other global settings
  4. Auto-detection — Framework, entrypoint, Python version

Registry Resolution

The registry parameter can be a name or URL:
  1. If it looks like a URL (contains . or /), it’s used as-is
  2. Otherwise, it’s looked up in ~/.chamber/config.json under registries
  3. If not specified, the default_registry from config is used

Caching

The SDK computes a content hash of your project and uses it as the image tag. If the image already exists in the registry, the build and push steps are skipped:
Force a rebuild with no_cache=True:

Docker Build Optimizations

The SDK automatically applies several optimizations to make builds fast:
Why single build+push matters: With Docker Desktop’s containerd image store, a separate docker push can push ALL manifests from multi-platform base images (e.g., 6 manifests for NVIDIA images), causing each layer to be checked 6 times. The buildx build --push approach only pushes what it built — making pushes dramatically faster, especially for large ML images.

Low-Level Build Functions

For advanced use cases, you can access the optimized build functions directly: