Documentation
¶
Index ¶
- Constants
- func CreateControllerContainer(ctx context.Context, dockerClient *client.Client, port uint16, host string, ...) error
- func EnsureControllerImage(ctx context.Context, dockerClient client.ImageAPIClient, gpu gpupkg.GPUSupport, ...) error
- func EnsureModelStorageVolume(ctx context.Context, dockerClient client.VolumeAPIClient, ...) (string, error)
- func FindControllerContainer(ctx context.Context, dockerClient client.ContainerAPIClient) (string, string, container.Summary, error)
- func PruneControllerContainers(ctx context.Context, dockerClient client.ContainerAPIClient, skipRunning bool, ...) error
- func PruneControllerImages(ctx context.Context, dockerClient client.ImageAPIClient, printer StatusPrinter) error
- func PruneModelStorageVolumes(ctx context.Context, dockerClient client.VolumeAPIClient, ...) error
- type StatusPrinter
- type TLSOptions
Constants ¶
const ( // DefaultControllerPortMoby is the default TCP port on which the standalone // controller will listen for requests in Moby environments. DefaultControllerPortMoby = 12434 // DefaultControllerPortCloud is the default TCP port on which the // standalone controller will listen for requests in Cloud environments. DefaultControllerPortCloud = 12435 // DefaultTLSPortMoby is the default TCP port on which the standalone // controller will listen for TLS requests in Moby environments. DefaultTLSPortMoby = 12444 // DefaultTLSPortCloud is the default TCP port on which the standalone // controller will listen for TLS requests in Cloud environments. DefaultTLSPortCloud = 12445 )
const (
// ControllerImage is the image used for the controller container.
ControllerImage = "docker/model-runner"
)
Variables ¶
This section is empty.
Functions ¶
func CreateControllerContainer ¶
func CreateControllerContainer(ctx context.Context, dockerClient *client.Client, port uint16, host string, environment string, doNotTrack bool, gpu gpupkg.GPUSupport, backend string, modelStorageVolume string, printer StatusPrinter, engineKind types.ModelRunnerEngineKind, debug bool, vllmOnWSL bool, proxyCert string, tlsOpts TLSOptions) error
CreateControllerContainer creates and starts a controller container.
func EnsureControllerImage ¶
func EnsureControllerImage(ctx context.Context, dockerClient client.ImageAPIClient, gpu gpupkg.GPUSupport, backend string, printer StatusPrinter) error
EnsureControllerImage ensures that the controller container image is pulled.
func EnsureModelStorageVolume ¶
func EnsureModelStorageVolume(ctx context.Context, dockerClient client.VolumeAPIClient, 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.ContainerAPIClient) (string, string, container.Summary, error)
FindControllerContainer searches for a running controller container. It returns the ID of the container (if found), the container name (if any), the full container summary (if found), or any error that occurred.
func PruneControllerContainers ¶
func PruneControllerContainers(ctx context.Context, dockerClient client.ContainerAPIClient, skipRunning bool, printer StatusPrinter) error
PruneControllerContainers stops and removes any model runner controller containers.
func PruneControllerImages ¶
func PruneControllerImages(ctx context.Context, dockerClient client.ImageAPIClient, printer StatusPrinter) error
PruneControllerImages removes any unused controller container images.
func PruneModelStorageVolumes ¶
func PruneModelStorageVolumes(ctx context.Context, dockerClient client.VolumeAPIClient, printer StatusPrinter) error
PruneModelStorageVolumes removes any unused model storage volume(s).
Types ¶
type StatusPrinter ¶
type StatusPrinter interface {
// Printf should perform formatted printing to stdout.
Printf(format string, args ...any)
// Println should perform line-based printing to stdout.
Println(args ...any)
// PrintErrf should perform formatted printing to stderr.
PrintErrf(format string, args ...any)
// Write implements io.Writer for stream-based output.
Write(p []byte) (n int, err error)
// GetFdInfo returns the file descriptor and terminal status for the output.
GetFdInfo() (fd uintptr, isTerminal bool)
}
StatusPrinter is the interface used to print status updates.
func NoopPrinter ¶
func NoopPrinter() StatusPrinter
NoopPrinter returns a StatusPrinter that does nothing.
type TLSOptions ¶ added in v1.0.9
type TLSOptions struct {
// Enabled indicates whether TLS is enabled.
Enabled bool
// Port is the TLS port (0 to use default).
Port uint16
// CertPath is the path to the TLS certificate file.
CertPath string
// KeyPath is the path to the TLS key file.
KeyPath string
}
TLSOptions holds TLS configuration for the controller container.