Skip to main content
Use konduktor exec to run a command in a job’s container, or konduktor shell to open an interactive terminal. Both commands connect through the Hub using your selected Hub Kubernetes credential. You do not need a worker kubeconfig.
Experimental. These commands may change before they stabilize. Hub job execution is disabled by default. Ask your organization administrator or Trainy whether execution is enabled on your Hub and worker before using these commands. Access to job status or logs alone does not grant execution permission.

Select a running job

Follow Submit jobs through Trainy Hub to install the CLI, sign in, and select your assigned Hub namespace. You need an invitation and assigned namespace before login can set up Hub access. Set the context printed by login, then list your jobs:
Use the full job ID from status. The job must have exactly one running Pod. Queued, completed, and suspended jobs have no running target. Jobs with multiple eligible running Pods are rejected because rank selection is not supported.
If you need a job to inspect, save this as shell-demo.yaml. Use your organization’s assigned queue if it differs from user-queue:
Submit it, save the generated job ID as JOB_ID, and wait for the job to run:

Run a command

Put the command and its arguments after --:
The output is the worker Pod’s hostname. For a GPU job whose image includes nvidia-smi, inspect the GPUs with:
exec returns the remote command’s exit code. It passes arguments directly to the executable. To use pipes, variable expansion, or other shell syntax in the container, invoke a shell explicitly and quote the script:
To forward standard input, add --stdin before the job ID:
The command prints hello from stdin and exits when input ends.

Open a shell

From an interactive terminal, run:
The default shell is /bin/bash. If the image has only /bin/sh, select it:
The shell must exist in the job image. Type exit to leave it. Terminal resize updates reach the remote shell, and the CLI restores your local terminal settings when the session ends. exec --tty also allocates a terminal and forwards input. Both shell and exec --tty require interactive standard input and output. To use another Hub namespace you can access, pass --namespace:
If you launched the demo job, suspend it when you finish:

Resolve connection errors

Sessions can end when credentials expire, access is revoked, or job placement changes. Hub, worker, and edge connection limits also bound session duration. If a connection ends before an exit status arrives, the CLI reports an error. Check the job before retrying a command that changes data. For the complete option list, see the exec and shell CLI reference.