EQTY LabDocs

Command Line

Install and configure vcomp-crt-api-cli, and reference for every command it offers.

View as Markdown

vcomp_cli_lite provides two commands:

  • vcomp-cert-cli creates the CA and operator certificates. See Operator Certificates (mTLS).
  • vcomp-crt-api-cli drives a running CRT: it starts and stops jobs, reports their status, imports images and manages registry credentials.

Install

  1. Install Python 3 and pip:

    sh
    sudo apt update
    sudo apt install python3 python3-pip python3.12-venv

    Optionally, create and activate a virtual environment:

    sh
    python3 -m venv vcomp-env
    source vcomp-env/bin/activate
  2. Install vcomp_cli_lite:

    sh
    wget 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:

sh
HOSTNAME="https://{{VM_IP}}:447"
CLIENT_CERT="./operator1.crt"
CLIENT_KEY="./operator1.key"
VariableMeaning
HOSTNAMEThe CRT API address. The API listens on port 447.
CLIENT_CERTYour operator certificate, from Operator Certificates (mTLS).
CLIENT_KEYThe 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

CommandWhat 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.
stopStops the running job. Outputs and proofs stay available under its project_id.
status psLists the job’s containers, like docker compose ps. An empty table means nothing is running.
status logPrints the job’s container logs.
status docker_composePrints 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

CommandWhat it does
imagesLists 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.
pruneDeletes every image that no job is using. This cannot be undone.

To upload a local image, export it first, then import it:

sh
docker save -o test-docker-1.tar test-docker-1:latest
vcomp-crt-api-cli import test-docker-1.tar

After 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

CommandWhat 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-passwordPrints 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:

sh
vcomp-crt-api-cli login ghcr.io bobbyjoe ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Images 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:

sh
# 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/manifest

To upload a file to /input before starting a job:

sh
curl -k --cert operator1.crt --key operator1.key \
  -F "file=@sample.wav" \
  https://{{VM_IP}}:447/files/input

File 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.

  1. Get the password. The username is always admin:

    sh
    vcomp-crt-api-cli filebrowser-password
  2. Open the file browser and log in:

    text
    https://{{VM_IP}}:446
FolderContents
inputFiles every job sees in /input
instance/<project_id>/outputWhat that job wrote to /output
instance/<project_id>/proofIts proof records: the sanitized compose file, attestation report and timestamp

Troubleshooting

“Already running a project”

json
{"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.

sh
vcomp-crt-api-cli stop
vcomp-crt-api-cli stop