runtimefs

package
v2.0.0-beta.15 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package runtimefs archives the filesystem trees a process snapshot depends on: /workspace (compile and JIT caches, mapped .so files), /tmp and /dev/shm (what the engine wrote after the image), taken after the CRIU dump so the link_remap files CRIU leaves next to deleted-but-open files are ordinary members. A PAX tar carries the data; a JSON manifest carries what tar cannot: unix sockets (CRIU recreates them), xattrs and per-file digests.

Index

Constants

View Source
const (
	TypeDir      = "directory"
	TypeFile     = "file"
	TypeHardlink = "hardlink"
	TypeSymlink  = "symlink"
	TypeFifo     = "fifo"
	TypeSocket   = "socket"
)

Entry types.

View Source
const Mark = ".warmctl-receiver"

Mark is a receiver's claim on a tree's directory: written before the install, it is the one entry Install accepts in its destination, and it tells a later restore in the same place that what the directory holds is a restore's, not someone's data on a volume.

View Source
const MaxEntries = 262144

MaxEntries bounds one tree.

View Source
const Schema = "warmctl.runtimefs/v2"

Schema identifies a runtimefs manifest.

Variables

This section is empty.

Functions

func Install

func Install(ctx context.Context, archive, destination string, m Manifest) error

Install unpacks archive into destination, checking every file against the manifest. destination is created, or must be an empty directory (a container's /tmp, /dev/shm or a fresh bind mount) but for Mark. Sockets are left to CRIU, which binds them again.

Types

type Entry

type Entry struct {
	Path   string            `json:"path"`
	Type   string            `json:"type"`
	Link   string            `json:"link,omitempty"`
	Size   int64             `json:"size,omitempty"`
	SHA256 string            `json:"sha256,omitempty"`
	Mode   uint32            `json:"mode"`
	UID    uint32            `json:"uid"`
	GID    uint32            `json:"gid"`
	Mtime  int64             `json:"mtime_ns"`
	Xattrs map[string][]byte `json:"xattrs,omitempty"`
}

Entry is one member of the tree.

type Manifest

type Manifest struct {
	Schema  string  `json:"schema"`
	Root    string  `json:"root"`
	Entries []Entry `json:"entries"`
}

Manifest describes one archived tree and where it lives in the container.

func Read

func Read(name string) (Manifest, error)

Read loads and validates a manifest.

func Snapshot

func Snapshot(ctx context.Context, source, archive, root string) (m Manifest, err error)

Snapshot archives source into a new tar at archive and returns the manifest, with root as the tree's path inside the container.

func (Manifest) Files

func (m Manifest) Files() []Entry

Files lists the regular files and hardlinks.

func (Manifest) Validate

func (m Manifest) Validate() error

Validate checks the manifest's internal consistency.

func (Manifest) Write

func (m Manifest) Write(name string) error

Write stores the manifest as JSON.

Jump to

Keyboard shortcuts

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