{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments/33307807","id":33307807,"diff_hunk":"@@ -708,3 +731,127 @@ def SetupProxy(self):\n \n     if commands:\n       self.RemoteCommand(\";\".join(commands))\n+\n+\n+class ContainerizedDebianMixin(DebianMixin):\n+  \"\"\"Class representing a Virtual Machine that runs Remote\n+  Commands within a Docker Container running Ubuntu\"\"\"\n+\n+  def PrepareVMEnvironment(self):\n+    \"\"\"Initializes docker before proceeding with preparation.\"\"\"\n+    self.RemoteHostCommand('mkdir -p %s' % vm_util.VM_TMP_DIR)\n+    self.Install('docker')\n+    self.InitDocker()\n+    super(ContainerizedDebianMixin, self).PrepareVMEnvironment()\n+\n+  def InitDocker(self):\n+    \"\"\"Initializes the docker container daemon.\"\"\"\n+    init_docker_cmd = ('sudo docker run -d '\n+                       '--net=host '\n+                       '--workdir=%s '\n+                       '-v %s:%s ' % (CONTAINER_WORK_DIR,\n+                                      vm_util.VM_TMP_DIR,\n+                                      CONTAINER_MOUNT_DIR))\n+    for sd in self.scratch_disks:\n+      init_docker_cmd += '-v %s:%s ' % (sd.mount_point, sd.mount_point)\n+    init_docker_cmd += '%s sleep infinity ' % UBUNTU_DOCKER_IMAGE\n+\n+    resp, _ = self.RemoteHostCommand(init_docker_cmd)\n+    self.docker_id = resp[:-1]","path":"perfkitbenchmarker/linux_virtual_machine.py","position":181,"original_position":181,"commit_id":"eba029c4f8c13e8e6889b50c8990198497c712a8","original_commit_id":"eba029c4f8c13e8e6889b50c8990198497c712a8","user":{"login":"gablg1","id":5253695,"avatar_url":"https://avatars.githubusercontent.com/u/5253695?v=3","gravatar_id":"","url":"https://api.github.com/users/gablg1","html_url":"https://github.com/gablg1","followers_url":"https://api.github.com/users/gablg1/followers","following_url":"https://api.github.com/users/gablg1/following{/other_user}","gists_url":"https://api.github.com/users/gablg1/gists{/gist_id}","starred_url":"https://api.github.com/users/gablg1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablg1/subscriptions","organizations_url":"https://api.github.com/users/gablg1/orgs","repos_url":"https://api.github.com/users/gablg1/repos","events_url":"https://api.github.com/users/gablg1/events{/privacy}","received_events_url":"https://api.github.com/users/gablg1/received_events","type":"User","site_admin":false},"body":"I just did this because that's what WaitForBootCompletion and CheckJavaVersion do. Should I change them to rstrip as well?","created_at":"2015-06-25T21:34:43Z","updated_at":"2015-06-25T21:34:43Z","html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/333#discussion_r33307807","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments/33307807"},"html":{"href":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/333#discussion_r33307807"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333","id":38289947,"html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/333","diff_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/333.diff","patch_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/333.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/333","number":333,"state":"open","locked":false,"title":"Adding support to ContainerizedVM","user":{"login":"gablg1","id":5253695,"avatar_url":"https://avatars.githubusercontent.com/u/5253695?v=3","gravatar_id":"","url":"https://api.github.com/users/gablg1","html_url":"https://github.com/gablg1","followers_url":"https://api.github.com/users/gablg1/followers","following_url":"https://api.github.com/users/gablg1/following{/other_user}","gists_url":"https://api.github.com/users/gablg1/gists{/gist_id}","starred_url":"https://api.github.com/users/gablg1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablg1/subscriptions","organizations_url":"https://api.github.com/users/gablg1/orgs","repos_url":"https://api.github.com/users/gablg1/repos","events_url":"https://api.github.com/users/gablg1/events{/privacy}","received_events_url":"https://api.github.com/users/gablg1/received_events","type":"User","site_admin":false},"body":"This PR adds the ContainerizedDebian class, which allows anyone to run benchmarks within a Ubuntu docker container. Every call to RemoteCommand runs within the Docker container via docker exec, whereas any call to RemoteHostCommand is guaranteed to run the command in the VM, outside the container.\r\n\r\nThis was only tested in GCE so far.","created_at":"2015-06-23T00:10:42Z","updated_at":"2015-06-25T21:34:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"613deb3a547bbb78b354fdc83533bd8e8b46fd3a","assignee":{"login":"ehankland","id":8193699,"avatar_url":"https://avatars.githubusercontent.com/u/8193699?v=3","gravatar_id":"","url":"https://api.github.com/users/ehankland","html_url":"https://github.com/ehankland","followers_url":"https://api.github.com/users/ehankland/followers","following_url":"https://api.github.com/users/ehankland/following{/other_user}","gists_url":"https://api.github.com/users/ehankland/gists{/gist_id}","starred_url":"https://api.github.com/users/ehankland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehankland/subscriptions","organizations_url":"https://api.github.com/users/ehankland/orgs","repos_url":"https://api.github.com/users/ehankland/repos","events_url":"https://api.github.com/users/ehankland/events{/privacy}","received_events_url":"https://api.github.com/users/ehankland/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/333/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/eba029c4f8c13e8e6889b50c8990198497c712a8","head":{"label":"gablg1:containerized","ref":"containerized","sha":"eba029c4f8c13e8e6889b50c8990198497c712a8","user":{"login":"gablg1","id":5253695,"avatar_url":"https://avatars.githubusercontent.com/u/5253695?v=3","gravatar_id":"","url":"https://api.github.com/users/gablg1","html_url":"https://github.com/gablg1","followers_url":"https://api.github.com/users/gablg1/followers","following_url":"https://api.github.com/users/gablg1/following{/other_user}","gists_url":"https://api.github.com/users/gablg1/gists{/gist_id}","starred_url":"https://api.github.com/users/gablg1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablg1/subscriptions","organizations_url":"https://api.github.com/users/gablg1/orgs","repos_url":"https://api.github.com/users/gablg1/repos","events_url":"https://api.github.com/users/gablg1/events{/privacy}","received_events_url":"https://api.github.com/users/gablg1/received_events","type":"User","site_admin":false},"repo":{"id":37878529,"name":"PerfKitBenchmarker","full_name":"gablg1/PerfKitBenchmarker","owner":{"login":"gablg1","id":5253695,"avatar_url":"https://avatars.githubusercontent.com/u/5253695?v=3","gravatar_id":"","url":"https://api.github.com/users/gablg1","html_url":"https://github.com/gablg1","followers_url":"https://api.github.com/users/gablg1/followers","following_url":"https://api.github.com/users/gablg1/following{/other_user}","gists_url":"https://api.github.com/users/gablg1/gists{/gist_id}","starred_url":"https://api.github.com/users/gablg1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gablg1/subscriptions","organizations_url":"https://api.github.com/users/gablg1/orgs","repos_url":"https://api.github.com/users/gablg1/repos","events_url":"https://api.github.com/users/gablg1/events{/privacy}","received_events_url":"https://api.github.com/users/gablg1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gablg1/PerfKitBenchmarker","description":"Perfkit Benchmarker contains set of benchmarks to measure and compare cloud offerings. The benchmarks are not tuned (i.e. use defaults) to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.","fork":true,"url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker","forks_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/forks","keys_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/teams","hooks_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/hooks","issue_events_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/issues/events{/number}","events_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/events","assignees_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/assignees{/user}","branches_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/branches{/branch}","tags_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/tags","blobs_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/git/refs{/sha}","trees_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/statuses/{sha}","languages_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/languages","stargazers_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/stargazers","contributors_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/contributors","subscribers_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/subscribers","subscription_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/subscription","commits_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/commits{/sha}","git_commits_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/git/commits{/sha}","comments_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/comments{/number}","issue_comment_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/issues/comments{/number}","contents_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/contents/{+path}","compare_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/merges","archive_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/downloads","issues_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/issues{/number}","pulls_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/pulls{/number}","milestones_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/milestones{/number}","notifications_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/labels{/name}","releases_url":"https://api.github.com/repos/gablg1/PerfKitBenchmarker/releases{/id}","created_at":"2015-06-22T20:19:15Z","updated_at":"2015-06-22T20:19:16Z","pushed_at":"2015-06-25T18:29:08Z","git_url":"git://github.com/gablg1/PerfKitBenchmarker.git","ssh_url":"git@github.com:gablg1/PerfKitBenchmarker.git","clone_url":"https://github.com/gablg1/PerfKitBenchmarker.git","svn_url":"https://github.com/gablg1/PerfKitBenchmarker","homepage":"","size":2228,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"GoogleCloudPlatform:dev","ref":"dev","sha":"c1ba9179880850c455a7118e1fb8bf6cfe1b891d","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":21950910,"name":"PerfKitBenchmarker","full_name":"GoogleCloudPlatform/PerfKitBenchmarker","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker","description":"Perfkit Benchmarker contains set of benchmarks to measure and compare cloud offerings. The benchmarks are not tuned (i.e. use defaults) to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/releases{/id}","created_at":"2014-07-17T17:23:26Z","updated_at":"2015-06-24T15:12:19Z","pushed_at":"2015-06-25T18:29:08Z","git_url":"git://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git","ssh_url":"git@github.com:GoogleCloudPlatform/PerfKitBenchmarker.git","clone_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git","svn_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker","homepage":"","size":150890,"stargazers_count":455,"watchers_count":455,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":77,"forks":55,"open_issues":77,"watchers":455,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333"},"html":{"href":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/333"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/333"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/333/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/333/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/eba029c4f8c13e8e6889b50c8990198497c712a8"}}}}