exec

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigurationFileName = "configuration.yaml"
)

Variables

View Source
var (
	// DirectoryMounts is the list of directories that are mounted by the container runtime and need to be marked as
	// such during checkpoint and restore so that the underlying files can change without breaking the restore process.
	DirectoryMounts = []DirectoryMount{
		{
			Name:             "zoneinfo",
			PathInCheckpoint: "/usr/share/zoneinfo",
			PathInRestore:    "/usr/share/zoneinfo",
		},
		{
			Name:             "null",
			PathInCheckpoint: "/dev/null",
			PathInRestore:    "/dev/null",
		},
		{
			Name:             "random",
			PathInCheckpoint: "/dev/random",
			PathInRestore:    "/dev/random",
		},
		{
			Name:             "urandom",
			PathInCheckpoint: "/dev/urandom",
			PathInRestore:    "/dev/urandom",
		},
		{
			Name:             "tty",
			PathInCheckpoint: "/dev/tty",
			PathInRestore:    "/dev/tty",
		},
		{
			Name:             "zero",
			PathInCheckpoint: "/dev/zero",
			PathInRestore:    "/dev/zero",
		},
		{
			Name:             "full",
			PathInCheckpoint: "/dev/full",
			PathInRestore:    "/dev/full",
		},
	}
)

Functions

func CopyDir

func CopyDir(src, dst string) error

func GetExternalDirectoriesForCheckpoint

func GetExternalDirectoriesForCheckpoint() []string

func GetExternalDirectoriesForRestore

func GetExternalDirectoriesForRestore() []string

func GetKubePodFilePaths

func GetKubePodFilePaths(imageDir string) (map[string]string, error)

func RestoreWithCmd

func RestoreWithCmd(imageDir string) error

func TakeCheckpoint

func TakeCheckpoint(c *criu.Criu, pid int, configuration Configuration) (time.Duration, error)

Types

type Actions

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

func (Actions) NetworkLock

func (a Actions) NetworkLock() error

NetworkLock does nothing.

func (Actions) NetworkUnlock

func (a Actions) NetworkUnlock() error

NetworkUnlock does nothing.

func (Actions) PostDump

func (a Actions) PostDump() error

PostDump does nothing.

func (Actions) PostRestore

func (a Actions) PostRestore(pid int32) error

PostRestore does nothing.

func (Actions) PostResume

func (a Actions) PostResume() error

PostResume does nothing.

func (Actions) PostSetupNamespaces

func (a Actions) PostSetupNamespaces() error

PostSetupNamespaces does nothing.

func (Actions) PreDump

func (a Actions) PreDump() error

PreDump is called when criu is about to dump the process.

func (Actions) PreRestore

func (a Actions) PreRestore() error

PreRestore does nothing.

func (Actions) SetupNamespaces

func (a Actions) SetupNamespaces(_ int32) error

SetupNamespaces does nothing.

type Configuration

type Configuration struct {
	// ImageDir is the directory where the checkpoint is stored. It is expected to be available in the new container as
	// well.
	ImageDir string `json:"imageDir"`

	// NodeStateServerURL is the URL of the node state server. If given, crik will first check if the node is in shutting
	// down state and only then take checkpoint.
	// If not given, crik will always take checkpoint when it receives SIGTERM.
	NodeStateServerURL string `json:"nodeStateServerURL"`

	// AdditionalPaths is the list of paths that are not part of the container's image but were opened by one of the
	// processes in the tree. We need to make sure that these paths are available in the new container as well.
	// The paths are relative to the root of the container's filesystem.
	// Entries can be path to a file or a directory.
	AdditionalPaths []string `json:"additionalPaths,omitempty"`

	// InotifyIncompatiblePaths is the list of paths that are known to cause issues with inotify. We delete those paths
	// before taking the checkpoint.
	InotifyIncompatiblePaths []string `json:"inotifyIncompatiblePaths,omitempty"`
}

Configuration lets crik know about quirks of the processes whose checkpoint is being taken. For example, the files that need to be part of the checkpoint but are not part of the container's image need to be specified here.

func ReadConfiguration

func ReadConfiguration(path string) (Configuration, error)

type DirectoryMount

type DirectoryMount struct {
	Name             string `json:"name"`
	PathInCheckpoint string `json:"pathInCheckpoint"`
	PathInRestore    string `json:"pathInRestore"`
}

Jump to

Keyboard shortcuts

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