-
Notifications
You must be signed in to change notification settings - Fork 706
checkpoint: support checkpoint create command #4484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ChengyuZhu6
wants to merge
9
commits into
containerd:main
Choose a base branch
from
ChengyuZhu6:checkpoint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 tasks
b6e106e
to
fee41f4
Compare
fee41f4
to
c64d77c
Compare
292ceb4
to
c4ed970
Compare
# nerdctl run -d --name test-container ghcr.io/stargz-containers/alpine:3.13-org sleep infinity
b2a7213fd10f898f5af65493692aa2d1c18b9abd26fc477cc2c302170398987d
# nerdctl checkpoint create --leave-running=true --checkpoint-dir /tmp/test-checkpoints test-container test-checkpoint
test-checkpoint
# ls /tmp/test-checkpoints/test-checkpoint/
cgroup.img files.img ipcns-var-11.img pages-1.img tmpfs-dev-49.tar.gz.img tmpfs-dev-55.tar.gz.img
core-1.img fs-1.img mm-1.img pstree.img tmpfs-dev-52.tar.gz.img utsns-12.img
descriptors.json ids-1.img mountpoints-13.img seccomp.img tmpfs-dev-53.tar.gz.img
fdinfo-2.img inventory.img pagemap-1.img timens-0.img tmpfs-dev-54.tar.gz.img |
05cc852
to
61e9bac
Compare
9cf10d0
to
60e5e2e
Compare
AkihiroSuda
reviewed
Oct 12, 2025
AkihiroSuda
reviewed
Oct 12, 2025
AkihiroSuda
reviewed
Oct 12, 2025
AkihiroSuda
reviewed
Oct 12, 2025
AkihiroSuda
reviewed
Oct 12, 2025
AkihiroSuda
reviewed
Oct 12, 2025
fd6d45b
to
702c679
Compare
- Create checkpoints from running containers using containerd APIs - Support both leave-running and exit modes via --leave-running flag - Configurable checkpoint directory via --checkpoint-dir flag Signed-off-by: ChengyuZhu6 <[email protected]>
702c679
to
db6e58f
Compare
AkihiroSuda
reviewed
Oct 15, 2025
AkihiroSuda
reviewed
Oct 15, 2025
add unit tests for checkpoint create command. Signed-off-by: ChengyuZhu6 <[email protected]>
add checkpoint create command reference. Signed-off-by: ChengyuZhu6 <[email protected]>
add checkpoint restore support to container start. e.g.: $ nerdctl run --name cr -d busybox sleep infinity $ nerdctl checkpoint create cr checkpoint1 $ nerdctl start --checkpoint checkpoint cr Signed-off-by: ChengyuZhu6 <[email protected]>
d336c37
to
d93fcb8
Compare
b3976f2
to
d56597d
Compare
AkihiroSuda
reviewed
Oct 16, 2025
ExitCode: 0, | ||
Output: expect.All( | ||
func(_ string, t tig.T) { | ||
// Validate state continuity only: counter should not reset and must keep increasing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this check the in-memory state?
e.g., redis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the test to mount /state
as tmpfs to check the in-memory state.
add unit test for container start with checkpoint. Signed-off-by: ChengyuZhu6 <[email protected]>
add nerdctl start with checkpoint command reference. Signed-off-by: ChengyuZhu6 <[email protected]>
install criu in ci to test checkpoint. Signed-off-by: ChengyuZhu6 <[email protected]>
introduce taskoptions to reduce argument numbers. Otherwise, ci would be failed by: ``` Error: pkg/taskutil/taskutil.go:51:1: argument-limit: maximum number of arguments per function exceeded; max 12 but got 13 func NewTask(ctx context.Context, client *containerd.Client, container containerd.Container, attachStreamOpt []string, isInteractive, isTerminal, isDetach bool, con console.Console, logURI, detachKeys, namespace string, detachC chan<- struct{}, checkpointDir string) ``` Signed-off-by: ChengyuZhu6 <[email protected]>
Currently, nerdctl CI uses docker 28.0.4, while docker version 28.x has a known regression that breaks Checkpoint/Restore functionality. The issue is tracked in the moby/moby project as moby/moby#50750. Signed-off-by: ChengyuZhu6 <[email protected]>
d56597d
to
7bad02a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #4483