layers

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package layers deals with container layer mounting/unmounting for LCOW and WCOW

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHCSLayers

func GetHCSLayers(ctx context.Context, vm *uvm.UtilityVM, paths []string) (layers []hcsschema.Layer, err error)

GetHCSLayers converts host paths corresponding to container layers into HCS schema V2 layers

func MountLCOWLayers added in v0.10.0

func MountLCOWLayers(ctx context.Context, containerID string, layers *LCOWLayers, guestRoot string, vm *uvm.UtilityVM) (_, _ string, _ resources.ResourceCloser, err error)

MountLCOWLayers is a helper for clients to hide all the complexity of layer mounting for LCOW Layer folder are in order: base, [rolayer1..rolayern,] scratch Returns the path at which the `rootfs` of the container can be accessed. Also, returns the path inside the UVM at which container scratch directory is located. Usually, this path is the path at which the container scratch VHD is mounted. However, in case of scratch sharing this is a directory under the UVM scratch.

func MountSandboxVolume added in v0.10.0

func MountSandboxVolume(ctx context.Context, hostPath, volumeName string) (err error)

Mount the sandbox vhd to a user friendly path.

func MountWCOWLayers added in v0.10.0

func MountWCOWLayers(ctx context.Context, containerID string, layerFolders []string, volumeMountPath string, vm *uvm.UtilityVM) (_ string, _ resources.ResourceCloser, err error)

MountWCOWLayers is a helper for clients to hide all the complexity of layer mounting for WCOW. Layer folder are in order: base, [rolayer1..rolayern,] scratch

v1/v2: Argon WCOW: Returns the mount path on the host as a volume GUID.
v1:    Xenon WCOW: Done internally in HCS, so no point calling doing anything here.
v2:    Xenon WCOW: Returns a CombinedLayersV2 structure where ContainerRootPath is a folder
inside the utility VM which is a GUID mapping of the scratch folder. Each of the layers are
the VSMB locations where the read-only layers are mounted.

Job container: Returns the mount path on the host as a volume guid, with the volume mounted on
the host at `volumeMountPath`.

func RemoveSandboxMountPoint added in v0.10.0

func RemoveSandboxMountPoint(ctx context.Context, hostPath string) error

Remove volume mount point. And remove folder afterwards.

Types

type LCOWLayer added in v0.10.0

type LCOWLayer struct {
	VHDPath   string
	Partition uint64
}

type LCOWLayers added in v0.10.0

type LCOWLayers struct {
	// Should be in order from top-most layer to bottom-most layer.
	Layers         []*LCOWLayer
	ScratchVHDPath string
}

Defines a set of LCOW layers. For future extensibility, the LCOWLayer type could be swapped for an interface, and we could either call some method on the interface to "apply" it directly to the UVM, or type cast it to the various types that we support, and use the one it matches. This would allow us to support different "types" of mounts, such as raw VHD, VHD+partition, etc.

Jump to

Keyboard shortcuts

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