{"action":"created","issue":{"url":"https://api.github.com/repos/containerd/containerd/issues/862","repository_url":"https://api.github.com/repos/containerd/containerd","labels_url":"https://api.github.com/repos/containerd/containerd/issues/862/labels{/name}","comments_url":"https://api.github.com/repos/containerd/containerd/issues/862/comments","events_url":"https://api.github.com/repos/containerd/containerd/issues/862/events","html_url":"https://github.com/containerd/containerd/pull/862","id":229096691,"number":862,"title":"Initial Support for Checkpoint && Restore","user":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars2.githubusercontent.com/u/749551?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-05-16T16:38:14Z","updated_at":"2017-05-17T19:07:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/containerd/containerd/pulls/862","html_url":"https://github.com/containerd/containerd/pull/862","diff_url":"https://github.com/containerd/containerd/pull/862.diff","patch_url":"https://github.com/containerd/containerd/pull/862.patch"},"body":"This adds the initial work for implementing checkpoint and restore.  We are still missing the RW layer in this but `ctr` currently supports binds along with the criu checkpoint data being placed in the content store.\r\n\r\nYou can play with this PR by running a container, checkpointing it, and then restoring.  I have tested with criu 2.2.  \r\n\r\n```bash\r\n# run an initial container \r\nsudo ctr run --net-host --id test docker.io/library/redis:alpine\r\n\r\n# checkpoint it\r\nsudo ctr checkpoint --id test --exit\r\nsha256:44b628f0af2afbca9b15df24cfb9d0d1649f980cc014b34ed57a4b950f22072d\r\n\r\n# restore the container\r\nsudo ctr restore --id test sha256:44b628f0af2afbca9b15df24cfb9d0d1649f980cc014b34ed57a4b950f22072d\r\n\r\n# ctrl-c to exit and you will see the redis shutdown\r\n```\r\n\r\nWhen you checkpoint a container, its checkpoint gets placed inside the content store and the client is returned a digest that allows you to build an Index that can be pushed to a registry and pulled later.  You can give the index in the content store using the `dist` command.\r\n\r\n```bash\r\nsudo dist content get sha256:44b628f0af2afbca9b15df24cfb9d0d1649f980cc014b34ed57a4b950f22072d\r\n```\r\n\r\n```json\r\n{\r\n   \"schemaVersion\" : 0,\r\n   \"manifests\" : [\r\n      {\r\n         \"mediaType\" : \"application/vnd.containerd.container.checkpoint.tar\",\r\n         \"digest\" : \"sha256:fc21c179fe1e43316f04a6378725c36616bcb811df0a54e9b982e4069ab5147f\",\r\n         \"size\" : 700416,\r\n         \"platform\" : {\r\n            \"os\" : \"linux\",\r\n            \"architecture\" : \"amd64\"\r\n         }\r\n      },\r\n      {\r\n         \"mediaType\" : \"application/vnd.containerd.container.checkpoint.config.v1+json\",\r\n         \"digest\" : \"sha256:9037d23dff618df5ae54553eddbfb41b658fe2c0564ad4fccc6c0a36582a6938\",\r\n         \"size\" : 2939,\r\n         \"platform\" : {\r\n            \"os\" : \"linux\",\r\n            \"architecture\" : \"amd64\"\r\n         }\r\n      }\r\n   ]\r\n}\r\n```\r\n\r\nWhen we get the snapshot and rootfs PRs in we will need to add RW checkpointing so that the container's rw layer is included in the index for pushing and migration. \r\n\r\nCloses #787"},"comment":{"url":"https://api.github.com/repos/containerd/containerd/issues/comments/302197854","html_url":"https://github.com/containerd/containerd/pull/862#issuecomment-302197854","issue_url":"https://api.github.com/repos/containerd/containerd/issues/862","id":302197854,"user":{"login":"boucher","id":22065,"avatar_url":"https://avatars3.githubusercontent.com/u/22065?v=3","gravatar_id":"","url":"https://api.github.com/users/boucher","html_url":"https://github.com/boucher","followers_url":"https://api.github.com/users/boucher/followers","following_url":"https://api.github.com/users/boucher/following{/other_user}","gists_url":"https://api.github.com/users/boucher/gists{/gist_id}","starred_url":"https://api.github.com/users/boucher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boucher/subscriptions","organizations_url":"https://api.github.com/users/boucher/orgs","repos_url":"https://api.github.com/users/boucher/repos","events_url":"https://api.github.com/users/boucher/events{/privacy}","received_events_url":"https://api.github.com/users/boucher/received_events","type":"User","site_admin":false},"created_at":"2017-05-17T19:07:14Z","updated_at":"2017-05-17T19:07:14Z","body":"I only care about them on failure, but its possible some people might care more broadly? I think if there was an easy way to get them on failure that would at least cover 80% of the use though."}}
{"actor":{"display_login":"boucher"}}