Documentation
¶
Index ¶
- Constants
- func ByteToString(b int64) string
- func ReadContainerCheckpointDeletedFiles(checkpointDirectory string) ([]string, string, error)
- func ReadContainerCheckpointSpecDump(checkpointDirectory string) (*spec.Spec, string, error)
- func ReadJSONFile(v interface{}, dir, file string) (string, error)
- func WriteJSONFile(v interface{}, dir, file string) (string, error)
- type ContainerConfig
- type ContainerdStatus
- type KubernetesCheckpoint
- type KubernetesContainerCheckpointMetadata
- type Spec
Constants ¶
View Source
const ( // CheckpointAnnotationEngine specifies the name of the container engine (e.g., podman, cri-o). CheckpointAnnotationEngine = "org.criu.checkpoint.engine.name" // CheckpointAnnotationEngineVersion specifies the version of the container engine. CheckpointAnnotationEngineVersion = "org.criu.checkpoint.engine.version" // CheckpointAnnotationName specifies the name of the container associated with the checkpoint. CheckpointAnnotationName = "org.criu.checkpoint.container.name" // CheckpointAnnotationPod specifies the name of the pod associated with the checkpoint. CheckpointAnnotationPod = "org.criu.checkpoint.pod.name" // CheckpointAnnotationPodID specifies the ID of the pod associated with the checkpoint. CheckpointAnnotationPodID = "org.criu.checkpoint.pod.id" // CheckpointAnnotationNamespace specifies the namespace of the pod associated with the checkpoint. CheckpointAnnotationNamespace = "org.criu.checkpoint.pod.namespace" // CheckpointAnnotationRootfsImageName specifies the name of the root filesystem image associated with the checkpoint. CheckpointAnnotationRootfsImageName = "org.criu.checkpoint.rootfsImageName" // CheckpointAnnotationRootfsImageUserRequested specifies the name of the root filesystem image requested by the user. CheckpointAnnotationRootfsImageUserRequested = "org.criu.checkpoint.rootfsImageUserRequested" // CheckpointAnnotationRootfsImageSha specifies the SHA hash of the root filesystem image associated with the checkpoint. CheckpointAnnotationRootfsImageSha = "org.criu.checkpoint.rootfsImageSha" // CheckpointAnnotationRootfsImageID specifies the ID of the root filesystem image associated with the checkpoint. CheckpointAnnotationRootfsImageID = "org.criu.checkpoint.rootfsImageID" // CheckpointAnnotationRawImageName specifies the original unprocessed name of the image used to create the container. CheckpointAnnotationRawImageName = "org.criu.checkpoint.rawImageName" // CheckpointAnnotationRuntimeName specifies the runtime used on the host where the checkpoint was created. CheckpointAnnotationRuntimeName = "org.criu.checkpoint.runtime.name" // CheckpointAnnotationRuntimeVersion specifies the version of the runtime used on the host where the checkpoint was created. CheckpointAnnotationRuntimeVersion = "org.criu.checkpoint.runtime.version" // CheckpointAnnotationCriuVersion specifies the version of CRIU used on the host where the checkpoint was created. CheckpointAnnotationCriuVersion = "org.criu.checkpoint.criu.version" // CheckpointAnnotationConmonVersion specifies the version of conmon used on the host where the checkpoint was created. CheckpointAnnotationConmonVersion = "org.criu.checkpoint.conmon.version" // CheckpointAnnotationHostArch specifies the CPU architecture of the host where the checkpoint was created. CheckpointAnnotationHostArch = "org.criu.checkpoint.host.arch" // CheckpointAnnotationHostKernel specifies the kernel version used by the host where the checkpoint was created. CheckpointAnnotationHostKernel = "org.criu.checkpoint.host.kernel" // CheckpointAnnotationCgroupVersion specifies the cgroup version used by the host where the checkpoint was created. CheckpointAnnotationCgroupVersion = "org.criu.checkpoint.cgroup.version" // CheckpointAnnotationDistributionVersion specifies the name of the host distribution on which the checkpoint was created. // This annotation is particularly useful because some distributions may include non-upstream patches // that can cause CRIU (Checkpoint/Restore in Userspace) to fail. CheckpointAnnotationDistributionName = "org.criu.checkpoint.distribution.name" // CheckpointAnnotationDistributionVersion specifies the version of the host distribution on which the checkpoint was created. CheckpointAnnotationDistributionVersion = "org.criu.checkpoint.distribution.version" )
View Source
const ( // container archive ConfigDumpFile = "config.dump" SpecDumpFile = "spec.dump" StatusDumpFile = "status.dump" NetworkStatusFile = "network.status" CheckpointDirectory = "checkpoint" CheckpointVolumesDirectory = "volumes" DevShmCheckpointTar = "devshm-checkpoint.tar" RootFsDiffTar = "rootfs-diff.tar" DeletedFilesFile = "deleted.files" DumpLogFile = "dump.log" RestoreLogFile = "restore.log" // pod archive PodOptionsFile = "pod.options" PodDumpFile = "pod.dump" // containerd only StatusFile = "status" // CRIU Images PagesPrefix = "pages-" AmdgpuPagesPrefix = "amdgpu-pages-" )
Variables ¶
This section is empty.
Functions ¶
func ByteToString ¶
func ReadJSONFile ¶
func WriteJSONFile ¶
WriteJSONFile marshalls and writes the given data to a JSON file
Types ¶
type ContainerConfig ¶
type ContainerConfig struct {
ID string `json:"id"`
Name string `json:"name"`
RootfsImage string `json:"rootfsImage,omitempty"`
RootfsImageRef string `json:"rootfsImageRef,omitempty"`
RootfsImageName string `json:"rootfsImageName,omitempty"`
OCIRuntime string `json:"runtime,omitempty"`
CreatedTime time.Time `json:"createdTime"`
CheckpointedAt time.Time `json:"checkpointedTime"`
RestoredAt time.Time `json:"restoredTime"`
Restored bool `json:"restored"`
}
This is a reduced copy of what Podman uses to store checkpoint metadata
func ReadContainerCheckpointConfigDump ¶
func ReadContainerCheckpointConfigDump(checkpointDirectory string) (*ContainerConfig, string, error)
type ContainerdStatus ¶
type ContainerdStatus struct {
CreatedAt int64
StartedAt int64
FinishedAt int64
ExitCode int32
Pid uint32
Reason string
Message string
}
func ReadContainerCheckpointStatusFile ¶
func ReadContainerCheckpointStatusFile(checkpointDirectory string) (*ContainerdStatus, string, error)
type KubernetesCheckpoint ¶
type KubernetesCheckpoint struct {
Archive string `json:"archive,omitempty"`
Size int64 `json:"size,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
}
This structure is used by the KubernetesContainerCheckpointMetadata structure
type KubernetesContainerCheckpointMetadata ¶
type KubernetesContainerCheckpointMetadata struct {
PodFullName string `json:"podFullName,omitempty"`
ContainerName string `json:"containerName,omitempty"`
TotalSize int64 `json:"totalSize,omitempty"`
Checkpoints []KubernetesCheckpoint `json:"checkpoints"`
}
This structure is the basis for Kubernetes to track how many checkpoints for a certain container have been created.
Click to show internal directories.
Click to hide internal directories.