Documentation ¶
Index ¶
- Constants
- Variables
- 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 StartServer(cmdCtx context.Context) error
- func WriteJSON(w io.Writer, v interface{}) error
- type Bundle
- type Criu
- 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
Constants ¶
const ( CRIU_DUMP_LOG_FILE = "cedana-dump.log" CRIU_DUMP_LOG_LEVEL = 4 GHOST_LIMIT = 10000000 DUMP_FOLDER_PERMS = 0o777 K8S_RUNC_ROOT = "/run/containerd/runc/k8s.io" DOCKER_RUNC_ROOT = "/run/docker/runtime-runc/moby" )
const ( OUTPUT_FILE_PATH string = "/var/log/cedana-output.log" OUTPUT_FILE_PERMS os.FileMode = 0o777 OUTPUT_FILE_FLAGS int = os.O_WRONLY | os.O_CREATE | os.O_TRUNC )
const ( CRIU_RESTORE_LOG_FILE = "cedana-dump.log" CRIU_RESTORE_LOG_LEVEL = 4 RESTORE_TEMPDIR = "/tmp/cedana_restore" RESTORE_TEMPDIR_PERMS = 0o755 RESTORE_OUTPUT_LOG_PATH = "/var/log/cedana-output-%s.log" )
const ( ADDRESS = "localhost:8080" PROTOCOL = "tcp" CEDANA_CONTAINER_NAME = "binary-container" SERVER_LOG_PATH = "/var/log/cedana-daemon.log" SERVER_LOG_MODE = os.O_APPEND | os.O_CREATE | os.O_WRONLY SERVER_LOG_PERMS = 0o644 SERVER_DB_PATH = "/tmp/cedana.db" )
const ( PROCESS_STREAMING_RATE_SECONDS = 30 LOG_STREAMING_RATE_SECONDS = 10 )
const CHECKPOINT_STATE_FILE = "checkpoint_state.json"
const MaxNameLen = 4096
Variables ¶
var DB_BUCKET_JOBS = []byte("jobs")
Functions ¶
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 StartServer ¶ added in v0.9.104
Takes in a context that allows for cancellation from the cmdline
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 Criu ¶ added in v0.9.5
type Criu struct { }
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
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