Skip to main content

Chutes miner CLI

Project description

Chutes Miner CLI

This CLI ships with helpers for managing kubeconfigs when operating miner clusters. This document is the single source of truth for those workflows—other READMEs simply link here to avoid drift.

Quick reference

Question Answer
Where do the commands run? On the machine where you execute chutes-miner-cli. Nothing is copied anywhere else automatically.
Default output path ~/.kube/chutes.config unless you pass --path.
How do I point kubectl at it? export KUBECONFIG=~/.kube/chutes.config or kubectl --kubeconfig ~/.kube/chutes.config ....
Can I push it to another host? Yes, but you must copy it yourself (example below).

sync-kubeconfig

Fetches the merged kubeconfig for all nodes that have already been registered with the miner API.

chutes-miner-cli sync-kubeconfig \
	--hotkey ~/.bittensor/wallets/<wallet>/hotkeys/<hotkey>.json \
	--miner-api http://127.0.0.1:32000 \
	--path ~/.kube/chutes.config   # optional, defaults to this value
  1. Signs the request with your miner hotkey.
  2. Calls GET /servers/kubeconfig on the miner API.
  3. Writes the returned kubeconfig to the local filesystem, creating parent directories as needed and overwriting the target file.

After syncing:

export KUBECONFIG=~/.kube/chutes.config
kubectl config get-contexts
kubectl --namespace chutes get pods

Important: KUBECONFIG must include the path you wrote to, otherwise kubectl keeps using whatever file it was already pointed at.

sync-node-kubeconfig

Fetches a single context directly from a node before it has been added to the miner database. The CLI talks to the agent on that node at /config/kubeconfig, extracts the requested context, and merges it into your local kubeconfig.

chutes-miner-cli sync-node-kubeconfig \
	--agent-api https://10.0.0.5:8443 \
	--context-name chutes-miner-gpu-0 \
	--hotkey ~/.bittensor/wallets/<wallet>/hotkeys/<hotkey>.json \
	--path ~/.kube/chutes.config \
	--overwrite               # optional, required if the context already exists

Behavior highlights:

  • Requires the same signed request headers as the miner API (purpose="registration", management mode).
  • Parses the returned kubeconfig, finds the specified context, and copies only the context/cluster/user bundle.
  • Refuses to replace existing entries unless --overwrite is provided, which helps prevent accidental credential swaps.

Copying the kubeconfig elsewhere

Both commands only touch the local filesystem. To make the synced kubeconfig available on another host, copy it manually. Example helper function:

sync_control_kubeconfig() {
	local local_cfg=${1:-$HOME/.kube/chutes.config}
	local remote_user=${2:-ubuntu}
	local remote_host=${3:-chutes-miner-cpu-0}
	local remote_path=${4:-.kube/chutes.config}

	if [ ! -f "$local_cfg" ]; then
		echo "Local kubeconfig not found at $local_cfg" >&2
		return 1
	fi

	echo "Copying $local_cfg to $remote_user@$remote_host:$remote_path"
	scp "$local_cfg" "$remote_user@$remote_host:$remote_path"
	ssh "$remote_user@$remote_host" "chmod 600 $remote_path && export KUBECONFIG=$remote_path && kubectl config get-contexts"
}

Usage:

sync_control_kubeconfig                             # uses defaults above
sync_control_kubeconfig ~/.kube/chutes.config admin my-control-node ~/.kube/chutes.config

Feel free to swap scp for rsync, add SSH options, or integrate with your automation tooling.

Verification checklist

  • chutes-miner-cli sync-kubeconfig ... or sync-node-kubeconfig ... exits successfully.
  • stat ~/.kube/chutes.config shows a recent timestamp.
  • KUBECONFIG (or --kubeconfig) points to the path you just wrote.
  • kubectl config get-contexts lists the expected contexts (control plane + all tracked nodes, plus any manual additions).
  • Optional: run sync_control_kubeconfig to push the file to servers that need it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chutes_miner_cli-0.2.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chutes_miner_cli-0.2.4-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file chutes_miner_cli-0.2.4.tar.gz.

File metadata

  • Download URL: chutes_miner_cli-0.2.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.3 Linux/6.14.0-36-generic

File hashes

Hashes for chutes_miner_cli-0.2.4.tar.gz
Algorithm Hash digest
SHA256 62c8d4fccd16d332298fd447347a23a5696a8dc8753ff7375fa166257fe7ee6b
MD5 8d23f388087c016f2ae94d7990767219
BLAKE2b-256 bf81f7b42d20182d46ea86cdcf23843fa7aa25cf78bdf1ba27f465ff33187b12

See more details on using hashes here.

File details

Details for the file chutes_miner_cli-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: chutes_miner_cli-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.3 Linux/6.14.0-36-generic

File hashes

Hashes for chutes_miner_cli-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5ce7f29718f0e6639db1d5834bf2b995f22e5f9d1249f35a5e0957ba19c1b375
MD5 85e4baa53e6216dc39ed284c91e1447c
BLAKE2b-256 7d8dfe2e174a12eb2fe96a4421ccc4375b672e361a8ee742fd7cee2cb4d79937

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page