Documentation
¶
Overview ¶
Package supervisor owns shared modeld workers and their client sessions.
Index ¶
- type Pool
- type Service
- func (s *Service) Admission(ctx context.Context) (admission.Snapshot, error)
- func (s *Service) ClaimDevices(ctx context.Context, request transport.DeviceClaimRequest) (transport.DeviceClaimResult, error)
- func (s *Service) Close() error
- func (s *Service) CloseClient(ctx context.Context, clientID string) error
- func (s *Service) ConfigureAdmission(ctx context.Context, policy admission.Config) error
- func (s *Service) ConfigureCeilings(ctx context.Context, ceilings map[string]float64) error
- func (s *Service) Describe(ctx context.Context, req transport.OpenSessionRequest) (transport.ModelInfo, error)
- func (s *Service) DiskStats(ctx context.Context) (transport.NodeDiskStats, error)
- func (s *Service) Embed(ctx context.Context, request transport.EmbedRequest) (transport.EmbedResult, error)
- func (s *Service) InspectWorker(ctx context.Context, request transport.WorkerInspectionRequest) (transport.WorkerInspection, error)
- func (s *Service) Inventory(ctx context.Context) (transport.Inventory, error)
- func (s *Service) ListModels(ctx context.Context) ([]transport.NodeModel, error)
- func (s *Service) LoadModel(context.Context, transport.LoadModelRequest) (transport.ActiveModel, error)
- func (s *Service) OpenSession(ctx context.Context, req transport.OpenSessionRequest) (transport.Session, error)
- func (s *Service) ReceiveModel(ctx context.Context, manifest transport.PushManifest, reader io.Reader) (transport.PushResult, error)
- func (s *Service) RemoveModel(ctx context.Context, name string) error
- func (s *Service) RenderMedia(ctx context.Context, request transport.MediaRequest) (transport.MediaResult, error)
- func (s *Service) ResumeAtBoundary(ctx context.Context, permit admission.Permit) error
- func (s *Service) ShutdownOwner(ctx context.Context, request transport.OwnerShutdownRequest) error
- func (s *Service) ShutdownReady() <-chan struct{}
- func (s *Service) Status(ctx context.Context) (transport.DaemonStatus, error)
- func (s *Service) UnloadModel(ctx context.Context, req transport.UnloadModelRequest) error
- func (s *Service) WaitYield(ctx context.Context, permit admission.Permit) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool interface {
Acquire(context.Context, modeldconn.WorkerSpec) (modeldconn.ModeldTarget, func() error, error)
Retire(context.Context, modeldconn.ModeldTarget) error
StopIdle(context.Context, string) error
Snapshot() []modeldconn.WorkerStatus
Status(context.Context) ([]modeldconn.WorkerStatus, error)
Scheduler() admission.Service
Close() error
}
Pool manages owner-controlled children and retains admission until native work ends.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service routes requests through the shared owner's worker pool.
func New ¶
func New(pool Pool, modelsDir, epoch string, inventory func(context.Context) (transport.Inventory, error)) (*Service, error)
New constructs a shared owner with an explicit child pool and model store.
func (*Service) ClaimDevices ¶
func (s *Service) ClaimDevices(ctx context.Context, request transport.DeviceClaimRequest) (transport.DeviceClaimResult, error)
ClaimDevices delegates allocation ownership to the same pool that controls worker termination.
func (*Service) Close ¶
Close stops and joins all owned children before their allocations can be reclaimed.
func (*Service) CloseClient ¶
CloseClient releases unused completion protection without changing worker allocations or another client's sessions.
func (*Service) ConfigureAdmission ¶
ConfigureAdmission changes shared queue policy through the existing scheduler.
func (*Service) ConfigureCeilings ¶
ConfigureCeilings replaces the device ceilings through the existing scheduler.
func (*Service) Describe ¶
func (s *Service) Describe(ctx context.Context, req transport.OpenSessionRequest) (transport.ModelInfo, error)
Describe checks the requested model and allocation in its compatible worker.
func (*Service) Embed ¶
func (s *Service) Embed(ctx context.Context, request transport.EmbedRequest) (transport.EmbedResult, error)
Embed holds admission until native embedding has completed or its worker has stopped.
func (*Service) InspectWorker ¶
func (s *Service) InspectWorker(ctx context.Context, request transport.WorkerInspectionRequest) (transport.WorkerInspection, error)
InspectWorker resolves a child locally and returns its observations through the owner connection.
func (*Service) Inventory ¶
Inventory reports backend availability and devices without allocating a native model.
func (*Service) ListModels ¶
ListModels lists installed artifacts without starting a worker or loading a model.
func (*Service) LoadModel ¶
func (s *Service) LoadModel(context.Context, transport.LoadModelRequest) (transport.ActiveModel, error)
LoadModel requires session-scoped managed execution so another client's allocation cannot be replaced.
func (*Service) OpenSession ¶
func (s *Service) OpenSession(ctx context.Context, req transport.OpenSessionRequest) (transport.Session, error)
OpenSession retains worker admission until the client's native session has closed.
func (*Service) ReceiveModel ¶
func (s *Service) ReceiveModel(ctx context.Context, manifest transport.PushManifest, reader io.Reader) (transport.PushResult, error)
ReceiveModel installs a verified artifact when no worker retains its previous version.
func (*Service) RemoveModel ¶
RemoveModel rejects removal while a shared worker retains the artifact.
func (*Service) RenderMedia ¶
func (s *Service) RenderMedia(ctx context.Context, request transport.MediaRequest) (transport.MediaResult, error)
func (*Service) ResumeAtBoundary ¶
ResumeAtBoundary waits for compute admission while retaining the worker's session permit.
func (*Service) ShutdownOwner ¶
ShutdownOwner refuses active work before stopping and joining idle children.
func (*Service) ShutdownReady ¶
func (s *Service) ShutdownReady() <-chan struct{}
ShutdownReady closes after idle children terminate and the transport may drain.
func (*Service) UnloadModel ¶
UnloadModel releases a selected idle worker while preserving all active client sessions.