overlaybd

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package overlaybd implements the ACR Artifact Streaming compatibility contract currently consumed by the OverlayBD snapshotter.

Index

Constants

View Source
const (
	AnnotationBlobDigest = "containerd.io/snapshot/overlaybd/blob-digest"
	AnnotationBlobSize   = "containerd.io/snapshot/overlaybd/blob-size"
	AnnotationBlobFSType = "containerd.io/snapshot/overlaybd/blob-fs-type"
	AnnotationVersion    = "containerd.io/snapshot/overlaybd/version"

	VersionV1 = "0.1.0"
)

Variables

View Source
var ErrNotArtifactStreaming = errors.New("not an ACR OverlayBD streaming manifest")

Functions

This section is empty.

Types

type BlockMounter

type BlockMounter interface {
	Mount(context.Context, string, []RemoteLayer, string) (io.Closer, error)
}

BlockMounter exposes a bottom-to-top remote layer chain as one mounted read-only filesystem. Closing the result tears down the mount and device.

type LSMTImage

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

LSMTImage overlays ACR layers in manifest order. Later layers have higher precedence, matching OverlayBD's open_files_ro behavior.

func NewLSMTImage

func NewLSMTImage(layers ...*LSMTLayer) (*LSMTImage, error)

func (*LSMTImage) ReadAt

func (i *LSMTImage) ReadAt(p []byte, offset int64) (int, error)

ReadAt reads the merged virtual disk. Holes and zero mappings read as zero.

func (*LSMTImage) Size

func (i *LSMTImage) Size() int64

type LSMTLayer

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

LSMTLayer is one validated read-only OverlayBD v0.1.0 layer.

func OpenLSMTLayer

func OpenLSMTLayer(reader io.ReaderAt, size int64) (*LSMTLayer, error)

OpenLSMTLayer validates and opens one complete ACR-produced OverlayBD layer.

type Layer

type Layer struct {
	DescriptorDigest digest.Digest
	DataDigest       digest.Digest
	Size             int64
	FSType           string
	Version          string
}

Layer is one immutable ACR-produced OverlayBD lower, in manifest order.

type Manifest

type Manifest struct {
	ConfigDigest digest.Digest
	Layers       []Layer
}

Manifest is the validated subset of the ACR Artifact Streaming contract needed to construct a read-only snapshot.

func ParseManifest

func ParseManifest(body []byte) (Manifest, error)

ParseManifest validates the current ACR OverlayBD descriptor contract. Missing optional version and filesystem annotations retain the snapshotter's existing defaults; malformed or partially annotated manifests fail closed.

type Mapping

type Mapping struct {
	Offset  uint64
	Length  uint32
	MOffset uint64
	Zeroed  bool
}

Mapping maps logical sectors to sectors in one sealed LSMT blob.

type NBDDevice

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

NBDDevice exposes a read-only virtual disk through a Linux NBD device.

func AttachNBD

func AttachNBD(path string, reader sizedReaderAt) (*NBDDevice, error)

AttachNBD binds reader to an unused /dev/nbdN device until Close is called.

func (*NBDDevice) Close

func (d *NBDDevice) Close() error

func (*NBDDevice) Path

func (d *NBDDevice) Path() string

type NBDMounter

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

NBDMounter mounts stacked LSMT images through a pool of Linux NBD devices.

func NewNBDMounter

func NewNBDMounter(endpoint string, client *http.Client, deviceGlob string) (*NBDMounter, error)

func (*NBDMounter) Mount

func (m *NBDMounter) Mount(ctx context.Context, id string, remoteLayers []RemoteLayer, mountpoint string) (io.Closer, error)

type RangeReader

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

RangeReader exposes one immutable ACR OverlayBD blob through Gantry's node-local exact-range endpoint.

func NewRangeReader

func NewRangeReader(client *http.Client, endpoint, origin string, size int64) (*RangeReader, error)

NewRangeReader validates the local Gantry endpoint and immutable origin URL.

func (*RangeReader) ReadAt

func (r *RangeReader) ReadAt(p []byte, offset int64) (int, error)

func (*RangeReader) ReadAtContext

func (r *RangeReader) ReadAtContext(ctx context.Context, p []byte, offset int64) (int, error)

ReadAtContext reads one exact range and validates Gantry's response framing.

func (*RangeReader) Size

func (r *RangeReader) Size() int64

Size returns the immutable remote object size.

type RemoteLayer

type RemoteLayer struct {
	Digest   digest.Digest
	Size     int64
	ImageRef string
	FSType   string
}

RemoteLayer describes one ACR-produced OverlayBD layer in manifest order.

type Snapshotter

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

Snapshotter implements the containerd remote snapshot protocol for the existing ACR OverlayBD v0.1.0 contract.

func NewSnapshotter

func NewSnapshotter(root string, mounter BlockMounter) (*Snapshotter, error)

func NewSnapshotterWithFallback

func NewSnapshotterWithFallback(root string, mounter BlockMounter, fallback snapshots.Snapshotter) (*Snapshotter, error)

func (*Snapshotter) Cleanup

func (s *Snapshotter) Cleanup(ctx context.Context) error

func (*Snapshotter) Close

func (s *Snapshotter) Close() error

func (*Snapshotter) Commit

func (s *Snapshotter) Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error

func (*Snapshotter) Mounts

func (s *Snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error)

func (*Snapshotter) Prepare

func (s *Snapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error)

func (*Snapshotter) Remove

func (s *Snapshotter) Remove(ctx context.Context, key string) error

func (*Snapshotter) Stat

func (s *Snapshotter) Stat(ctx context.Context, key string) (info snapshots.Info, err error)

func (*Snapshotter) Update

func (s *Snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (updated snapshots.Info, err error)

func (*Snapshotter) Usage

func (s *Snapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error)

func (*Snapshotter) View

func (s *Snapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error)

func (*Snapshotter) Walk

func (s *Snapshotter) Walk(ctx context.Context, walk snapshots.WalkFunc, filters ...string) error

Jump to

Keyboard shortcuts

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