Documentation
¶
Index ¶
- Constants
- Variables
- func NewBoltConn() (*bolt.DB, error)
- func SendFile(socket *os.File, file *os.File) error
- func SendRawFd(socket *os.File, msg string, fd uintptr) error
- func StartGPUController(uid, gid uint32, logger *zerolog.Logger) (*exec.Cmd, error)
- func StartGRPCServer() (*grpc.Server, error)
- func WriteJSON(w io.Writer, v interface{}) error
- type Bundle
- type Client
- func (c *Client) ContainerDump(dir string, containerId string) error
- func (c *Client) ContainerRestore(imgPath string, containerId string) error
- func (c *Client) Dump(dir string, pid int32) error
- func (c *Client) Restore(args *task.RestoreArgs) (*int32, error)
- func (c *Client) RuncDump(root, containerId string, opts *container.CriuOpts) error
- func (c *Client) RuncRestore(imgPath, containerId string, isK3s bool, sources []string, ...) error
- func (c *Client) SerializeStateToDir(dir string, state *task.ProcessState) error
- func (c *Client) WriteOnlyFds(openFds []*task.OpenFilesStat, pid int32) []string
- type ClientLogs
- type Criu
- func (c *Criu) Cleanup()
- func (c *Criu) Dump(opts *rpc.CriuOpts, nfy *Notify) (*rpc.CriuResp, error)
- func (c *Criu) GetCriuVersion() (int, error)
- func (c *Criu) IsCriuAtLeast(version int) (bool, error)
- func (c *Criu) PreDump(opts *rpc.CriuOpts, nfy *Notify) (*rpc.CriuResp, error)
- func (c *Criu) Prepare() error
- func (c *Criu) Restore(opts *rpc.CriuOpts, nfy *Notify) (*rpc.CriuResp, error)
- func (c *Criu) SetCriuPath(path string)
- type DB
- func (db *DB) CreateOrUpdateCedanaProcess(id string, state *task.ProcessState) error
- func (db *DB) GetLatestLocalCheckpoints(id string) ([]*string, error)
- func (db *DB) GetPID(id string) (int32, error)
- func (db *DB) GetStateFromID(id string) (*task.ProcessState, error)
- func (db *DB) GetStateFromPID(pid int32) (*task.ProcessState, error)
- func (db *DB) UpdateProcessStateWithID(id string, state *task.ProcessState) error
- func (db *DB) UpdateProcessStateWithPID(pid int32, state *task.ProcessState) error
- type GrpcService
- type KubernetesClient
- type Notify
- func (n Notify) NetworkLock() error
- func (n Notify) NetworkUnlock() error
- func (n Notify) PostDump() error
- func (n Notify) PostRestore(pid int32) error
- func (n Notify) PostResume() error
- func (n Notify) PostSetupNamespaces() error
- func (n Notify) PreDump() error
- func (n Notify) PreRestore() error
- func (n Notify) PreResume() error
- func (n Notify) SetupNamespaces(pid int32) error
- type NotifyFunc
- type OCIBundle
- type Server
- type UploadResponse
Constants ¶
const MaxNameLen = 4096
Variables ¶
var AppFs = afero.NewOsFs()
wrapper over filesystem, useful for mocking in tests
Functions ¶
func NewBoltConn ¶
func SendFile ¶ added in v0.9.5
SendFile sends a file over the given AF_UNIX socket. file.Name() is also included so that if the other end uses RecvFile, the file will have the same name information.
func SendRawFd ¶ added in v0.9.5
SendRawFd sends a specific file descriptor over the given AF_UNIX socket.
func StartGPUController ¶ added in v0.9.5
func StartGRPCServer ¶
func WriteJSON ¶ added in v0.9.5
WriteJSON writes the provided struct v to w using standard json marshaling without a trailing newline. This is used instead of json.Encoder because there might be a problem in json decoder in some cases, see: https://github.com/docker/docker/issues/14203#issuecomment-174177790
Types ¶
type Bundle ¶
The bundle includes path to bundle and the runc/podman container id of the bundle. The bundle is a folder that includes the oci spec config.json as well as the rootfs used for setting up the container. Sometimes rootfs can be defined elsewhere. Podman adds extra directories and files in their bundle including a file called attach which is a unix socket for attaching stdin, stdout to the terminal
type Client ¶
type Client struct {
CRIU *Criu
// contains filtered or unexported fields
}
func InstantiateClient ¶
func (*Client) ContainerRestore ¶
func (*Client) RuncRestore ¶
func (*Client) SerializeStateToDir ¶ added in v0.9.5
func (c *Client) SerializeStateToDir(dir string, state *task.ProcessState) error
func (*Client) WriteOnlyFds ¶
func (c *Client) WriteOnlyFds(openFds []*task.OpenFilesStat, pid int32) []string
WriteOnlyFds takes a snapshot of files that are open (in writeonly) by process PID and outputs full paths. For concurrent processes (multithreaded) this can be dangerous and lead to weird race conditions (maybe). To avoid actually using ptrace (TODO NR) we loop through the openFds of the process and check the flags.
type ClientLogs ¶
type Criu ¶ added in v0.9.5
type Criu struct {
// contains filtered or unexported fields
}
Code for interfacing with CRIU. We could use go-criu, but there are certain limitations in the abstractions presented. Most of the code found here is lifted from https://github.com/checkpoint-restore/go-criu/blob/master/main.go.
func (*Criu) GetCriuVersion ¶ added in v0.9.5
func (*Criu) IsCriuAtLeast ¶ added in v0.9.5
IsCriuAtLeast checks if the version is at least the same as the parameter version
func (*Criu) SetCriuPath ¶ added in v0.9.5
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateOrUpdateCedanaProcess ¶
func (db *DB) CreateOrUpdateCedanaProcess(id string, state *task.ProcessState) error
KISS for now - but we may want to separate out into subbuckets as we add more checkpointing functionality (like incremental checkpointing or GPU checkpointing) structure is default -> xid, xid -> pid: state (arrows denote buckets)
func (*DB) GetLatestLocalCheckpoints ¶
func (*DB) GetStateFromID ¶
func (db *DB) GetStateFromID(id string) (*task.ProcessState, error)
This automatically gets the latest entry in the job bucket
func (*DB) GetStateFromPID ¶
func (db *DB) GetStateFromPID(pid int32) (*task.ProcessState, error)
func (*DB) UpdateProcessStateWithID ¶
func (db *DB) UpdateProcessStateWithID(id string, state *task.ProcessState) error
func (*DB) UpdateProcessStateWithPID ¶
func (db *DB) UpdateProcessStateWithPID(pid int32, state *task.ProcessState) error
type GrpcService ¶
type KubernetesClient ¶ added in v0.9.5
type KubernetesClient struct {
}
type Notify ¶ added in v0.9.5
type Notify struct {
Logger *zerolog.Logger
PreDumpFunc NotifyFunc
PostDumpFunc NotifyFunc
PreRestoreFunc NotifyFunc
PreResumeFunc NotifyFunc
}
func (Notify) NetworkLock ¶ added in v0.9.5
NetworkLock NoNotify
func (Notify) NetworkUnlock ¶ added in v0.9.5
NetworkUnlock NoNotify
func (Notify) PostRestore ¶ added in v0.9.5
PostRestore NoNotify
func (Notify) PostSetupNamespaces ¶ added in v0.9.5
PostSetupNamespaces NoNotify
func (Notify) PreRestore ¶ added in v0.9.5
func (Notify) SetupNamespaces ¶ added in v0.9.5
SetupNamespaces NoNotify
type NotifyFunc ¶ added in v0.9.5
type OCIBundle ¶ added in v0.9.5
type OCIBundle struct {
// ID of the bundle
ID string
// Path to the bundle
Path string
// Namespace of the bundle
Namespace string
}
Bundle represents an OCI bundle