vmdocker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerNamePrefix = "hymatrix_"
)

Variables

This section is empty.

Functions

func GetDockerManager

func GetDockerManager() (schema.IDockerManager, error)

GetDockerManager returns the docker manager instance

func Spawn

func Spawn(env vmmSchema.Env) (vm vmmSchema.Vm, err error)

Types

type DockerManager

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

DockerManager handles all Docker operations

func (*DockerManager) Checkpoint

func (dm *DockerManager) Checkpoint(ctx context.Context, pid, checkpointName string) (zipCode string, err error)

func (*DockerManager) CreateContainer

func (dm *DockerManager) CreateContainer(ctx context.Context, pid string, imageInfo schema.ImageInfo) (*schema.ContainerInfo, error)

func (*DockerManager) GetContainer

func (dm *DockerManager) GetContainer(pid string) (*schema.ContainerInfo, error)

func (*DockerManager) RemoveContainer

func (dm *DockerManager) RemoveContainer(ctx context.Context, pid string) error

func (*DockerManager) Restore

func (dm *DockerManager) Restore(ctx context.Context, pid, checkpointName, snapshot string) error

Restore restores a container from a compressed checkpoint snapshot ctx: context for the operation pid: process ID of the container snapshot: compressed checkpoint data returned by Checkpoint function

func (*DockerManager) StartContainer

func (dm *DockerManager) StartContainer(ctx context.Context, pid string) error

func (*DockerManager) StopContainer

func (dm *DockerManager) StopContainer(ctx context.Context, pid string) error

type PortAllocator

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

func NewPortAllocator

func NewPortAllocator(start, end int) *PortAllocator

func (*PortAllocator) Allocate

func (pa *PortAllocator) Allocate() (int, error)

func (*PortAllocator) Release

func (pa *PortAllocator) Release(port int)

type VmDocker

type VmDocker struct {
	Env vmmSchema.Env
	// contains filtered or unexported fields
}

func New

func New(env vmmSchema.Env, nodeAddr string, tags []goarSchema.Tag) (*VmDocker, error)

todo: add cpu, mem

func (*VmDocker) Apply

func (v *VmDocker) Apply(from string, meta vmmSchema.Meta) vmmSchema.Result

func (*VmDocker) Checkpoint

func (v *VmDocker) Checkpoint() (string, error)

func (*VmDocker) Close

func (v *VmDocker) Close() error

func (*VmDocker) Restore

func (v *VmDocker) Restore(snapshot string) error

func (*VmDocker) Run

func (v *VmDocker) Run(cuAddr string, data []byte, tags []goarSchema.Tag) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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