containerd

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: 31 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// DefaultAddress is the standard containerd Unix socket.
	DefaultAddress = "/run/containerd/containerd.sock"
	// DefaultNamespace isolates r1s metadata from other containerd consumers.
	DefaultNamespace = "r1s"
)

Variables

View Source
var (
	ErrInvalidConfig     = errors.New("invalid containerd runtime configuration")
	ErrInvalidRequest    = errors.New("invalid containerd start request")
	ErrExecutionConflict = r1sruntime.ErrExecutionConflict
	ErrExecutionMissing  = r1sruntime.ErrExecutionMissing
	ErrClosed            = errors.New("containerd runtime is closed")
)

Functions

func RunLogWriter added in v0.1.1

func RunLogWriter(args []string) bool

RunLogWriter handles the private shim entry point, independent of r1sd lifetime.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter exposes the runtime contract while executionManager owns lifecycle coordination independently of transport connections and caller contexts.

func New

func New(ctx context.Context, config Config) (*Adapter, error)

New connects to containerd and verifies the configured namespace can be used.

func (*Adapter) Close

func (a *Adapter) Close() error

Close releases the containerd client connection. It deliberately does not stop tasks: execution lifetime is independent of the r1sd process lifetime.

func (*Adapter) DialExecution added in v0.3.1

func (a *Adapter) DialExecution(ctx context.Context, executionID string, port uint16) (net.Conn, error)

DialExecution opens a connection only for a live execution tracked by this adapter; its fingerprint binds the backend lookup to the recovered workload.

func (*Adapter) Forget added in v0.1.1

func (a *Adapter) Forget(ctx context.Context, executionID string) error

Forget drops terminal in-memory bookkeeping after durable result expiry.

func (*Adapter) Recover

func (a *Adapter) Recover(ctx context.Context, request r1sruntime.StartRequest, reporter r1sruntime.Reporter) error

Recover reattaches to a matching task without creating or starting one. Missing runtime objects are reported so durable state can be reconciled.

func (*Adapter) Start

func (a *Adapter) Start(ctx context.Context, request r1sruntime.StartRequest, reporter r1sruntime.Reporter) error

Start creates and starts one task. Repeating the same execution ID and specification returns success without creating another container or task.

func (*Adapter) Stop

func (a *Adapter) Stop(ctx context.Context, executionID string) error

Stop terminates and cleans an execution idempotently.

type Config

type Config struct {
	Logs           *logstore.Store
	LogBinary      string
	Address        string
	Namespace      string
	Snapshotter    string
	CleanupTimeout time.Duration
	Now            func() time.Time
}

Config selects the containerd daemon and isolated metadata namespace.

Jump to

Keyboard shortcuts

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