Command Line
Install and configure vcomp-crt-api-cli, and reference for every command it offers.
vcomp_cli_lite provides two commands:
vcomp-cert-clicreates the CA and operator certificates. See Operator Certificates (mTLS).vcomp-crt-api-clidrives a running CRT: it starts and stops jobs, reports their status, imports images and manages registry credentials.
Install
-
Install Python 3 and
pip:shsudo apt update sudo apt install python3 python3-pip python3.12-venvOptionally, create and activate a virtual environment:
shpython3 -m venv vcomp-env source vcomp-env/bin/activate -
Install
vcomp_cli_lite:shwget http://node2.e-mesh.net/vcomp_cli_lite-0.0.4-py3-none-any.whl pip3 install vcomp_cli_lite-0.0.4-py3-none-any.whl
Configure the connection
vcomp-crt-api-cli reads its connection settings from a .env file in the current directory.
Enter your CRT’s public IP address to fill it in below:
HOSTNAME="https://{{VM_IP}}:447"
CLIENT_CERT="./operator1.crt"
CLIENT_KEY="./operator1.key"| Variable | Meaning |
|---|---|
HOSTNAME | The CRT API address. The API listens on port 447. |
CLIENT_CERT | Your operator certificate, from Operator Certificates (mTLS). |
CLIENT_KEY | The private key for that certificate. |
Two global options override the file: --env-file <path> reads a different .env file, and
--url <address> overrides HOSTNAME. Both go before the command, for example
vcomp-crt-api-cli --env-file crt2.env status ps.
When the client certificate is loaded, every command first prints
Client authentication certificate.
Commands
Jobs
| Command | What it does |
|---|---|
start <compose-file> | Starts a job from a Docker Compose file and prints its project_id. Returns once images are pulled and containers started, which can take minutes for a large image. The job stops automatically when its containers exit. |
start --no-autostop <compose-file> | Starts a job that keeps running until you stop it. Use this for long-running services such as an API. |
stop | Stops the running job. Outputs and proofs stay available under its project_id. |
status ps | Lists the job’s containers, like docker compose ps. An empty table means nothing is running. |
status log | Prints the job’s container logs. |
status docker_compose | Prints the compose file the runtime is running, including the folders and settings it injects. Secret values are shown. |
cid-compose-file <compose-file> | Prints the content identifier (CID) of a compose file, computed locally, so you can match it against a manifest. |
The CRT runs one job at a time. Stop the current job before starting the next.
Images
| Command | What it does |
|---|---|
images | Lists the images loaded in the runtime. |
import <tarfile.tar> | Uploads a docker save tarball and loads it into the runtime. Uploads in 25 MB chunks with a progress bar. |
prune | Deletes every image that no job is using. This cannot be undone. |
To upload a local image, export it first, then import it:
docker save -o test-docker-1.tar test-docker-1:latest
vcomp-crt-api-cli import test-docker-1.tarAfter the upload finishes, the runtime still has to extract the image. For a large image the progress can appear to stall at the end; wait for the command to return.
Access
| Command | What it does |
|---|---|
login <registry> <username> <password> | Stores credentials for a private container registry, such as ghcr.io. They are not checked when stored, and are lost when the machine reboots. |
login-azure-keyvault <keyvault-name> <secret-name> | Stores registry credentials read from a secret in Azure Key Vault. |
filebrowser-password | Prints the password for the file browser on port 446. The username is admin. The password changes every time the runtime restarts. |
ssl <domain> | Requests a Let’s Encrypt certificate for <domain>. The domain must already point at the CRT and be reachable on port 80, and a job must be running. |
For example, to pull private images from GitHub’s ghcr.io as user bobbyjoe with a GitHub
token:
vcomp-crt-api-cli login ghcr.io bobbyjoe ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxImages from that registry can then be named in a compose file, as they can locally after
docker login.
Files and results
Every container gets three folders: /input (shared by every job), /output and /proof (both
unique to each job). The command line has no download command; fetch results with the file browser
or the web console, or call the API directly with curl and your
operator certificate:
# List a job's output or proof files
curl -k --cert operator1.crt --key operator1.key \
https://{{VM_IP}}:447/files/{{PROJECT_ID}}/output
# Download the signed manifest
curl -k --cert operator1.crt --key operator1.key \
-X POST -o eqty_manifest.json \
https://{{VM_IP}}:447/manifestTo upload a file to /input before starting a job:
curl -k --cert operator1.crt --key operator1.key \
-F "file=@sample.wav" \
https://{{VM_IP}}:447/files/inputFile browser
If the CRT was deployed with Enable file browser, a file browser runs on port 446. It is
handier than curl for moving many files or looking around.
-
Get the password. The username is always
admin:shvcomp-crt-api-cli filebrowser-password -
Open the file browser and log in:
texthttps://{{VM_IP}}:446
| Folder | Contents |
|---|---|
input | Files every job sees in /input |
instance/<project_id>/output | What that job wrote to /output |
instance/<project_id>/proof | Its proof records: the sanitized compose file, attestation report and timestamp |
Troubleshooting
“Already running a project”
{"msg":"Already running a project","project_id":"57be55c0-6d74-4de4-a645-36d5bb4c76cf","status":"error"}A previous job is still running or did not shut down cleanly. Run vcomp-crt-api-cli stop
twice: the first run may return an error, and the second forces any remaining cleanup.
vcomp-crt-api-cli stop
vcomp-crt-api-cli stop