package snapshot

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

Index

Constants

const (
	RoDir = "overlayfs" // overlayfs as rootfs. upper + lower (overlaybd)
	RwDir = "dir"       // mount overlaybd as rootfs
	RwDev = "dev"       // use overlaybd directly

	LayerBlob = "layer" // decompressed tgz layer (maybe compressed by ZFile)
)

Functions

func NewSnapshotter

func NewSnapshotter(bootConfig *BootConfig, opts ...Opt) (snapshots.Snapshotter, error)

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

Types

type BootConfig

type BootConfig struct {
	Address           string                 `json:"address"`
	Root              string                 `json:"root"`
	LogLevel          string                 `json:"verbose"`
	LogReportCaller   bool                   `json:"logReportCaller"`
	RwMode            string                 `json:"rwMode"` // overlayfs, dir or dev
	AutoRemoveDev     bool                   `json:"autoRemoveDev"`
	ExporterConfig    metrics.ExporterConfig `json:"exporterConfig"`
	WritableLayerType string                 `json:"writableLayerType"` // append or sparse
	MirrorRegistry    []Registry             `json:"mirrorRegistry"`
	DefaultFsType     string                 `json:"defaultFsType"`
	RootfsQuota       string                 `json:"rootfsQuota"` // "20g" rootfs quota, only effective when rwMode is 'overlayfs'
	Tenant            int                    `json:"tenant"`      // do not set this if only a single snapshotter service in the host
}

func DefaultBootConfig

func DefaultBootConfig() *BootConfig

type Opt

type Opt func(config *SnapshotterConfig) error

Opt is an option to configure the snapshotter

type Registry

type Registry struct {
	Host     string `json:"host"`
	Insecure bool   `json:"insecure"`
}

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

type ZFileConfig

type ZFileConfig struct {
	Algorithm string `json:"algorithm"`
	BlockSize int    `json:"blockSize"`
}

Source Files

overlay.go storage.go

Version
v1.2.0
Published
Aug 9, 2024
Platform
darwin/amd64
Imports
36 packages
Last checked
9 minutes ago

Tools for package owners.