executor

package
v0.0.0-...-b13a440 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package executor provides the top-level checkpoint and restore executors. These wire together the lib packages (criu, cuda, etc.) into multi-step workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkpoint

func Checkpoint(ctx context.Context, ctrd *containerd.Client, log logr.Logger, req CheckpointRequest, cfg *types.AgentConfig) error

Checkpoint performs a CRIU dump of a container. The operation has three phases: inspect, configure, capture.

The checkpoint directory is staged under tmp/<uuid> during the operation. On success, the previous checkpoint is removed and the staged directory is renamed into place at the base path root.

func Restore

func Restore(ctx context.Context, ctrd *containerd.Client, log logr.Logger, req RestoreRequest) (int, error)

Restore performs external restore for the given request. Returns the namespace-relative PID of the restored process. The DaemonSet side inspects the placeholder and launches nsrestore, which handles rootfs application, CRIU restore, and CUDA restore inside the namespace.

Types

type CheckpointRequest

type CheckpointRequest struct {
	ContainerID        string
	ContainerName      string
	CheckpointID       string
	CheckpointLocation string
	StartedAt          time.Time
	NodeName           string
	PodName            string
	PodNamespace       string
	Clientset          kubernetes.Interface
}

CheckpointRequest holds per-checkpoint identifiers for a checkpoint operation.

type RestoreInNamespaceResult

type RestoreInNamespaceResult struct {
	RestoredPID            int           `json:"restoredPID"`
	NSRestoreSetupDuration time.Duration `json:"nsrestoreSetupDuration"`
	CRIURestoreDuration    time.Duration `json:"criuRestoreDuration"`
	CUDADuration           time.Duration `json:"cudaDuration"`
}

func RestoreInNamespace

func RestoreInNamespace(ctx context.Context, opts RestoreOptions, log logr.Logger) (*RestoreInNamespaceResult, error)

RestoreInNamespace performs a full restore from inside the target container's namespaces.

type RestoreOptions

type RestoreOptions struct {
	CheckpointPath string
	CUDADeviceMap  string
	CgroupRoot     string
}

RestoreOptions holds configuration for an in-namespace restore.

type RestoreRequest

type RestoreRequest struct {
	CheckpointID       string
	CheckpointLocation string
	StartedAt          time.Time
	NSRestorePath      string
	PodName            string
	PodNamespace       string
	ContainerName      string
	Clientset          kubernetes.Interface
}

RestoreRequest holds the parameters for a restore operation.

Jump to

Keyboard shortcuts

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