{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/citostyle/docker-record/pulls/4","id":120487361,"html_url":"https://github.com/citostyle/docker-record/pull/4","diff_url":"https://github.com/citostyle/docker-record/pull/4.diff","patch_url":"https://github.com/citostyle/docker-record/pull/4.patch","issue_url":"https://api.github.com/repos/citostyle/docker-record/issues/4","number":4,"state":"open","locked":false,"title":"Initial version of filesystem diffs per recorded command","user":{"login":"whummer","id":2807888,"avatar_url":"https://avatars3.githubusercontent.com/u/2807888?v=3","gravatar_id":"","url":"https://api.github.com/users/whummer","html_url":"https://github.com/whummer","followers_url":"https://api.github.com/users/whummer/followers","following_url":"https://api.github.com/users/whummer/following{/other_user}","gists_url":"https://api.github.com/users/whummer/gists{/gist_id}","starred_url":"https://api.github.com/users/whummer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whummer/subscriptions","organizations_url":"https://api.github.com/users/whummer/orgs","repos_url":"https://api.github.com/users/whummer/repos","events_url":"https://api.github.com/users/whummer/events{/privacy}","received_events_url":"https://api.github.com/users/whummer/received_events","type":"User","site_admin":false},"body":"This PR adds a simplistic per-command file system change tracker.\r\n\r\n* The CLI is slightly extended such that either a running container or an image can be specified (`docker-record <CONTAINER_OR_IMAGE>`). If an image is specified, a container is automatically started in the background with the required volume mounts (required to execute `docker` commands from within the container)\r\n\r\n* File changes are tracked via simple `docker diff` commands, the intermediate states are stored to `/tmp/record/fsdiff` inside the container. Since `docker diff` always returns the full list of file changes since the container was started, we compute the diff of changes to obtain a list of file changes for each individual command.\r\n\r\n* Example:\r\n```\r\n$ bin/docker-record <some_image>\r\nStarted container from image <some_image>: a999ea2ecd9a\r\nWaiting a few moments until container has initialized\r\nbash# touch /tmp/foo1\r\nbash# ls /tmp/foo1\r\n/tmp/foo1\r\nbash# touch /tmp/foo2\r\nbash# exit\r\n$ bin/docker-record a999ea2ecd9a --replay\r\n# creates filesystem changes: [A /tmp/foo1]\r\nRUN touch /tmp/foo1\r\n# creates filesystem changes: [A /tmp/foo2]\r\nRUN touch /tmp/foo2\r\n```\r\n\r\nThere are still a few limitations, though:\r\n\r\n* Piped commands (e.g., `echo \"foo\" > /tmp/bar` or `ps aux | grep foo`) are not handled as a single command, but as individual commands. This appears to be an issue with the bash init-file instrumentation, we need to fix it.\r\n\r\n* If the same file, say `/tmp/foobar` is changed by two consecutive commands, we would only record that there has been a change from the first command. In order to fix this, we need to store modification timestamps and/or MD5 hashes of file states.\r\n\r\n* The code currently assumes that the \"docker\" binary/command is available in the container. That is generally not the case and we need to find a smart way to install `docker` CLI into the container if it is not available (mounting is not an option, because of binary incompatibility between MacOS on the host and Linux in the container).\r\n\r\nIn particular the last limitation is problematic. Currently, it may break the functionality of docker-record if the `docker` command is not available in the container. Therefore, I am not in favor of merging this now, but rather find a solution first before merging to master.","created_at":"2017-05-14T14:09:22Z","updated_at":"2017-05-14T14:09:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/citostyle/docker-record/pulls/4/commits","review_comments_url":"https://api.github.com/repos/citostyle/docker-record/pulls/4/comments","review_comment_url":"https://api.github.com/repos/citostyle/docker-record/pulls/comments{/number}","comments_url":"https://api.github.com/repos/citostyle/docker-record/issues/4/comments","statuses_url":"https://api.github.com/repos/citostyle/docker-record/statuses/95e7a59e25298bcca906aae4a0a239e8a8315a1d","head":{"label":"whummer:feat/simple-fs-changes","ref":"feat/simple-fs-changes","sha":"95e7a59e25298bcca906aae4a0a239e8a8315a1d","user":{"login":"whummer","id":2807888,"avatar_url":"https://avatars3.githubusercontent.com/u/2807888?v=3","gravatar_id":"","url":"https://api.github.com/users/whummer","html_url":"https://github.com/whummer","followers_url":"https://api.github.com/users/whummer/followers","following_url":"https://api.github.com/users/whummer/following{/other_user}","gists_url":"https://api.github.com/users/whummer/gists{/gist_id}","starred_url":"https://api.github.com/users/whummer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whummer/subscriptions","organizations_url":"https://api.github.com/users/whummer/orgs","repos_url":"https://api.github.com/users/whummer/repos","events_url":"https://api.github.com/users/whummer/events{/privacy}","received_events_url":"https://api.github.com/users/whummer/received_events","type":"User","site_admin":false},"repo":{"id":90040101,"name":"docker-record","full_name":"whummer/docker-record","owner":{"login":"whummer","id":2807888,"avatar_url":"https://avatars3.githubusercontent.com/u/2807888?v=3","gravatar_id":"","url":"https://api.github.com/users/whummer","html_url":"https://github.com/whummer","followers_url":"https://api.github.com/users/whummer/followers","following_url":"https://api.github.com/users/whummer/following{/other_user}","gists_url":"https://api.github.com/users/whummer/gists{/gist_id}","starred_url":"https://api.github.com/users/whummer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whummer/subscriptions","organizations_url":"https://api.github.com/users/whummer/orgs","repos_url":"https://api.github.com/users/whummer/repos","events_url":"https://api.github.com/users/whummer/events{/privacy}","received_events_url":"https://api.github.com/users/whummer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whummer/docker-record","description":null,"fork":true,"url":"https://api.github.com/repos/whummer/docker-record","forks_url":"https://api.github.com/repos/whummer/docker-record/forks","keys_url":"https://api.github.com/repos/whummer/docker-record/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whummer/docker-record/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whummer/docker-record/teams","hooks_url":"https://api.github.com/repos/whummer/docker-record/hooks","issue_events_url":"https://api.github.com/repos/whummer/docker-record/issues/events{/number}","events_url":"https://api.github.com/repos/whummer/docker-record/events","assignees_url":"https://api.github.com/repos/whummer/docker-record/assignees{/user}","branches_url":"https://api.github.com/repos/whummer/docker-record/branches{/branch}","tags_url":"https://api.github.com/repos/whummer/docker-record/tags","blobs_url":"https://api.github.com/repos/whummer/docker-record/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whummer/docker-record/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whummer/docker-record/git/refs{/sha}","trees_url":"https://api.github.com/repos/whummer/docker-record/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whummer/docker-record/statuses/{sha}","languages_url":"https://api.github.com/repos/whummer/docker-record/languages","stargazers_url":"https://api.github.com/repos/whummer/docker-record/stargazers","contributors_url":"https://api.github.com/repos/whummer/docker-record/contributors","subscribers_url":"https://api.github.com/repos/whummer/docker-record/subscribers","subscription_url":"https://api.github.com/repos/whummer/docker-record/subscription","commits_url":"https://api.github.com/repos/whummer/docker-record/commits{/sha}","git_commits_url":"https://api.github.com/repos/whummer/docker-record/git/commits{/sha}","comments_url":"https://api.github.com/repos/whummer/docker-record/comments{/number}","issue_comment_url":"https://api.github.com/repos/whummer/docker-record/issues/comments{/number}","contents_url":"https://api.github.com/repos/whummer/docker-record/contents/{+path}","compare_url":"https://api.github.com/repos/whummer/docker-record/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whummer/docker-record/merges","archive_url":"https://api.github.com/repos/whummer/docker-record/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whummer/docker-record/downloads","issues_url":"https://api.github.com/repos/whummer/docker-record/issues{/number}","pulls_url":"https://api.github.com/repos/whummer/docker-record/pulls{/number}","milestones_url":"https://api.github.com/repos/whummer/docker-record/milestones{/number}","notifications_url":"https://api.github.com/repos/whummer/docker-record/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whummer/docker-record/labels{/name}","releases_url":"https://api.github.com/repos/whummer/docker-record/releases{/id}","deployments_url":"https://api.github.com/repos/whummer/docker-record/deployments","created_at":"2017-05-02T14:02:51Z","updated_at":"2017-05-02T14:02:53Z","pushed_at":"2017-05-14T14:07:15Z","git_url":"git://github.com/whummer/docker-record.git","ssh_url":"git@github.com:whummer/docker-record.git","clone_url":"https://github.com/whummer/docker-record.git","svn_url":"https://github.com/whummer/docker-record","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"citostyle:master","ref":"master","sha":"006f7ab4b0537153b5ef5f76c2f513d6e912a4d7","user":{"login":"citostyle","id":1174158,"avatar_url":"https://avatars3.githubusercontent.com/u/1174158?v=3","gravatar_id":"","url":"https://api.github.com/users/citostyle","html_url":"https://github.com/citostyle","followers_url":"https://api.github.com/users/citostyle/followers","following_url":"https://api.github.com/users/citostyle/following{/other_user}","gists_url":"https://api.github.com/users/citostyle/gists{/gist_id}","starred_url":"https://api.github.com/users/citostyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citostyle/subscriptions","organizations_url":"https://api.github.com/users/citostyle/orgs","repos_url":"https://api.github.com/users/citostyle/repos","events_url":"https://api.github.com/users/citostyle/events{/privacy}","received_events_url":"https://api.github.com/users/citostyle/received_events","type":"User","site_admin":false},"repo":{"id":42786329,"name":"docker-record","full_name":"citostyle/docker-record","owner":{"login":"citostyle","id":1174158,"avatar_url":"https://avatars3.githubusercontent.com/u/1174158?v=3","gravatar_id":"","url":"https://api.github.com/users/citostyle","html_url":"https://github.com/citostyle","followers_url":"https://api.github.com/users/citostyle/followers","following_url":"https://api.github.com/users/citostyle/following{/other_user}","gists_url":"https://api.github.com/users/citostyle/gists{/gist_id}","starred_url":"https://api.github.com/users/citostyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citostyle/subscriptions","organizations_url":"https://api.github.com/users/citostyle/orgs","repos_url":"https://api.github.com/users/citostyle/repos","events_url":"https://api.github.com/users/citostyle/events{/privacy}","received_events_url":"https://api.github.com/users/citostyle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/citostyle/docker-record","description":null,"fork":false,"url":"https://api.github.com/repos/citostyle/docker-record","forks_url":"https://api.github.com/repos/citostyle/docker-record/forks","keys_url":"https://api.github.com/repos/citostyle/docker-record/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citostyle/docker-record/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citostyle/docker-record/teams","hooks_url":"https://api.github.com/repos/citostyle/docker-record/hooks","issue_events_url":"https://api.github.com/repos/citostyle/docker-record/issues/events{/number}","events_url":"https://api.github.com/repos/citostyle/docker-record/events","assignees_url":"https://api.github.com/repos/citostyle/docker-record/assignees{/user}","branches_url":"https://api.github.com/repos/citostyle/docker-record/branches{/branch}","tags_url":"https://api.github.com/repos/citostyle/docker-record/tags","blobs_url":"https://api.github.com/repos/citostyle/docker-record/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citostyle/docker-record/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citostyle/docker-record/git/refs{/sha}","trees_url":"https://api.github.com/repos/citostyle/docker-record/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citostyle/docker-record/statuses/{sha}","languages_url":"https://api.github.com/repos/citostyle/docker-record/languages","stargazers_url":"https://api.github.com/repos/citostyle/docker-record/stargazers","contributors_url":"https://api.github.com/repos/citostyle/docker-record/contributors","subscribers_url":"https://api.github.com/repos/citostyle/docker-record/subscribers","subscription_url":"https://api.github.com/repos/citostyle/docker-record/subscription","commits_url":"https://api.github.com/repos/citostyle/docker-record/commits{/sha}","git_commits_url":"https://api.github.com/repos/citostyle/docker-record/git/commits{/sha}","comments_url":"https://api.github.com/repos/citostyle/docker-record/comments{/number}","issue_comment_url":"https://api.github.com/repos/citostyle/docker-record/issues/comments{/number}","contents_url":"https://api.github.com/repos/citostyle/docker-record/contents/{+path}","compare_url":"https://api.github.com/repos/citostyle/docker-record/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citostyle/docker-record/merges","archive_url":"https://api.github.com/repos/citostyle/docker-record/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citostyle/docker-record/downloads","issues_url":"https://api.github.com/repos/citostyle/docker-record/issues{/number}","pulls_url":"https://api.github.com/repos/citostyle/docker-record/pulls{/number}","milestones_url":"https://api.github.com/repos/citostyle/docker-record/milestones{/number}","notifications_url":"https://api.github.com/repos/citostyle/docker-record/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citostyle/docker-record/labels{/name}","releases_url":"https://api.github.com/repos/citostyle/docker-record/releases{/id}","deployments_url":"https://api.github.com/repos/citostyle/docker-record/deployments","created_at":"2015-09-19T19:16:13Z","updated_at":"2017-05-09T11:25:42Z","pushed_at":"2017-05-02T14:24:03Z","git_url":"git://github.com/citostyle/docker-record.git","ssh_url":"git@github.com:citostyle/docker-record.git","clone_url":"https://github.com/citostyle/docker-record.git","svn_url":"https://github.com/citostyle/docker-record","homepage":null,"size":21,"stargazers_count":82,"watchers_count":82,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/citostyle/docker-record/pulls/4"},"html":{"href":"https://github.com/citostyle/docker-record/pull/4"},"issue":{"href":"https://api.github.com/repos/citostyle/docker-record/issues/4"},"comments":{"href":"https://api.github.com/repos/citostyle/docker-record/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/citostyle/docker-record/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/citostyle/docker-record/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/citostyle/docker-record/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/citostyle/docker-record/statuses/95e7a59e25298bcca906aae4a0a239e8a8315a1d"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":200,"deletions":105,"changed_files":7}}
{"actor":{"display_login":"whummer"}}