spoke

package
v0.1.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package spoke implements the llmbox-spoke command tree: running a spoke that joins a hub and serves boxes against the local Docker daemon. The one-time join tokens a hub issues to enroll spokes are managed by the hub instead (see the llmbox-server `token` command). The cmd/llmbox-spoke binary is a thin main that builds this command via NewRootCmd and executes it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoxLimits added in v0.0.47

func BoxLimits(b boxconfig.BoxConfig) sandbox.Limits

BoxLimits converts a box config block into the per-box sandbox.Limits, translating the operator-friendly units (mebibytes, gibibytes, fractional CPUs) into the raw byte / nano-CPU counts the backends consume. A zero field stays zero (unlimited) so the conversion preserves "no limit" semantics. It lives on the spoke because only the spoke turns a box config into the sandbox limits its backend consumes.

@arg b The box resource configuration (from YAML on the hub, or flags on the spoke). @return sandbox.Limits The equivalent per-box caps and max-box ceiling.

@testcase TestBoxLimitsConvertsUnits converts mebibytes and CPUs to bytes and nano-CPUs.

func NewRootCmd

func NewRootCmd(name, version string) *cobra.Command

NewRootCmd builds the llmbox-spoke command tree: a `docker` and a `firecracker` subcommand each run a spoke that joins a hub and serves boxes on that backend — each carrying only that backend's flags, never a mix. The spoke reads no config file — every setting is a flag — so a host can run the single command the admin UI generates. Join tokens are managed on the hub (the llmbox-server `token` command), not here. The binary name and version shown by the command are passed in by the cmd/llmbox-spoke main.

@arg name The command name shown in usage (the binary name). @arg version The version string reported by --version. @return *cobra.Command The configured root command with its docker and firecracker subcommands.

@testcase TestNewRootCmd checks the command wiring (per-backend flags and subcommands).

Types

This section is empty.

Directories

Path Synopsis
box
Package box holds the backend-neutral box manager.
Package box holds the backend-neutral box manager.
backend
Package backend is the registry that decouples box-backend selection from the composition roots.
Package backend is the registry that decouples box-backend selection from the composition roots.
conformance
Package conformance provides the backend-neutral behavioural contract for box provisioners (Run) and an in-process Fake provisioner that satisfies it without Docker.
Package conformance provides the backend-neutral behavioural contract for box provisioners (Run) and an in-process Fake provisioner that satisfies it without Docker.
Package boxapi serves the box-facing port-publishing API: a small HTTP/JSON API on a per-box unix socket that lets the workload inside a box open, close, and list public URLs for ports of ITS OWN box only.
Package boxapi serves the box-facing port-publishing API: a small HTTP/JSON API on a per-box unix socket that lets the workload inside a box open, close, and list public URLs for ports of ITS OWN box only.
Package docker implements a box.Provisioner backed by the Docker Engine API.
Package docker implements a box.Provisioner backed by the Docker Engine API.
Package firecracker implements a box.Provisioner backed by Firecracker microVMs.
Package firecracker implements a box.Provisioner backed by Firecracker microVMs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL