scheduler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package scheduler is the placement port (ADR-0017): the control-plane decision of which worker/node runs a function replica. V1 ships a single-node driver (internal/scheduler/singlenode); multi-node bin-packing across registered worker nodes is a driver swap behind this port. The controller's Function reconciler is the caller — this package imports no controller, store, or runtime; placement is decided from the Request alone.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMatchingPlatform = errors.New("no worker node matches the artifact's platforms")

ErrNoMatchingPlatform is wrapped (fault.Invalid) by Schedule when no worker node's platform is in Request.Platforms (ADR-0145).

Functions

This section is empty.

Types

type Placement

type Placement struct {
	WorkerNode v1.ObjectName
}

Placement is the scheduler's decision: which worker/node runs the replica.

type Request

type Request struct {
	Namespace v1.NamespaceName
	Name      v1.ObjectName
	Replica   int
	// Platforms the artifact provides (ADR-0145); empty means any.
	Platforms []v1.OCIPlatform
}

Request identifies a function replica to place. A multi-node driver will extend this with resource fields (from the Function `resources` spec) when it first bin-packs on them; V1 carries no inert fields.

type Scheduler

type Scheduler interface {
	Schedule(ctx context.Context, req Request) (Placement, error)
}

Scheduler decides where a function replica runs. V1 ships a single-node driver; multi-node bin-packing is a driver swap behind this port. Errors are api/fault; the method is ctx-first.

Directories

Path Synopsis
Package schedulercontract is the shared conformance suite for the scheduler.Scheduler port (ADR-0017, ADR-0145): Run asserts the port guarantee against any driver — a valid request yields a non-empty Placement.WorkerNode and no error, unless it lists artifact platforms none of which the driver's node runs.
Package schedulercontract is the shared conformance suite for the scheduler.Scheduler port (ADR-0017, ADR-0145): Run asserts the port guarantee against any driver — a valid request yields a non-empty Placement.WorkerNode and no error, unless it lists artifact platforms none of which the driver's node runs.
Package singlenode is the single-node scheduler driver (ADR-0017): it places every function replica on one configured local worker — deterministic, and total except for an artifact built for other platforms than the node's (ADR-0145).
Package singlenode is the single-node scheduler driver (ADR-0017): it places every function replica on one configured local worker — deterministic, and total except for an artifact built for other platforms than the node's (ADR-0145).

Jump to

Keyboard shortcuts

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