Skip to content

Managing Clusters

Terminal window
sparkrun cluster list

Shows all saved clusters with their hosts and whether they are the default.

Terminal window
sparkrun cluster show mylab

Displays the cluster’s hosts, description, SSH user, and default status.

Terminal window
sparkrun cluster inspect mylab

Shows the resolved settings — transfer mode, transfer interface, topology, SSH user, cache directories — and checks whether those cache directories exist on each host. The fastest way to diagnose a transfer or permission problem without launching a job.

A cluster can carry container environment variables that apply to every workload launched on it. They sit below recipe env and CLI overrides in precedence: CLI > recipe env > cluster env.

~/.config/sparkrun/clusters/mylab.yaml
env:
HF_TOKEN: "${HF_TOKEN}"
env_file: /home/me/.sparkrun.env

${VAR} references resolve at launch time from env_file — read locally on the control machine and emitted per host, so the file never has to exist on the cluster nodes. Secrets therefore stay in your env file and never land in the cluster YAML.

This block is typically populated by sparkrun cluster import, which maps a legacy CONTAINER_* block into it. Import owns the block and rewrites it wholesale on re-sync.

Terminal window
sparkrun cluster delete mylab

Removes the cluster configuration. Use --force to skip the confirmation prompt. This does not affect running workloads.

Terminal window
sparkrun cluster set-default mylab
Terminal window
sparkrun cluster default
Terminal window
sparkrun cluster unset-default

When a default cluster is set, workload commands (run, stop, logs, status) use it automatically unless --hosts or --cluster is specified.

Terminal window
sparkrun cluster status
sparkrun cluster status --cluster mylab

Shows sparkrun containers running on cluster hosts — container names, images, and status.

Terminal window
sparkrun cluster monitor # Interactive TUI (default)
sparkrun cluster monitor --simple # Plain text output
sparkrun cluster monitor --json # JSON output for scripting

Live-monitors CPU, RAM, and GPU metrics across all hosts in the cluster. The TUI mode (default) uses Textual for a rich terminal interface with progress bars. Press q to quit.

OptionDescription
--clusterTarget a specific cluster
--intervalRefresh interval in seconds (default: 5)
--simplePlain text output instead of TUI
--jsonJSON output for scripting
Terminal window
sparkrun cluster check-job <recipe>

Check whether a specific recipe’s containers are still running across cluster hosts.