cermanager

package module
v0.0.0-...-03f4643 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

CER-Manager

CER-Manager(Container External Resources Manager) is a service to manage external resources such as namespace and checkpoint files for containers.

Build & Install

# make
# make install

Prerequisite

Update containerd, runc and criu with patches from branch diffs.

Build and install the updated binaries according to the instructions given in the corresponding project.

Build and install criu

Build and install containerd

Build and install runc

Usage

Use containerd to start a container

# ctr run -d --rm IMAGE_NAME test

Use containerd to checkpoint a running container

# ctr c checkpoint --rw --image --task test CHECKPOINT_NAME

Create the config file for cer-manager

## create the root directory if not exist
# mkdir -p /var/lib/cermanager 
# cat <<EOF > /var/lib/cermanager/namespace_service.json
{
    "containerd_checkpoints":[
        {
            "name":"CHECKPOINT_NAME",
            "namespace":"default"
        }
    ],
    "default_capacity":10
}

The namespace_service.json contains the name of the container checkpoint that needs to be managed by cer-manager and the namespace to which the checkpoint it belongs. The field default_capacity indicates the number of isolation resources initially available for each checkpoint.

Start the cer-manager

# cermanager [--debug] start

Restore a container

Restore a container from the checkpoint with the isolation resources provided by cer-manager.

# ctr c restore --live --external-ns ipc --external-ns uts --external-ns mnt [--external-checkpoint] CHECKPOINT_NAME test-restore

The flag --external-checkpoint prompts containerd to use the checkpoint resources provided by cer-manager instead of temporarily decompressing the checkpoint when restoring the container

Documentation

Index

Constants

View Source
const (
	ServiceTypePrefixLen int    = 2
	ServiceTypeMax       uint16 = math.MaxUint16
)

Variables

View Source
var Type2Services = map[ServiceType]string{
	NamespaceService:  "namespace",
	CheckpointService: "checkpoint",
	HttpService:       "http",
}

Functions

This section is empty.

Types

type ServiceType

type ServiceType uint16
const (
	NamespaceService ServiceType = iota + 10
	CheckpointService
	HttpService
)

Jump to

Keyboard shortcuts

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