The Cloud Compute Command Line Interface (cccli) is a powerful tool for registering and running cloud computations across multiple compute providers. It supports Docker, AWS Batch, Kubernetes, and Kubernetes Argo Workflows as compute providers.
- Overview
- Installation
- Configuration
- Usage
- Event Generators
- Quick Start Example
- Building from Source
- License
cccli orchestrates cloud compute jobs through a flexible configuration system based on JSON files. Jobs are defined by three key components:
- Compute File: Defines the job name, compute provider, plugins, and event structure
- Plugin Manifest: Specifies the container image, resources, and execution details
- Compute Manifest: Defines the specific commands and parameters for each job execution
Download the latest release from the GitHub repository or build from source (see Building from Source).
The compute file is the main configuration that defines your cloud compute job. Example:
{
"name": "Hello World Test",
"provider": {
"type": "docker",
"concurrency": 1,
"queue": "docker-local"
},
"plugins": ["hello-world-plugin.json"],
"event": {
"compute-manifests": ["hello-world-manifest1.json", "hello-world-manifest2.json"]
}
}Supported Provider Types:
docker- Local Docker provider (auto-registers plugins)awsbatch- AWS Batchk8s- Kubernetesk8sargo- Kubernetes Argo Workflows
Defines the container image and compute resources:
{
"name": "hello-world-plugin",
"image_and_tag": "ghcr.io/usace-cloud-compute/hello-world-plugin:latest",
"description": "Docker Hello World",
"command": ["/runme"],
"compute_environment": {
"vcpu": "1",
"memory": "256"
}
}Specifies the execution details for each job:
{
"plugin_definition": "hello-world-plugin",
"command": ["sleep", "10"],
"depends-on": ["other-manifest.json"]
}The depends-on field allows you to specify dependencies between compute manifests within an event.
Environment variables provide credentials and configuration for the compute provider:
CC_AWS_ACCESS_KEY_ID=your_access_key
CC_AWS_SECRET_ACCESS_KEY=your_secret_key
CC_AWS_DEFAULT_REGION=us-east-1
CC_AWS_S3_BUCKET=compute-store
CC_AWS_ENDPOINT=http://localhost:9000For AWS Batch, use standard AWS credentials. For local development with MinIO (S3-compatible storage), use the MinIO endpoint.
Basic command structure:
cccli [global-flags] <command> [command-flags] [arguments]-c, --computeFile- Path to compute configuration file (default:compute.json)-e, --envFile- Path to environment file for provider credentials
Execute a compute job defined in the compute file.
cccli -c compute.json -e .env run [flags]Flags:
-j, --jobStore- Path to CSV file for storing job identifiers-p, --eventPostProcessor- Path to JavaScript file for post-processing events
Example:
cccli -c data/hello-world/compute.json -e .env run --jobStore=jobs.csvThe job store CSV contains:
- Compute ID (Cloud Compute identifier)
- Event ID (Cloud Compute identifier)
- Job ID (Cloud Compute identifier)
- ComputeProviderJob (Provider-specific job ID)
- Payload GUID (Storage location for job data)
- Event Identifier (String identifier for the event)
Register plugin(s) with the compute provider. By default, registers all plugins referenced in the compute file.
cccli -c compute.json -e .env register [plugin-manifest-file]Examples:
# Register all plugins from compute file
cccli -c data/hello-world/compute.json -e .env register
# Register a single plugin manifest
cccli -e .env register path/to/plugin-manifest.jsonTerminate running jobs at different levels (compute, event, or individual job).
cccli -c compute.json -e .env terminate <level> <id> <message>Arguments:
level- Termination scope:COMPUTE,EVENT, orJOBid- GUID of the compute/event/job to terminatemessage- Reason for termination (recorded by provider)
Example:
cccli -c compute.json -e .env terminate COMPUTE 068ff6fe-d8d9-48af-b897-b937a7e14dae "Cancelling test run"Retrieve logs from a completed or running job.
cccli -c compute.json -e .env log <job-id>Arguments:
job-id- Provider-specific job identifier
Example:
cccli -c compute.json -e .env log 20e84f68-56dc-46fd-b5f3-c2494e4c5f83Query job status summaries at different levels.
cccli -c compute.json -e .env status <level> <id>Arguments:
level- Query level:COMPUTE,EVENT, orJOBid- Identifier to query
Example:
cccli -c compute.json -e .env status COMPUTE 068ff6fe-d8d9-48af-b897-b937a7e14daeOutput format: JobId, StartedAt, StoppedAt, Status, StatusDetail
Export JSON schemas for validation and documentation.
cccli schema <schema-type>Arguments:
schema-type- Type of schema:compute,plugin, or path to compute manifest file
Examples:
# Export compute manifest schema
cccli schema compute
# Export plugin manifest schema
cccli schema plugin
# Generate schema from existing compute file
cccli schema data/hello-world/compute.jsonDisplay version information.
cccli versionEvent generators create multiple job executions from a single compute configuration. Configure generators in the compute file.
Generate events based on a numeric range:
{
"generator": {
"type": "array",
"start": 1,
"end": 2,
"perEventLoop": [
{"ENV1": "value1", "ENV2": "value2"},
{"ENV1": "value3", "ENV2": "value4"}
]
}
}This configuration will generate 4 jobs total (2 events × 2 perEventLoop objects). Each job will have CC_EVENT_NUMBER set to "1" or "2", plus the environment variables from its perEventLoop object.
Enhanced array generator with additional environment variables:
{
"generator": {
"type": "array2",
"start": 1,
"end": 100,
"addEnv": {
"CUSTOM_VAR": "custom_value"
},
"perEventLoop": [
{"ENV1": "value1", "ENV2": "value2"}
]
}
}Generate events from CSV or delimited file data:
{
"generator": {
"type": "stream",
"file": "data/events.csv",
"delimiter": ",",
"perEventLoop": [
{"ENV1": "value1", "ENV2": "value2"}
]
}
}Each row in the CSV file becomes an event.
Generate events for combinations of realizations and blocks:
{
"generator": {
"type": "realzblock",
"startRealz": 1,
"endRealz": 100,
"startBlock": 1,
"endBlock": 50
}
}The addEnv field adds static environment variables to all jobs, while perEventLoop creates job variations.
The perEventLoop parameter is an array of objects that multiplies the number of jobs submitted for each event. For each event generated, cccli will:
- Enumerate through each object in the
perEventLooparray - Add that object's key-value pairs to the job's environment variables
- Submit a separate job with those environment variables
Example: An array event generator with start: 1, end: 2, and a perEventLoop array with 2 objects will submit 4 total jobs:
- Event 1 with perEventLoop object 1
- Event 1 with perEventLoop object 2
- Event 2 with perEventLoop object 1
- Event 2 with perEventLoop object 2
This is useful for running parameter sweeps, multiple configurations, or parallel processing variations of the same computational task.
This example uses Docker and MinIO (local S3-compatible storage) to run a simple "Hello World" computation.
docker compose up- Open
http://localhost:9001in your browser - Login with credentials from
docker-compose.yml - Create a bucket named
compute-store - Create access keys under User > Access Keys
- Create a path
cc_storein the bucket under Object Browser
Create .env with your MinIO credentials:
CC_AWS_ACCESS_KEY_ID=your_minio_access_key
CC_AWS_SECRET_ACCESS_KEY=your_minio_secret_key
CC_AWS_DEFAULT_REGION=us-east-1
CC_AWS_S3_BUCKET=compute-store
CC_AWS_ENDPOINT=http://localhost:9000cccli -c data/hello-world/compute.json -e .env runThe Docker provider automatically registers plugins before execution and waits for all jobs to complete.
- Go 1.25.0 or later
- Git
cd src
# Basic build
go build -o cccli ./cmd
# Build with version information
go build -ldflags "-X main.version=v1.0.0 -X main.commit=$(git describe --tags --always --long) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -o cccli ./cmdThe compiled binary will be created as cccli in the src directory.
- Docker provider automatically registers plugins before running jobs
- Docker provider waits for all jobs to complete before exiting
- Job manifests can specify dependencies using the
depends-onfield - Multiple compute providers can be configured for different environments
- Event post-processors (JavaScript) allow custom modification of event data
MIT License - Copyright (c) 2025 USACE
See LICENSE file for details.