{"action":"created","comment":{"url":"https://api.github.com/repos/containerd/containerd/pulls/comments/236744928","pull_request_review_id":178883992,"id":236744928,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjc0NDkyOA==","diff_hunk":"@@ -478,14 +481,26 @@ func (l *local) Checkpoint(ctx context.Context, r *api.CheckpointTaskRequest, _\n \tif err != nil {\n \t\treturn nil, err\n \t}\n-\timage, err := ioutil.TempDir(os.Getenv(\"XDG_RUNTIME_DIR\"), \"ctd-checkpoint\")\n+\timage, err := l.getCheckpointPath(container.Runtime.Name, r.Options)\n \tif err != nil {\n-\t\treturn nil, errdefs.ToGRPC(err)\n+\t\treturn nil, err\n+\t}\n+\tjumpImage := true","path":"services/tasks/local.go","position":53,"original_position":53,"commit_id":"4f826e5d74194f7a864809384bedb46999207545","original_commit_id":"4f826e5d74194f7a864809384bedb46999207545","user":{"login":"ehazlett","id":260642,"node_id":"MDQ6VXNlcjI2MDY0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/260642?v=4","gravatar_id":"","url":"https://api.github.com/users/ehazlett","html_url":"https://github.com/ehazlett","followers_url":"https://api.github.com/users/ehazlett/followers","following_url":"https://api.github.com/users/ehazlett/following{/other_user}","gists_url":"https://api.github.com/users/ehazlett/gists{/gist_id}","starred_url":"https://api.github.com/users/ehazlett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehazlett/subscriptions","organizations_url":"https://api.github.com/users/ehazlett/orgs","repos_url":"https://api.github.com/users/ehazlett/repos","events_url":"https://api.github.com/users/ehazlett/events{/privacy}","received_events_url":"https://api.github.com/users/ehazlett/received_events","type":"User","site_admin":false},"body":"nit: perhaps `checkpointImageExists` might be more clear","created_at":"2018-11-27T16:32:01Z","updated_at":"2018-11-27T16:43:10Z","html_url":"https://github.com/containerd/containerd/pull/2830#discussion_r236744928","pull_request_url":"https://api.github.com/repos/containerd/containerd/pulls/2830","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/containerd/containerd/pulls/comments/236744928"},"html":{"href":"https://github.com/containerd/containerd/pull/2830#discussion_r236744928"},"pull_request":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2830"}}},"pull_request":{"url":"https://api.github.com/repos/containerd/containerd/pulls/2830","id":233326144,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMzI2MTQ0","html_url":"https://github.com/containerd/containerd/pull/2830","diff_url":"https://github.com/containerd/containerd/pull/2830.diff","patch_url":"https://github.com/containerd/containerd/pull/2830.patch","issue_url":"https://api.github.com/repos/containerd/containerd/issues/2830","number":2830,"state":"open","locked":false,"title":"cr: support checkpoint/restore without image","user":{"login":"Ace-Tang","id":10334997,"node_id":"MDQ6VXNlcjEwMzM0OTk3","avatar_url":"https://avatars0.githubusercontent.com/u/10334997?v=4","gravatar_id":"","url":"https://api.github.com/users/Ace-Tang","html_url":"https://github.com/Ace-Tang","followers_url":"https://api.github.com/users/Ace-Tang/followers","following_url":"https://api.github.com/users/Ace-Tang/following{/other_user}","gists_url":"https://api.github.com/users/Ace-Tang/gists{/gist_id}","starred_url":"https://api.github.com/users/Ace-Tang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ace-Tang/subscriptions","organizations_url":"https://api.github.com/users/Ace-Tang/orgs","repos_url":"https://api.github.com/users/Ace-Tang/repos","events_url":"https://api.github.com/users/Ace-Tang/events{/privacy}","received_events_url":"https://api.github.com/users/Ace-Tang/received_events","type":"User","site_admin":false},"body":"## Feature\r\n\r\nsupport checkpoint function could without committing a checkpoint dir into a checkpoint image and restore function could without untar image into checkpoint directory if `image-path` is set. support for both v1 and v2 runtime.\r\n\r\nFixes: #2822 \r\n\r\n### proto\r\n\r\nruntime v1\r\n```\r\n--- a/runtime/linux/runctypes/runc.proto\r\n+++ b/runtime/linux/runctypes/runc.proto\r\n@@ -25,6 +25,8 @@ message CreateOptions {\r\n        string shim_cgroup = 9;\r\n        uint32 io_uid = 10;\r\n        uint32 io_gid = 11;\r\n+       string criu_work_path = 12;\r\n+       string criu_image_path = 13;\r\n }\r\n \r\n message CheckpointOptions {\r\n@@ -35,6 +37,8 @@ message CheckpointOptions {\r\n        bool file_locks = 5;\r\n        repeated string empty_namespaces = 6;\r\n        string cgroups_mode = 7;\r\n+       string work_path = 8;\r\n+       string image_path = 9;\r\n }\r\n```\r\n\r\nruntime v2\r\n```\r\n--- a/runtime/v2/runc/options/oci.proto\r\n+++ b/runtime/v2/runc/options/oci.proto\r\n@@ -25,6 +25,10 @@ message Options {\r\n        string criu_path = 8;\r\n        // enable systemd cgroups\r\n        bool systemd_cgroup = 9;\r\n+       // criu image path\r\n+       string criu_image_path = 10;\r\n+       // criu work path\r\n+       string criu_work_path = 11;\r\n }\r\n \r\n message CheckpointOptions {\r\n@@ -42,6 +46,10 @@ message CheckpointOptions {\r\n        repeated string empty_namespaces = 6;\r\n        // set the cgroups mode, soft, full, strict\r\n        string cgroups_mode = 7;\r\n+       // checkpoint image path\r\n+       string image_path = 8;\r\n+       // checkpoint work path\r\n+       string work_path = 9;\r\n```\r\n\r\n### ctr \r\n\r\nadd flag `--image-path` and `work-path` for `ctr task checkpoint`\r\n\r\n```\r\n$ ctr task checkpoint -h\r\n...\r\n\r\nOPTIONS:\r\n   --image-path value  path to criu image files\r\n   --work-path value   path to criu work files and logs\r\n```\r\n\r\n\r\n## Use case\r\n\r\nOur production provide a capacity that can running a process in millisecond level, we choose criu. First, we prepare a process, running a container and run the process we need, then we chechkpoint the container to keep the process memory status in checkpoint directory, commit the container into a image.  The image and the checkpoint directory will be distributed on every physical machine (production container will run on these machine), when we want  to expand one process instance，with the image and the checkpoint directory, we can get the running process with right memory status in millisecond level using criu.\r\n\r\n\r\n","created_at":"2018-11-24T15:50:05Z","updated_at":"2018-11-27T16:43:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a121e9fdad4bd4f965df9ac2187f1362077de53","assignee":null,"assignees":[],"requested_reviewers":[{"login":"crosbymichael","id":749551,"node_id":"MDQ6VXNlcjc0OTU1MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/749551?v=4","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/containerd/containerd/pulls/2830/commits","review_comments_url":"https://api.github.com/repos/containerd/containerd/pulls/2830/comments","review_comment_url":"https://api.github.com/repos/containerd/containerd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containerd/containerd/issues/2830/comments","statuses_url":"https://api.github.com/repos/containerd/containerd/statuses/4f826e5d74194f7a864809384bedb46999207545","head":{"label":"Ace-Tang:support_cr_without_image","ref":"support_cr_without_image","sha":"4f826e5d74194f7a864809384bedb46999207545","user":{"login":"Ace-Tang","id":10334997,"node_id":"MDQ6VXNlcjEwMzM0OTk3","avatar_url":"https://avatars0.githubusercontent.com/u/10334997?v=4","gravatar_id":"","url":"https://api.github.com/users/Ace-Tang","html_url":"https://github.com/Ace-Tang","followers_url":"https://api.github.com/users/Ace-Tang/followers","following_url":"https://api.github.com/users/Ace-Tang/following{/other_user}","gists_url":"https://api.github.com/users/Ace-Tang/gists{/gist_id}","starred_url":"https://api.github.com/users/Ace-Tang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ace-Tang/subscriptions","organizations_url":"https://api.github.com/users/Ace-Tang/orgs","repos_url":"https://api.github.com/users/Ace-Tang/repos","events_url":"https://api.github.com/users/Ace-Tang/events{/privacy}","received_events_url":"https://api.github.com/users/Ace-Tang/received_events","type":"User","site_admin":false},"repo":{"id":105651979,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU2NTE5Nzk=","name":"containerd","full_name":"Ace-Tang/containerd","private":false,"owner":{"login":"Ace-Tang","id":10334997,"node_id":"MDQ6VXNlcjEwMzM0OTk3","avatar_url":"https://avatars0.githubusercontent.com/u/10334997?v=4","gravatar_id":"","url":"https://api.github.com/users/Ace-Tang","html_url":"https://github.com/Ace-Tang","followers_url":"https://api.github.com/users/Ace-Tang/followers","following_url":"https://api.github.com/users/Ace-Tang/following{/other_user}","gists_url":"https://api.github.com/users/Ace-Tang/gists{/gist_id}","starred_url":"https://api.github.com/users/Ace-Tang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ace-Tang/subscriptions","organizations_url":"https://api.github.com/users/Ace-Tang/orgs","repos_url":"https://api.github.com/users/Ace-Tang/repos","events_url":"https://api.github.com/users/Ace-Tang/events{/privacy}","received_events_url":"https://api.github.com/users/Ace-Tang/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Ace-Tang/containerd","description":"An open and reliable container runtime","fork":true,"url":"https://api.github.com/repos/Ace-Tang/containerd","forks_url":"https://api.github.com/repos/Ace-Tang/containerd/forks","keys_url":"https://api.github.com/repos/Ace-Tang/containerd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ace-Tang/containerd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ace-Tang/containerd/teams","hooks_url":"https://api.github.com/repos/Ace-Tang/containerd/hooks","issue_events_url":"https://api.github.com/repos/Ace-Tang/containerd/issues/events{/number}","events_url":"https://api.github.com/repos/Ace-Tang/containerd/events","assignees_url":"https://api.github.com/repos/Ace-Tang/containerd/assignees{/user}","branches_url":"https://api.github.com/repos/Ace-Tang/containerd/branches{/branch}","tags_url":"https://api.github.com/repos/Ace-Tang/containerd/tags","blobs_url":"https://api.github.com/repos/Ace-Tang/containerd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ace-Tang/containerd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ace-Tang/containerd/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ace-Tang/containerd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ace-Tang/containerd/statuses/{sha}","languages_url":"https://api.github.com/repos/Ace-Tang/containerd/languages","stargazers_url":"https://api.github.com/repos/Ace-Tang/containerd/stargazers","contributors_url":"https://api.github.com/repos/Ace-Tang/containerd/contributors","subscribers_url":"https://api.github.com/repos/Ace-Tang/containerd/subscribers","subscription_url":"https://api.github.com/repos/Ace-Tang/containerd/subscription","commits_url":"https://api.github.com/repos/Ace-Tang/containerd/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ace-Tang/containerd/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ace-Tang/containerd/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ace-Tang/containerd/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ace-Tang/containerd/contents/{+path}","compare_url":"https://api.github.com/repos/Ace-Tang/containerd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ace-Tang/containerd/merges","archive_url":"https://api.github.com/repos/Ace-Tang/containerd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ace-Tang/containerd/downloads","issues_url":"https://api.github.com/repos/Ace-Tang/containerd/issues{/number}","pulls_url":"https://api.github.com/repos/Ace-Tang/containerd/pulls{/number}","milestones_url":"https://api.github.com/repos/Ace-Tang/containerd/milestones{/number}","notifications_url":"https://api.github.com/repos/Ace-Tang/containerd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ace-Tang/containerd/labels{/name}","releases_url":"https://api.github.com/repos/Ace-Tang/containerd/releases{/id}","deployments_url":"https://api.github.com/repos/Ace-Tang/containerd/deployments","created_at":"2017-10-03T12:58:36Z","updated_at":"2018-11-23T12:48:49Z","pushed_at":"2018-11-27T13:28:18Z","git_url":"git://github.com/Ace-Tang/containerd.git","ssh_url":"git@github.com:Ace-Tang/containerd.git","clone_url":"https://github.com/Ace-Tang/containerd.git","svn_url":"https://github.com/Ace-Tang/containerd","homepage":"https://containerd.io","size":44643,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"containerd:master","ref":"master","sha":"75c490c5c4fa2bbd40c287cfe8f7683bc215bdea","user":{"login":"containerd","id":14037953,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDM3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/14037953?v=4","gravatar_id":"","url":"https://api.github.com/users/containerd","html_url":"https://github.com/containerd","followers_url":"https://api.github.com/users/containerd/followers","following_url":"https://api.github.com/users/containerd/following{/other_user}","gists_url":"https://api.github.com/users/containerd/gists{/gist_id}","starred_url":"https://api.github.com/users/containerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containerd/subscriptions","organizations_url":"https://api.github.com/users/containerd/orgs","repos_url":"https://api.github.com/users/containerd/repos","events_url":"https://api.github.com/users/containerd/events{/privacy}","received_events_url":"https://api.github.com/users/containerd/received_events","type":"Organization","site_admin":false},"repo":{"id":46089560,"node_id":"MDEwOlJlcG9zaXRvcnk0NjA4OTU2MA==","name":"containerd","full_name":"containerd/containerd","private":false,"owner":{"login":"containerd","id":14037953,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDM3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/14037953?v=4","gravatar_id":"","url":"https://api.github.com/users/containerd","html_url":"https://github.com/containerd","followers_url":"https://api.github.com/users/containerd/followers","following_url":"https://api.github.com/users/containerd/following{/other_user}","gists_url":"https://api.github.com/users/containerd/gists{/gist_id}","starred_url":"https://api.github.com/users/containerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containerd/subscriptions","organizations_url":"https://api.github.com/users/containerd/orgs","repos_url":"https://api.github.com/users/containerd/repos","events_url":"https://api.github.com/users/containerd/events{/privacy}","received_events_url":"https://api.github.com/users/containerd/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/containerd/containerd","description":"An open and reliable container runtime","fork":false,"url":"https://api.github.com/repos/containerd/containerd","forks_url":"https://api.github.com/repos/containerd/containerd/forks","keys_url":"https://api.github.com/repos/containerd/containerd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containerd/containerd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containerd/containerd/teams","hooks_url":"https://api.github.com/repos/containerd/containerd/hooks","issue_events_url":"https://api.github.com/repos/containerd/containerd/issues/events{/number}","events_url":"https://api.github.com/repos/containerd/containerd/events","assignees_url":"https://api.github.com/repos/containerd/containerd/assignees{/user}","branches_url":"https://api.github.com/repos/containerd/containerd/branches{/branch}","tags_url":"https://api.github.com/repos/containerd/containerd/tags","blobs_url":"https://api.github.com/repos/containerd/containerd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containerd/containerd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containerd/containerd/git/refs{/sha}","trees_url":"https://api.github.com/repos/containerd/containerd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containerd/containerd/statuses/{sha}","languages_url":"https://api.github.com/repos/containerd/containerd/languages","stargazers_url":"https://api.github.com/repos/containerd/containerd/stargazers","contributors_url":"https://api.github.com/repos/containerd/containerd/contributors","subscribers_url":"https://api.github.com/repos/containerd/containerd/subscribers","subscription_url":"https://api.github.com/repos/containerd/containerd/subscription","commits_url":"https://api.github.com/repos/containerd/containerd/commits{/sha}","git_commits_url":"https://api.github.com/repos/containerd/containerd/git/commits{/sha}","comments_url":"https://api.github.com/repos/containerd/containerd/comments{/number}","issue_comment_url":"https://api.github.com/repos/containerd/containerd/issues/comments{/number}","contents_url":"https://api.github.com/repos/containerd/containerd/contents/{+path}","compare_url":"https://api.github.com/repos/containerd/containerd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containerd/containerd/merges","archive_url":"https://api.github.com/repos/containerd/containerd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containerd/containerd/downloads","issues_url":"https://api.github.com/repos/containerd/containerd/issues{/number}","pulls_url":"https://api.github.com/repos/containerd/containerd/pulls{/number}","milestones_url":"https://api.github.com/repos/containerd/containerd/milestones{/number}","notifications_url":"https://api.github.com/repos/containerd/containerd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containerd/containerd/labels{/name}","releases_url":"https://api.github.com/repos/containerd/containerd/releases{/id}","deployments_url":"https://api.github.com/repos/containerd/containerd/deployments","created_at":"2015-11-13T00:27:43Z","updated_at":"2018-11-27T15:44:11Z","pushed_at":"2018-11-27T15:44:02Z","git_url":"git://github.com/containerd/containerd.git","ssh_url":"git@github.com:containerd/containerd.git","clone_url":"https://github.com/containerd/containerd.git","svn_url":"https://github.com/containerd/containerd","homepage":"https://containerd.io","size":45286,"stargazers_count":3169,"watchers_count":3169,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":640,"mirror_url":null,"archived":false,"open_issues_count":117,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":640,"open_issues":117,"watchers":3169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2830"},"html":{"href":"https://github.com/containerd/containerd/pull/2830"},"issue":{"href":"https://api.github.com/repos/containerd/containerd/issues/2830"},"comments":{"href":"https://api.github.com/repos/containerd/containerd/issues/2830/comments"},"review_comments":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2830/comments"},"review_comment":{"href":"https://api.github.com/repos/containerd/containerd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2830/commits"},"statuses":{"href":"https://api.github.com/repos/containerd/containerd/statuses/4f826e5d74194f7a864809384bedb46999207545"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ehazlett"}}