Documentation
¶
Index ¶
- Constants
- func CreateControllerContainer(ctx context.Context, dockerClient *client.Client, port uint16, gpu bool, ...) error
- func EnsureControllerImage(ctx context.Context, dockerClient *client.Client, gpu bool, ...) error
- func EnsureModelStorageVolume(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) (string, error)
- func FindControllerContainer(ctx context.Context, dockerClient *client.Client) (string, string, error)
- func PruneControllerContainers(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) error
- func PruneControllerImages(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) error
- func PruneModelStorageVolumes(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) error
- type StatusPrinter
Constants ¶
const (
// ControllerImage is the image used for the controller container.
ControllerImage = "docker/model-runner"
)
const DefaultControllerPort = 12434
DefaultControllerPort is the default TCP port on which the standalone controller will listen for requests.
Variables ¶
This section is empty.
Functions ¶
func CreateControllerContainer ¶
func CreateControllerContainer(ctx context.Context, dockerClient *client.Client, port uint16, gpu bool, modelStorageVolume string, printer StatusPrinter) error
CreateControllerContainer creates and starts a controller container.
func EnsureControllerImage ¶
func EnsureControllerImage(ctx context.Context, dockerClient *client.Client, gpu bool, printer StatusPrinter) error
EnsureControllerImage ensures that the controller container image is pulled.
func EnsureModelStorageVolume ¶
func EnsureModelStorageVolume(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) (string, error)
EnsureModelStorageVolume ensures that a model storage volume exists, creating it if necessary. It returns the name of the storage volume or any error that occurred.
func FindControllerContainer ¶
func FindControllerContainer(ctx context.Context, dockerClient *client.Client) (string, string, error)
FindControllerContainer searches for a running controller container. It returns the ID of the container (if found), the container name (if any), or any error that occurred.
func PruneControllerContainers ¶
func PruneControllerContainers(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) error
PruneControllerContainers stops and removes any model runner controller containers.
func PruneControllerImages ¶
func PruneControllerImages(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) error
PruneControllerImages removes any unused controller container images.
func PruneModelStorageVolumes ¶
func PruneModelStorageVolumes(ctx context.Context, dockerClient *client.Client, printer StatusPrinter) error
PruneModelStorageVolumes removes any unused model storage volume(s).
Types ¶
type StatusPrinter ¶
type StatusPrinter interface {
// Printf should perform formatted printing.
Printf(format string, args ...any)
// Println should perform line-based printing.
Println(args ...any)
}
StatusPrinter is the interface used to print status updates.