package snapshot

import "github.com/containerd/accelerated-container-image/pkg/snapshot"

Index

Constants

const (
	// LabelSupportReadWriteMode is used to support writable block device
	// for active snapshotter.
	//
	// By default, multiple active snapshotters can share one block device
	// from parent snapshotter(committed). Like image builder and
	// sandboxed-like container runtime(KataContainer, Firecracker), those
	// cases want to use the block device alone or as writable.
	// There are two ways to provide writable devices:
	//  - 'dir' mark the snapshotter
	//    as wriable block device and mount it on rootfs.
	//  - 'dev' mark the snapshotter
	//    as wriable block device without mount.
	LabelSupportReadWriteMode = "containerd.io/snapshot/overlaybd.writable"

	// LabelLocalOverlayBDPath is used to export the commit file path.
	//
	// NOTE: Only used in image build.
	LabelLocalOverlayBDPath = "containerd.io/snapshot/overlaybd.localcommitpath"
)

interface

Functions

func NewSnapshotter

func NewSnapshotter(root string, mode string, opts ...Opt) (snapshots.Snapshotter, error)

NewSnapshotter returns a Snapshotter which uses block device based on overlayFS.

Types

type Opt

type Opt func(config *SnapshotterConfig) error

Opt is an option to configure the snapshotter

type OverlayBDBSConfig

type OverlayBDBSConfig struct {
	RepoBlobURL       string                   `json:"repoBlobUrl"`
	Lowers            []OverlayBDBSConfigLower `json:"lowers"`
	Upper             OverlayBDBSConfigUpper   `json:"upper"`
	ResultFile        string                   `json:"resultFile"`
	AccelerationLayer bool                     `json:"accelerationLayer,omitempty"`
	RecordTracePath   string                   `json:"recordTracePath,omitempty"`
}

OverlayBDBSConfig is the config of overlaybd target.

type OverlayBDBSConfigLower

type OverlayBDBSConfigLower struct {
	File   string `json:"file,omitempty"`
	Digest string `json:"digest,omitempty"`
	Size   int64  `json:"size,omitempty"`
	Dir    string `json:"dir,omitempty"`
}

OverlayBDBSConfigLower

type OverlayBDBSConfigUpper

type OverlayBDBSConfigUpper struct {
	Index string `json:"index,omitempty"`
	Data  string `json:"data,omitempty"`
}

type SnapshotterConfig

type SnapshotterConfig struct {
	// OverlayBDUtilBinDir contains overlaybd-create/overlaybd-commit tools
	// to handle writable device.
	OverlayBDUtilBinDir string `toml:"overlaybd_util_bin_dir" json:"overlaybd_util_bin_dir"`
}

SnapshotterConfig is used to configure the snapshotter instance

Source Files

overlay.go storage.go

Version
v0.5.2
Published
Nov 9, 2022
Platform
darwin/amd64
Imports
24 packages
Last checked
6 minutes ago

Tools for package owners.