Skip to content
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

cmd/podman: add support for checkpoint images #15868

Merged

Conversation

rst0git
Copy link
Contributor

@rst0git rst0git commented Sep 20, 2022

This pull request extends the podman run command with support for checkpoint images. When podman run is invoked with an image that contains a checkpoint, it would restore the container from that checkpoint.

Example:

podman run -d --name looper busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
podman container checkpoint --create-image checkpoint-image-1 looper
podman rm looper
podman run checkpoint-image-1

Does this PR introduce a user-facing change?

The `podman run` command has been extended with support for checkpoint images.

@openshift-ci openshift-ci bot added release-note do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Sep 20, 2022
@rst0git rst0git force-pushed the podman-run-checkpoint-img branch from ae1c46a to cb0ea68 Compare September 22, 2022 01:30
@rst0git rst0git marked this pull request as ready for review September 23, 2022 08:31
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2022
@rst0git rst0git force-pushed the podman-run-checkpoint-img branch 3 times, most recently from 7957a1a to 8ecfe7b Compare September 23, 2022 09:47
@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2022

@adrianreber PTAL

@rst0git rst0git force-pushed the podman-run-checkpoint-img branch 3 times, most recently from b0834e6 to d2e08c8 Compare September 23, 2022 18:53
@adrianreber
Copy link
Collaborator

@adrianreber PTAL

From my point of view this makes sense. If the checkpoint is part of an OCI image it feels a lot more natural to use run instead of restore. The change is really simple. So 👍 from my side.

@rst0git rst0git force-pushed the podman-run-checkpoint-img branch from d2e08c8 to da32553 Compare September 27, 2022 18:46
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some final nits.

Thanks for working on this!

cmd/podman/containers/restore.go Outdated Show resolved Hide resolved
cmd/podman/containers/run.go Show resolved Hide resolved
cmd/podman/utils/utils.go Show resolved Hide resolved
Podman allows to store a container checkpoints as an images.
This patch makes the check that is used to recognise such checkpoint
images reusable by moving it in utils. This functionality will be reused
in a subsequent patch to extend the `podman run` command with support
for checkpoint images.

Signed-off-by: Radostin Stoyanov <[email protected]>
This patch extends the podman run command with support for checkpoint
images. When `podman run` is invoked with an image that contains
a checkpoint, it would restore the container from that checkpoint.

Example:
    podman run -d --name looper busybox /bin/sh -c \
	    'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'

    podman container checkpoint --create-image checkpoint-image-1 looper

    podman run checkpoint-image-1

Signed-off-by: Radostin Stoyanov <[email protected]>
The `podman run` command has been extended with support for checkpoint
images. A checkpoint image contains image files generated by criu that
allow to restore the runtime state of containerized applications. This
patch adds a test case for this functionality.

Signed-off-by: Radostin Stoyanov <[email protected]>
@rst0git rst0git force-pushed the podman-run-checkpoint-img branch from da32553 to ebff193 Compare September 29, 2022 12:35
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@containers/podman-maintainers PTAL

@rhatdan
Copy link
Member

rhatdan commented Sep 29, 2022

/approve
/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 29, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 29, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, rst0git

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 29, 2022
@rhatdan
Copy link
Member

rhatdan commented Sep 30, 2022

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 30, 2022
@openshift-merge-robot openshift-merge-robot merged commit 5aa194b into containers:main Sep 30, 2022
@rst0git rst0git deleted the podman-run-checkpoint-img branch September 30, 2022 10:18
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants