roles

package
v0.0.0-...-f662469 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VSockName = "drafter.drftsock"
)

Variables

View Source
var (
	ErrMissingInitramfs = errors.New("missing initramfs")
	ErrMissingKernel    = errors.New("missing kernel")
	ErrMissingDisk      = errors.New("missing disk")
	ErrMissingState     = errors.New("missing state")
	ErrMissingMemory    = errors.New("missing memory")
	ErrMissingConfig    = errors.New("missing config")
)
View Source
var (
	ErrCouldNotGetDeviceStat         = errors.New("could not get device stat")
	ErrNoRaddrOrPathGivenForResource = errors.New("no raddr or path given for resource")
)
View Source
var (
	ErrVMNotRunning = errors.New("vm not running")
)

Functions

func ArchivePackage

func ArchivePackage(
	stateInputPath string,
	memoryInputPath string,
	initramfsInputPath string,
	kernelInputPath string,
	diskInputPath string,
	configInputPath string,

	packageOutputPath string,

	knownNamesConfiguration config.KnownNamesConfiguration,
) error

func ExtractPackage

func ExtractPackage(
	packageInputPath string,

	stateOutputPath string,
	memoryOutputPath string,
	initramfsOutputPath string,
	kernelOutputPath string,
	diskOutputPath string,
	configOutputPath string,

	knownNamesConfiguration config.KnownNamesConfiguration,
) error

Types

type Deltas

type Deltas struct {
	State     int
	Memory    int
	Initramfs int
	Kernel    int
	Disk      int
	Config    int
}

type Peer

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

func NewPeer

func NewPeer(
	verbose bool,

	claimNamespace func() (string, error),
	releaseNamespace func(namespace string) error,

	hypervisorConfiguration config.HypervisorConfiguration,
	migratorOptions *migration.MigratorOptions,

	hooks PeerHooks,

	cacheBaseDir string,

	raddrs config.ResourceAddresses,
	paths config.ResourceAddresses,
	laddrs config.ResourceAddresses,
	resumeThresholds config.ResourceResumeThresholds,

	resumeTimeout time.Duration,
) *Peer

func (*Peer) Close

func (p *Peer) Close(suspend bool) error

func (*Peer) Connect

func (p *Peer) Connect(ctx context.Context) (*Sizes, error)

func (*Peer) Leech

func (p *Peer) Leech(ctx context.Context) (*Deltas, error)

func (*Peer) Resume

func (p *Peer) Resume(ctx context.Context) (string, error)

func (*Peer) Seed

func (p *Peer) Seed(ctx context.Context) (*config.ResourceAddresses, error)

func (*Peer) Serve

func (p *Peer) Serve() error

func (*Peer) Wait

func (p *Peer) Wait() error

type PeerHooks

type PeerHooks struct {
	OnBeforeSuspend func() error
	OnAfterSuspend  func() error

	OnBeforeStop func() error
	OnAfterStop  func() error

	OnStateLeechProgress     func(remainingDataSize int64) error
	OnMemoryLeechProgress    func(remainingDataSize int64) error
	OnInitramfsLeechProgress func(remainingDataSize int64) error
	OnKernelLeechProgress    func(remainingDataSize int64) error
	OnDiskLeechProgress      func(remainingDataSize int64) error
	OnConfigLeechProgress    func(remainingDataSize int64) error
}

type Runner

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

func NewRunner

func NewRunner(
	hypervisorConfiguration config.HypervisorConfiguration,

	stateName string,
	memoryName string,
) *Runner

func (*Runner) Close

func (r *Runner) Close() error

func (*Runner) Open

func (r *Runner) Open() (string, error)

func (*Runner) Resume

func (r *Runner) Resume(
	ctx context.Context,
	resumeTimeout time.Duration,
	agentVSockPort uint32,
) error

func (*Runner) Suspend

func (r *Runner) Suspend(ctx context.Context, resumeTimeout time.Duration) error

func (*Runner) Wait

func (r *Runner) Wait() error

type Sizes

type Sizes struct {
	State     int64
	Memory    int64
	Initramfs int64
	Kernel    int64
	Disk      int64
	Config    int64
}

type Snapshotter

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

func NewSnapshotter

func NewSnapshotter() *Snapshotter

func (*Snapshotter) CreateSnapshot

func (p *Snapshotter) CreateSnapshot(
	ctx context.Context,

	initramfsInputPath string,
	kernelInputPath string,
	diskInputPath string,

	stateOutputPath string,
	memoryOutputPath string,
	initramfsOutputPath string,
	kernelOutputPath string,
	diskOutputPath string,
	configOutputPath string,

	vmConfiguration config.VMConfiguration,
	livenessConfiguration config.LivenessConfiguration,

	hypervisorConfiguration config.HypervisorConfiguration,
	networkConfiguration config.NetworkConfiguration,
	agentConfiguration config.AgentConfiguration,

	knownNamesConfiguration config.KnownNamesConfiguration,
) error

func (*Snapshotter) Wait

func (r *Snapshotter) Wait() error

Jump to

Keyboard shortcuts

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