Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AppFs = afero.NewOsFs()
wrapper over filesystem, useful for mocking in tests
Functions ¶
func SetVersionInfo ¶
func SetVersionInfo(version, commit, date string)
Types ¶
type CedanaState ¶
type CedanaState struct {
ClientInfo ClientInfo `json:"client_info" mapstructure:"client_info"`
ProcessInfo ProcessInfo `json:"process_info" mapstructure:"process_info"`
CheckpointType CheckpointType `json:"checkpoint_type" mapstructure:"checkpoint_type"`
// either local or remote checkpoint path (url vs filesystem path)
CheckpointPath string `json:"checkpoint_path" mapstructure:"checkpoint_path"`
// process state at time of checkpoint
CheckpointState CheckpointState `json:"checkpoint_state" mapstructure:"checkpoint_state"`
}
CedanaState encapsulates a CRIU checkpoint and includes filesystem state for a full restore. Typically serialized and shot around over the wire.
func (*CedanaState) SerializeToFolder ¶
func (cs *CedanaState) SerializeToFolder(dir string) error
type CheckpointState ¶
type CheckpointState string
const ( CheckpointSuccess CheckpointState = "CHECKPOINTED" CheckpointFailed CheckpointState = "CHECKPOINT_FAILED" RestoreSuccess CheckpointState = "RESTORED" RestoreFailed CheckpointState = "RESTORE_FAILED" )
type CheckpointType ¶
type CheckpointType string
const ( CheckpointTypeNone CheckpointType = "none" CheckpointTypeCRIU CheckpointType = "criu" CheckpointTypePytorch CheckpointType = "pytorch" )
type Client ¶
func (*Client) AddDaemonLayer ¶
Layers daemon capabilities onto client (adding nats, jetstream and jetstream contexts)
func (*Client) WriteOnlyFds ¶
func (c *Client) WriteOnlyFds(openFds []process.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 ClientInfo ¶
type ClientInfo struct {
Id string `json:"id" mapstructure:"id"`
Hostname string `json:"hostname" mapstructure:"hostname"`
Platform string `json:"platform" mapstructure:"platform"`
OS string `json:"os" mapstructure:"os"`
Uptime uint64 `json:"uptime" mapstructure:"uptime"`
RemainingMemory uint64 `json:"remaining_memory" mapstructure:"remaining_memory"`
}
type CommandChannels ¶
type CommandChannels struct {
// contains filtered or unexported fields
}
type ProcessInfo ¶
type ProcessInfo struct {
PID int32 `json:"pid" mapstructure:"pid"`
AttachedToHardwareAccel bool `json:"attached_to_hardware_accel" mapstructure:"attached_to_hardware_accel"`
OpenFds []process.OpenFilesStat `json:"open_fds" mapstructure:"open_fds"` // list of open FDs
OpenWriteOnlyFilePaths []string `json:"open_write_only" mapstructure:"open_write_only"`
OpenConnections []net.ConnectionStat `json:"open_connections" mapstructure:"open_connections"` // open network connections
MemoryPercent float32 `json:"memory_percent" mapstructure:"memory_percent"` // % of total RAM used
IsRunning bool `json:"is_running" mapstructure:"is_running"`
Status string `json:"status" mapstructure:"status"`
}
type ServerCommand ¶
type ServerCommand struct {
Command string `json:"command" mapstructure:"command"`
Heartbeat bool `json:"heartbeat" mapstructure:"heartbeat"`
CedanaState CedanaState `json:"cedana_state" mapstructure:"cedana_state"`
}
Click to show internal directories.
Click to hide internal directories.