Crates.io | treadmill-cli |
lib.rs | treadmill-cli |
version | 0.1.0 |
source | src |
created_at | 2024-11-04 20:46:54.279611 |
updated_at | 2024-11-04 20:46:54.279611 |
description | CLI client for the Treadmill distributed hardware testbed |
homepage | https://treadmill.ci |
repository | |
max_upload_size | |
id | 1435704 |
size | 90,381 |
Treadmill CLI is a command-line interface tool for interacting with the Treadmill test bench system. It provides functionality for user authentication and job management.
Ensure the CLI tool is in your system path or reference it directly using ./tml
.
./tml [OPTIONS] <SUBCOMMAND>
-c, --config <FILE>
: Sets a custom config file-u, --api-url <URL>
: Sets the API URL directly-v, --verbose
: Enable verbose loggingLogin
./tml login <USERNAME> <PASSWORD>
Job Management
Enqueue a job:
./tml job enqueue <IMAGE_ID> [OPTIONS]
Options for job enqueue:
--ssh-keys <KEYS>
: Comma-separated list of SSH public keys--restart-count <COUNT>
: Remaining restart count--parameters <PARAMS>
: JSON object of job parameters--tag-config <CONFIG>
: Tag configuration--timeout <TIMEOUT>
: Override timeout in secondsList all jobs:
./tml job list
Check job status:
./tml job status <JOB_ID>
Cancel a job:
./tml job cancel <JOB_ID>
The CLI can be configured using a TOML file. You can specify the config file path using the -c
option.
Example configuration:
ssh_keys = "ssh-rsa AAAAB3NzaC1yc2E..., ssh-ed25519 AAAAC3NzaC1lZDI1NTE5..."
[api]
url = "https://swb.treadmill.ci"
The CLI reads SSH keys from multiple sources:
.ssh
directoryIf no SSH keys are provided via the command-line argument, the CLI will automatically attempt to read keys from these sources.
Login:
./tml login fake_user1 FAKEFAKE
Enqueue a job:
./tml job enqueue 46ebc6946f7c4a10922bf1f539cd7351ce8670781e081d18babf1affdef6f577 \
--ssh-keys "ssh-rsa AAAAB3NzaC1yc2E...,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5..." \
--restart-count 3 \
--parameters '{"key1":{"value":"value1","secret":false},"key2":{"value":"value2","secret":true}}' \
--tag-config 'test_tag_config' \
--timeout 3600
List all jobs:
./tml job list
Check job status:
./tml job status <JOB_ID>
Cancel a job:
./tml job cancel <JOB_ID>
To enable verbose logging, add the -v
or --verbose
flag to your command:
./tml -v job enqueue <IMAGE_ID>
This will output debug-level logs, which can be helpful for troubleshooting.
--parameters
option requires a JSON string in the following format:
{
"key1": { "value": "value1", "secret": false },
"key2": { "value": "value2", "secret": true }
}
Each parameter must have a "value" (as a string) and a "secret" (as a boolean) field.For more detailed information about each command and its options, use the --help
flag with any command or subcommand.