feat: backend executor implement

This commit is contained in:
2026-08-16 17:12:06 +08:00
parent 390e0565d3
commit 7755da72e7
31 changed files with 2762 additions and 184 deletions
+27 -21
View File
@@ -40,40 +40,46 @@ type Mount struct {
// ContainerSpec contains every property controlled by the backend executor.
type ContainerSpec struct {
Name string
ImageReference string
Platform Platform
Environment []string
Labels map[string]string
NetworkMode string
RestartPolicy RestartPolicy
Mounts []Mount
Name string
ImageReference string
Platform Platform
Environment []string
Labels map[string]string
NetworkMode string
RestartPolicy RestartPolicy
Mounts []Mount
User string
StopTimeoutSeconds int
}
// Container is the runtime state required for idempotent inspection.
type Container struct {
ID string
Name string
ImageID string
ImageReference string
Platform string
Running bool
Dead bool
Status string
Environment []string
Labels map[string]string
NetworkMode string
RestartPolicy RestartPolicy
Mounts []Mount
ID string
Name string
ImageID string
ImageReference string
Platform string
Running bool
Dead bool
Status string
Environment []string
Labels map[string]string
NetworkMode string
RestartPolicy RestartPolicy
Mounts []Mount
User string
StopTimeoutSeconds int
}
// Engine is the smallest container runtime API required by an update executor.
type Engine interface {
Ping(context.Context) error
PullImage(context.Context, string) error
LoadImage(context.Context, io.Reader) error
InspectImage(context.Context, string) (Image, error)
CreateContainer(context.Context, ContainerSpec) (Container, error)
StartContainer(context.Context, string) error
StopContainer(context.Context, string) error
InspectContainer(context.Context, string) (Container, error)
RemoveContainer(context.Context, string, bool) error
Close() error