runtime

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package runtime defines the OCI-runtime boundary used by the allocator core.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrExecutionMissing means durable allocator state has no matching runtime object.
	ErrExecutionMissing = errors.New("runtime execution is missing")
	// ErrExecutionConflict means a runtime object exists but its authority or specification differs.
	ErrExecutionConflict = errors.New("runtime execution conflicts with durable state")
)
View Source
var ErrLogOffset = errors.New("log offset is outside retained data")
View Source
var ErrLogsMissing = errors.New("logs are missing or expired")
View Source
var ErrTunnelUnsupported = errors.New("runtime cannot dial execution ports")
View Source
var ErrUnavailable = errors.New("OCI runtime is unavailable")

ErrUnavailable reports that an OCI adapter has not been configured yet.

Functions

This section is empty.

Types

type Completion

type Completion struct {
	ExecutionID string
	Err         error
	Detail      string
	ExitCode    *int32
}

Completion reports the terminal runtime outcome for an execution.

type Forgetter added in v0.1.1

type Forgetter interface {
	Forget(context.Context, string) error
}

Forgetter drops only terminal runtime bookkeeping after durable result expiry.

type LogChunk added in v0.1.1

type LogChunk struct {
	Data           []byte
	NextOffset     uint64
	EOF, Truncated bool
}

type LogStore added in v0.1.1

type LogStore interface {
	Read(context.Context, string, string, uint64, uint32) (LogChunk, error)
	Remove(context.Context, string) error
}

type PortDialer added in v0.3.1

type PortDialer interface {
	DialExecution(context.Context, string, uint16) (net.Conn, error)
}

PortDialer connects only to a port inside the specified execution's network namespace. Implementations must never fall back to the allocator's network.

type Recoverer

type Recoverer interface {
	Recover(context.Context, StartRequest, Reporter) error
}

Recoverer reattaches monitoring to an existing execution without creating or restarting a missing workload.

type Reporter

type Reporter func(Completion) error

Reporter applies a terminal runtime outcome to the allocator.

type Resources added in v0.1.1

type Resources struct {
	MemoryBytes int64 `json:"memory_bytes"`
	CPUMilli    int64 `json:"cpu_milli"`
	Pids        int64 `json:"pids"`
}

Resources is an allocator-owned profile, independent of a concrete runtime. All-zero is the legacy unbounded profile; configured profiles must set all limits.

func (Resources) Validate added in v0.1.1

func (r Resources) Validate() error

type Runtime

type Runtime interface {
	Start(context.Context, StartRequest, Reporter) error
	Stop(context.Context, string) error
}

Runtime starts and stops executions idempotently by execution ID.

The context bounds the Start or Stop operation only. A successful Start must not tie the execution lifetime to context cancellation or a network link.

type StartRequest

type StartRequest struct {
	ExecutionID string
	RunID       string
	Attempt     uint64
	Client      []byte
	Workload    *r1sv1.Workload
	Policy      *r1sv1.ExecutionPolicy
	Resources   Resources
	// StartedAt is the durable beginning of local policy timing. Runtimes use
	// the current time when it is zero for compatibility with direct callers.
	StartedAt time.Time
}

StartRequest is an immutable execution specification passed to a runtime.

type Unavailable

type Unavailable struct{}

Unavailable is an explicit placeholder for callers that have not configured a production runtime. It never claims to have started or stopped an execution.

func (Unavailable) Start

func (Unavailable) Stop

Directories

Path Synopsis
Package containerd implements the runtime boundary with the containerd Go client.
Package containerd implements the runtime boundary with the containerd Go client.

Jump to

Keyboard shortcuts

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