runtimemanager

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerNamePrefix = "hymatrix_"
)

Variables

This section is empty.

Functions

func CheckpointRuntimeWorkspace added in v0.0.4

func CheckpointRuntimeWorkspace(workspace, checkpointName string) (string, error)

CheckpointRuntimeWorkspace creates a named workspace snapshot payload.

func PromoteRuntimeWorkspace

func PromoteRuntimeWorkspace(workspace, stagedWorkspace string) (rollback func() error, commit func() error, err error)

PromoteRuntimeWorkspace swaps a staged workspace into the active location. The caller should invoke commit after the restored runtime is healthy, or rollback on failure.

func StageRuntimeWorkspaceRestore

func StageRuntimeWorkspaceRestore(workspace, checkpointName, snapshot string) (string, func(), error)

StageRuntimeWorkspaceRestore validates and unpacks a workspace snapshot into a temporary sibling directory. The caller owns the returned cleanup function and should remove the staged directory if it is not promoted.

Types

type DockerManager

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

func (*DockerManager) Checkpoint

func (dm *DockerManager) Checkpoint(_ context.Context, pid, checkpointName string) (string, error)

func (*DockerManager) CreateInstance

func (dm *DockerManager) CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, runtimeEnv []string) (*schema.InstanceInfo, error)

func (*DockerManager) ExecInstance

func (dm *DockerManager) ExecInstance(context.Context, string, []string, string) (string, error)

func (*DockerManager) GetInstance

func (dm *DockerManager) GetInstance(pid string) (*schema.InstanceInfo, error)

func (*DockerManager) RemoveInstance

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

func (*DockerManager) Restore

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

func (*DockerManager) StartInstance

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

func (*DockerManager) StopInstance

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

type IRuntimeManager

type IRuntimeManager interface {
	CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, runtimeEnv []string) (*schema.InstanceInfo, error)
	GetInstance(pid string) (*schema.InstanceInfo, error)
	RemoveInstance(ctx context.Context, pid string) error
	StartInstance(ctx context.Context, pid string) error
	StopInstance(ctx context.Context, pid string) error
	ExecInstance(ctx context.Context, pid string, env []string, command string) (string, error)
	Checkpoint(ctx context.Context, pid, checkpointName string) (string, error)
	Restore(ctx context.Context, pid, checkpointName, snapshot string) error
}

func GetRuntimeManager

func GetRuntimeManager(backend string) (IRuntimeManager, error)

type SandboxManager

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

func (*SandboxManager) Checkpoint

func (sm *SandboxManager) Checkpoint(_ context.Context, pid, checkpointName string) (string, error)

func (*SandboxManager) CreateInstance

func (sm *SandboxManager) CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, runtimeEnv []string) (*schema.InstanceInfo, error)

func (*SandboxManager) ExecInstance

func (sm *SandboxManager) ExecInstance(ctx context.Context, pid string, env []string, command string) (string, error)

func (*SandboxManager) GetInstance

func (sm *SandboxManager) GetInstance(pid string) (*schema.InstanceInfo, error)

func (*SandboxManager) RemoveInstance

func (sm *SandboxManager) RemoveInstance(ctx context.Context, pid string) error

func (*SandboxManager) Restore

func (sm *SandboxManager) Restore(_ context.Context, pid, checkpointName, snapshot string) error

func (*SandboxManager) StartInstance

func (sm *SandboxManager) StartInstance(ctx context.Context, pid string) error

func (*SandboxManager) StopInstance

func (sm *SandboxManager) StopInstance(ctx context.Context, pid string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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