Add basic checkpoint and restore support

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2015-12-03 16:07:53 -08:00
parent c1eb9ac90b
commit ae9b2bafd5
9 changed files with 231 additions and 29 deletions

View file

@ -2,6 +2,7 @@ package runtime
import (
"os"
"time"
"github.com/opencontainers/specs"
)
@ -11,6 +12,7 @@ type Process interface {
Spec() specs.Process
Signal(os.Signal) error
}
type Status string
const (
@ -27,6 +29,16 @@ type Stdio struct {
Stdout string `json:"stdout,omitempty"`
}
type Checkpoint struct {
Timestamp time.Time `json:"timestamp,omitempty"`
Path string `json:"path,omitempty"`
Name string `json:"name,omitempty"`
Tcp bool `json:"tcp"`
UnixSockets bool `json:"unixSockets"`
Shell bool `json:"shell"`
Running bool `json:"running,omitempty"`
}
type Container interface {
// ID returns the container ID
ID() string
@ -50,4 +62,10 @@ type Container interface {
Resume() error
// Pause pauses a running container
Pause() error
Checkpoints() ([]Checkpoint, error)
Checkpoint(Checkpoint) error
Restore(path, name string) error
}