runner

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaulWorkers = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	RunnerConfig

	Log *slog.Logger
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(log *slog.Logger, deps RunnerDeps, cfg RunnerConfig) (*Runner, error)

func (*Runner) Close

func (r *Runner) Close() error

func (*Runner) ContainerdContainerForSandbox

func (r *Runner) ContainerdContainerForSandbox(ctx context.Context, id entity.Id) (containerd.Container, error)

func (*Runner) ContainerdNamespace

func (r *Runner) ContainerdNamespace() string

func (*Runner) Drain

func (r *Runner) Drain(ctx context.Context) error

Drain sets the runner's node status to disabled and stops all running sandboxes

func (*Runner) SetRestartMode added in v0.3.1

func (r *Runner) SetRestartMode(v bool)

SetRestartMode sets whether outboard processes should be preserved when closing. When true, processes like lsvd-server will continue running during server restart.

func (*Runner) SetupControllers

func (r *Runner) SetupControllers(
	ctx context.Context,
	eas *es.EntityAccessClient,
	rs *rpc.Server,
) (
	_ *controller.ControllerManager,
	retErr error,
)

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) error

type RunnerConfig

type RunnerConfig struct {
	Id            string `json:"id" cbor:"id" yaml:"id"`
	ListenAddress string `json:"listen_address" cbor:"listen_address" yaml:"listen_address"`
	Workers       int    `json:"workers" cbor:"workers" yaml:"workers"`
	DataPath      string `json:"data_path" cbor:"data_path" yaml:"data_path"`

	// Optional RPC configuration for advanced setups
	// If not provided, a default insecure connection will be used
	// to connect to the server address.
	Config *clientconfig.Config `json:"config" cbor:"config" yaml:"config"`

	// Optional cloud authentication configuration for disk replication
	CloudAuth *coordinate.CloudAuthConfig `json:"cloud_auth,omitempty" cbor:"cloud_auth,omitempty" yaml:"cloud_auth,omitempty"`
}

type RunnerDeps added in v0.3.0

type RunnerDeps struct {
	CC        *containerd.Client
	Namespace string
	Bridge    string
	Tempdir   string
	Subnet    *netdb.Subnet

	// Network dependencies
	NetServ *network.ServiceManager

	// Observability dependencies
	LogsMaintainer *observability.LogsMaintainer
	LogWriter      observability.LogWriter
	StatusMon      *observability.StatusMonitor

	// Network config
	IPv4Routable    netip.Prefix
	ServicePrefixes []netip.Prefix
	DisableLocalNet bool

	// Resolver
	Resolver netresolve.Resolver

	// Sandbox metrics
	SandboxMetrics *sandbox.Metrics

	// Entity server address for lsvd-server (required for disk operations)
	EntityServerAddr string

	// SkipLSVD skips starting the lsvd-server component (for tests that don't need disk)
	SkipLSVD bool
}

RunnerDeps holds dependencies needed by the Runner to construct controllers.

Jump to

Keyboard shortcuts

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