api

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppFs = afero.NewOsFs()

wrapper over filesystem, useful for mocking in tests

Functions

func NewBoltConn

func NewBoltConn() (*bolt.DB, error)

func StartGRPCServer

func StartGRPCServer() (*grpc.Server, error)

Types

type Bundle

type Bundle struct {
	ContainerId string
	Bundle      string
}

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 *utils.Criu
	// contains filtered or unexported fields
}

func InstantiateClient

func InstantiateClient() (*Client, error)

func (*Client) ContainerDump

func (c *Client) ContainerDump(dir string, containerId string) error

func (*Client) ContainerRestore

func (c *Client) ContainerRestore(imgPath string, containerId string) error

func (*Client) Dump

func (c *Client) Dump(dir string, pid int32) error

func (*Client) Restore

func (c *Client) Restore(args *task.RestoreArgs) (*int32, error)

func (*Client) RuncDump

func (c *Client) RuncDump(root, containerId string, opts *container.CriuOpts) error

func (*Client) RuncRestore

func (c *Client) RuncRestore(imgPath, containerId string, opts *container.RuncOpts) 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 ClientLogs struct {
	Timestamp string `json:"timestamp"`
	Source    string `json:"source"`
	Level     string `json:"level"`
	Msg       string `json:"msg"`
}

type DB

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

func NewDB

func NewDB() *DB

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 *DB) GetLatestLocalCheckpoints(id string) ([]*string, error)

func (*DB) GetPID

func (db *DB) GetPID(id string) (int32, error)

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 GrpcService interface {
	Register(*grpc.Server) error
}

Unused for now...

type Server

type Server struct {
	Lis net.Listener
	// contains filtered or unexported fields
}

func (*Server) New

func (s *Server) New() (*grpc.Server, error)

type UploadResponse

type UploadResponse struct {
	UploadID  string `json:"upload_id"`
	PartSize  int    `json:"part_size"`
	PartCount int    `json:"part_count"`
}

Directories

Path Synopsis
gpu

Jump to

Keyboard shortcuts

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