Documentation
¶
Overview ¶
Package controller wires informer snapshots and keyed workqueues to the rack, projection, and status reconcilers, and compiles effective runtime state from runtime policies.
Index ¶
- Variables
- type AssignmentSnapshot
- type Controller
- func (c *Controller) AssignmentsForNode(ref mokkav1alpha1.SGPUNodeReference) ([]AssignmentSnapshot, error)
- func (c *Controller) CacheReady() bool
- func (c *Controller) CachesSynced() <-chan struct{}
- func (c *Controller) EffectiveRuntime(assignment AssignmentSnapshot) ([]GPURuntime, error)
- func (c *Controller) LeaderReady() bool
- func (c *Controller) RunCaches(ctx context.Context) error
- func (c *Controller) RunLeader(ctx context.Context) error
- type GPURuntime
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrCacheNotReady = errors.New("controller caches are not ready")
ErrCacheNotReady indicates that the replica has not synchronized its informer stores.
var ErrStaleRuntimeInputs = errors.New("cached runtime inputs do not match the rendered rack")
ErrStaleRuntimeInputs indicates that the cached inventory or profile is not the revision a rack was rendered from. It lasts until the rack re-renders, so callers retry instead of serving state that mixes revisions.
Functions ¶
This section is empty.
Types ¶
type AssignmentSnapshot ¶
type AssignmentSnapshot struct {
Rack *mokkav1alpha1.SGPURack
Node *mokkav1alpha1.SGPURackNode
}
AssignmentSnapshot is one durable rack-slot assignment observed in the informer cache. Node points into Rack, which is a caller-owned deep copy.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller owns process-lifetime informer caches and leader-lifetime workers.
func New ¶
func New(kubeClient kubernetes.Interface, mokkaClient versioned.Interface, options Options) (*Controller, error)
New assembles shared zero-resync informers and all committed reconcilers.
func (*Controller) AssignmentsForNode ¶
func (c *Controller) AssignmentsForNode( ref mokkav1alpha1.SGPUNodeReference, ) ([]AssignmentSnapshot, error)
AssignmentsForNode returns every durable assignment matching an exact Node identity.
func (*Controller) CacheReady ¶
func (c *Controller) CacheReady() bool
CacheReady reports whether synchronized process-lifetime caches are running.
func (*Controller) CachesSynced ¶
func (c *Controller) CachesSynced() <-chan struct{}
CachesSynced is closed after every process-lifetime informer store has synchronized.
func (*Controller) EffectiveRuntime ¶
func (c *Controller) EffectiveRuntime(assignment AssignmentSnapshot) ([]GPURuntime, error)
EffectiveRuntime compiles the effective runtime state of every GPU on an assignment's logical Node: the profile defaults overridden by each accepted runtime policy that selects the GPU. Any replica with synchronized caches can serve it. It returns ErrCacheNotReady before the caches synchronize and an error wrapping ErrStaleRuntimeInputs while the rack's inventory or profile is changing.
func (*Controller) LeaderReady ¶
func (c *Controller) LeaderReady() bool
LeaderReady reports whether leader handlers have replayed and workers are running.
type GPURuntime ¶
type GPURuntime struct {
Index int32
Runtime mokkav1alpha1.RuntimeState
}
GPURuntime is the effective runtime state of one rendered GPU.
type Options ¶
type Options struct {
Workers int
// StatusDebounce is the quiet period before a final status update.
StatusDebounce time.Duration
// StatusProgressInterval bounds status staleness while changes continue.
StatusProgressInterval time.Duration
// LiveNodeGetTimeout bounds the exact GET used when a Node leaves the filtered cache.
LiveNodeGetTimeout time.Duration
}
Options controls worker concurrency and aggregate-status coalescing.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the production controller defaults.