Skip to content

Terminal Access ​

GPU Fleet lets you open a remote shell on a host through the console. The main use is diagnostics: run commands such as nvidia-smi, docker ps and journalctl.

Security ​

The terminal is gated by two factors:

  1. The user's RBAC permission must include gpu-fleet service access (admin).
  2. The host record must have terminalEnabled = true (while claiming or afterwards from the UI).

Every terminal session:

  • Is limited by a TTL (30 minutes by default; changeable in Settings → terminalSessionTtlSeconds).
  • Is written to the audit log (the gpu-fleet.terminal.open event).
  • Closes immediately if the browser or agent connection drops.

Sandbox modes ​

The UI has 3 modes:

docker run --rm -i --network host -v /var/run/docker.sock:/var/run/docker.sock cognipeer/debug-shell:latest /bin/sh -i

  • A shell inside an ephemeral container.
  • The Docker socket is mounted → docker ps and docker logs <...> work.
  • With --network host it can reach the pool/inference endpoints.
  • Limited access to the host file system (only a /host:ro mount; currently fails if the image is not ready).

host ​

/bin/sh -i directly in the agent process's namespace, with root privileges.

  • Full privileges: apt install, systemctl restart, and so on.
  • A wrong command affects the whole machine. Be careful.
  • The audit log records every session open; per-command logging is not covered at the moment.

deployment-exec ​

docker exec -i <containerName> /bin/sh -i

  • Enter the container of a specific deployment.
  • Debugging a vLLM/TGI container, inspecting logs, GPU tests.
  • Fails if the container has no shell (like a debian-slim image).

Usage ​

Host detail → Open terminal:

  1. Pick a sandbox.
  2. For deployment-exec, paste the deployment id (listed on the host detail page).
  3. Open session → the console:
    • Generates a sessionId.
    • Sends an open-terminal-session command to the agent.
    • Returns the WS endpoint URL to the browser.
  4. The browser opens a WebSocket connection.
  5. The agent sees the command, opens its own WS to the console and spawns the shell process.
  6. In the UI, [awaiting agent…] → after a few seconds the prompt appears.

Phase 1 for now

There is no PTY (terminal emulation). It is a plain pipe → vim, htop and less do not work. Commands and their output are fine. The PTY upgrade comes in a later phase (node-pty + xterm.js).

Command examples ​

sh
# GPU inventory
nvidia-smi
nvidia-smi -L
nvidia-smi mig -lgi

# Agent log
journalctl -u cognipeer-gpu-agent -n 100

# Docker
docker ps
docker logs cognipeer-llm-<deploymentId>
docker stats --no-stream

# Disk + memory
df -h
free -h

Session TTL and cleanup ​

  • When the session TTL expires: the console and the agent both close it immediately, and the container/shell gets SIGTERM.
  • If you close the browser tab: WS close → the console session manager cleans up → it kills the agent's shell.
  • If the agent restarts: all open sessions drop.

Audit ​

Every session:

service: gpu-fleet
action: admin
event: gpu-fleet.terminal.open
resourceType: gpu-host
resourceId: <hostId>
metadata: { sandbox, sessionId }

Filter it on the Audit Log page.

Next step ​

→ Troubleshooting — common problems.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub