Documentation
¶
Index ¶
- Constants
- func CheckpointRuntimeWorkspace(workspace, checkpointName string) (string, error)
- func PromoteRuntimeWorkspace(workspace, stagedWorkspace string) (rollback func() error, commit func() error, err error)
- func StageRuntimeWorkspaceRestore(workspace, checkpointName, snapshot string) (string, func(), error)
- type DockerManager
- func (dm *DockerManager) Checkpoint(_ context.Context, pid, checkpointName string) (string, error)
- func (dm *DockerManager) CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, ...) (*schema.InstanceInfo, error)
- func (dm *DockerManager) ExecInstance(context.Context, string, []string, string) (string, error)
- func (dm *DockerManager) GetInstance(pid string) (*schema.InstanceInfo, error)
- func (dm *DockerManager) RemoveInstance(ctx context.Context, pid string) error
- func (dm *DockerManager) Restore(_ context.Context, pid, checkpointName, snapshot string) error
- func (dm *DockerManager) StartInstance(ctx context.Context, pid string) error
- func (dm *DockerManager) StopInstance(ctx context.Context, pid string) error
- type IRuntimeManager
- type SandboxManager
- func (sm *SandboxManager) Checkpoint(_ context.Context, pid, checkpointName string) (string, error)
- func (sm *SandboxManager) CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, ...) (*schema.InstanceInfo, error)
- func (sm *SandboxManager) ExecInstance(ctx context.Context, pid string, env []string, command string) (string, error)
- func (sm *SandboxManager) GetInstance(pid string) (*schema.InstanceInfo, error)
- func (sm *SandboxManager) RemoveInstance(ctx context.Context, pid string) error
- func (sm *SandboxManager) Restore(_ context.Context, pid, checkpointName, snapshot string) error
- func (sm *SandboxManager) StartInstance(ctx context.Context, pid string) error
- func (sm *SandboxManager) StopInstance(ctx context.Context, pid string) error
Constants ¶
View Source
const (
ContainerNamePrefix = "hymatrix_"
)
Variables ¶
This section is empty.
Functions ¶
func CheckpointRuntimeWorkspace ¶ added in v0.0.4
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 (*DockerManager) CreateInstance ¶
func (dm *DockerManager) CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, runtimeEnv []string) (*schema.InstanceInfo, error)
func (*DockerManager) ExecInstance ¶
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 (*SandboxManager) CreateInstance ¶
func (sm *SandboxManager) CreateInstance(ctx context.Context, pid string, runtimeSpec schema.RuntimeSpec, runtimeEnv []string) (*schema.InstanceInfo, error)
func (*SandboxManager) ExecInstance ¶
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.