{"action":"created","comment":{"url":"https://api.github.com/repos/alibaba/pouch/pulls/comments/206763268","pull_request_review_id":142237373,"id":206763268,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjc2MzI2OA==","diff_hunk":"@@ -152,6 +158,24 @@ func setMountTab(ctx context.Context, c *Container, spec *SpecWrapper) error {\n \treturn nil\n }\n \n+func setNvidiaHook(ctx context.Context, c *Container, spec *SpecWrapper) error {\n+\tn := c.HostConfig.NvidiaConfig\n+\tif n == nil {\n+\t\treturn nil\n+\t}\n+\tpath, err := exec.LookPath(\"nvidia-container-runtime-hook\")\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\targs := []string{path}\n+\tnvidiaPrestart := specs.Hook{\n+\t\tPath: path,\n+\t\tArgs: append(args, \"prestart\"),\n+\t}\n+\tspec.s.Hooks.Prestart = append(spec.s.Hooks.Prestart, nvidiaPrestart)","path":"daemon/mgr/spec_hook.go","position":38,"original_position":38,"commit_id":"a85898d55bfcbb53c48cfe4784a6127ce9f9100e","original_commit_id":"a85898d55bfcbb53c48cfe4784a6127ce9f9100e","user":{"login":"allencloud","id":9465626,"node_id":"MDQ6VXNlcjk0NjU2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/9465626?v=4","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"body":"If we already has a prestart hook, will the nvidia prestart take effect here? Just double check this.","created_at":"2018-08-01T06:06:46Z","updated_at":"2018-08-01T06:06:46Z","html_url":"https://github.com/alibaba/pouch/pull/2029#discussion_r206763268","pull_request_url":"https://api.github.com/repos/alibaba/pouch/pulls/2029","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/alibaba/pouch/pulls/comments/206763268"},"html":{"href":"https://github.com/alibaba/pouch/pull/2029#discussion_r206763268"},"pull_request":{"href":"https://api.github.com/repos/alibaba/pouch/pulls/2029"}}},"pull_request":{"url":"https://api.github.com/repos/alibaba/pouch/pulls/2029","id":205077761,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDc3NzYx","html_url":"https://github.com/alibaba/pouch/pull/2029","diff_url":"https://github.com/alibaba/pouch/pull/2029.diff","patch_url":"https://github.com/alibaba/pouch/pull/2029.patch","issue_url":"https://api.github.com/repos/alibaba/pouch/issues/2029","number":2029,"state":"open","locked":false,"title":"feature: support nvidia-container 2.0","user":{"login":"CodeJuan","id":5423628,"node_id":"MDQ6VXNlcjU0MjM2Mjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5423628?v=4","gravatar_id":"","url":"https://api.github.com/users/CodeJuan","html_url":"https://github.com/CodeJuan","followers_url":"https://api.github.com/users/CodeJuan/followers","following_url":"https://api.github.com/users/CodeJuan/following{/other_user}","gists_url":"https://api.github.com/users/CodeJuan/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeJuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeJuan/subscriptions","organizations_url":"https://api.github.com/users/CodeJuan/orgs","repos_url":"https://api.github.com/users/CodeJuan/repos","events_url":"https://api.github.com/users/CodeJuan/events{/privacy}","received_events_url":"https://api.github.com/users/CodeJuan/received_events","type":"User","site_admin":false},"body":"<!-- \r\nPlease make sure you have read and understood the contributing guidelines;\r\nhttps://github.com/alibaba/pouch/blob/master/CONTRIBUTING.md -->\r\n\r\n### Ⅰ. Describe what this PR did\r\nMake pouch natively support GPU devices\r\n\r\n### Ⅱ. Does this pull request fix one issue?\r\n<!--If that, add \"fixes #xxxx\" below in the next line, for example, fixes #15. Otherwise, add \"NONE\" -->\r\nfixes #824\r\n\r\n### Ⅲ. Describe how you did it\r\n\r\n### Ⅳ. Describe how to verify it\r\n1. Prerequisites: \r\n  - An instance with a NVIDIA GPU\r\n  - The appropriate GPU driver is installed\r\n2. Create container with `NvidiaConfig`.\r\n```\r\ncurl --unix-socket /run/pouchd.sock -X POST http:/containers/create -H \"Content-Type: application/json\" -d '{\"Image\": \"centos:7\", \"HostConfig\":{\"Devices\": [],\"NvidiaConfig\":{\"NvidiaDriverCapabilities\":\"all\",\"NvidiaVisibleDevices\":\"0\"}},\"Cmd\": [\"ping\",\"127.0.0.1\"]}'\r\n```\r\n3. Start container.\r\n4. Exec nvidia-smi in container.\r\n5. If nvidia-smi return error `NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system`, then add a link to libnvidia-ml.so\r\n```\r\nln -s  /usr/lib64/libnvidia-cfg.so.1 /usr/lib64/libnvidia-cfg.so\r\nln -s /usr/lib64/libnvidia-cfg.so.387.26 /usr/lib64/libnvidia-cfg.so.1\r\nln -s  /usr/lib64/libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so\r\nln -s /usr/lib64/libnvidia-ml.so.387.26 /usr/lib64/libnvidia-ml.so.1\r\n```\r\n\r\n### Ⅴ. Special notes for reviews\r\n\r\n\r\n","created_at":"2018-07-31T11:15:25Z","updated_at":"2018-08-01T06:06:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c9b5010fe810be20f98c1d077389eff5a69313a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":722348097,"node_id":"MDU6TGFiZWw3MjIzNDgwOTc=","url":"https://api.github.com/repos/alibaba/pouch/labels/kind/feature","name":"kind/feature","color":"1d76db","default":false},{"id":722355278,"node_id":"MDU6TGFiZWw3MjIzNTUyNzg=","url":"https://api.github.com/repos/alibaba/pouch/labels/size/XL","name":"size/XL","color":"f4abdb","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/alibaba/pouch/pulls/2029/commits","review_comments_url":"https://api.github.com/repos/alibaba/pouch/pulls/2029/comments","review_comment_url":"https://api.github.com/repos/alibaba/pouch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alibaba/pouch/issues/2029/comments","statuses_url":"https://api.github.com/repos/alibaba/pouch/statuses/a85898d55bfcbb53c48cfe4784a6127ce9f9100e","head":{"label":"CodeJuan:nvidia2","ref":"nvidia2","sha":"a85898d55bfcbb53c48cfe4784a6127ce9f9100e","user":{"login":"CodeJuan","id":5423628,"node_id":"MDQ6VXNlcjU0MjM2Mjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5423628?v=4","gravatar_id":"","url":"https://api.github.com/users/CodeJuan","html_url":"https://github.com/CodeJuan","followers_url":"https://api.github.com/users/CodeJuan/followers","following_url":"https://api.github.com/users/CodeJuan/following{/other_user}","gists_url":"https://api.github.com/users/CodeJuan/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeJuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeJuan/subscriptions","organizations_url":"https://api.github.com/users/CodeJuan/orgs","repos_url":"https://api.github.com/users/CodeJuan/repos","events_url":"https://api.github.com/users/CodeJuan/events{/privacy}","received_events_url":"https://api.github.com/users/CodeJuan/received_events","type":"User","site_admin":false},"repo":{"id":111373850,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEzNzM4NTA=","name":"pouch","full_name":"CodeJuan/pouch","owner":{"login":"CodeJuan","id":5423628,"node_id":"MDQ6VXNlcjU0MjM2Mjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5423628?v=4","gravatar_id":"","url":"https://api.github.com/users/CodeJuan","html_url":"https://github.com/CodeJuan","followers_url":"https://api.github.com/users/CodeJuan/followers","following_url":"https://api.github.com/users/CodeJuan/following{/other_user}","gists_url":"https://api.github.com/users/CodeJuan/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeJuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeJuan/subscriptions","organizations_url":"https://api.github.com/users/CodeJuan/orgs","repos_url":"https://api.github.com/users/CodeJuan/repos","events_url":"https://api.github.com/users/CodeJuan/events{/privacy}","received_events_url":"https://api.github.com/users/CodeJuan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CodeJuan/pouch","description":"Pouch is an open-source project created to promote the container technology movement.","fork":true,"url":"https://api.github.com/repos/CodeJuan/pouch","forks_url":"https://api.github.com/repos/CodeJuan/pouch/forks","keys_url":"https://api.github.com/repos/CodeJuan/pouch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeJuan/pouch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeJuan/pouch/teams","hooks_url":"https://api.github.com/repos/CodeJuan/pouch/hooks","issue_events_url":"https://api.github.com/repos/CodeJuan/pouch/issues/events{/number}","events_url":"https://api.github.com/repos/CodeJuan/pouch/events","assignees_url":"https://api.github.com/repos/CodeJuan/pouch/assignees{/user}","branches_url":"https://api.github.com/repos/CodeJuan/pouch/branches{/branch}","tags_url":"https://api.github.com/repos/CodeJuan/pouch/tags","blobs_url":"https://api.github.com/repos/CodeJuan/pouch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeJuan/pouch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeJuan/pouch/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeJuan/pouch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeJuan/pouch/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeJuan/pouch/languages","stargazers_url":"https://api.github.com/repos/CodeJuan/pouch/stargazers","contributors_url":"https://api.github.com/repos/CodeJuan/pouch/contributors","subscribers_url":"https://api.github.com/repos/CodeJuan/pouch/subscribers","subscription_url":"https://api.github.com/repos/CodeJuan/pouch/subscription","commits_url":"https://api.github.com/repos/CodeJuan/pouch/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeJuan/pouch/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeJuan/pouch/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeJuan/pouch/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeJuan/pouch/contents/{+path}","compare_url":"https://api.github.com/repos/CodeJuan/pouch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeJuan/pouch/merges","archive_url":"https://api.github.com/repos/CodeJuan/pouch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeJuan/pouch/downloads","issues_url":"https://api.github.com/repos/CodeJuan/pouch/issues{/number}","pulls_url":"https://api.github.com/repos/CodeJuan/pouch/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeJuan/pouch/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeJuan/pouch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeJuan/pouch/labels{/name}","releases_url":"https://api.github.com/repos/CodeJuan/pouch/releases{/id}","deployments_url":"https://api.github.com/repos/CodeJuan/pouch/deployments","created_at":"2017-11-20T07:00:32Z","updated_at":"2018-07-31T09:32:00Z","pushed_at":"2018-08-01T01:47:19Z","git_url":"git://github.com/CodeJuan/pouch.git","ssh_url":"git@github.com:CodeJuan/pouch.git","clone_url":"https://github.com/CodeJuan/pouch.git","svn_url":"https://github.com/CodeJuan/pouch","homepage":"","size":18441,"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":1,"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":1,"watchers":0,"default_branch":"master"}},"base":{"label":"alibaba:master","ref":"master","sha":"f590a6dfda6982a1b3d15c0fe857b6b304ed0488","user":{"login":"alibaba","id":1961952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NjE5NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"repo":{"id":102555965,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI1NTU5NjU=","name":"pouch","full_name":"alibaba/pouch","owner":{"login":"alibaba","id":1961952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NjE5NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alibaba/pouch","description":"PouchContainer is an open-source project created to promote the container technology movement.","fork":false,"url":"https://api.github.com/repos/alibaba/pouch","forks_url":"https://api.github.com/repos/alibaba/pouch/forks","keys_url":"https://api.github.com/repos/alibaba/pouch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibaba/pouch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibaba/pouch/teams","hooks_url":"https://api.github.com/repos/alibaba/pouch/hooks","issue_events_url":"https://api.github.com/repos/alibaba/pouch/issues/events{/number}","events_url":"https://api.github.com/repos/alibaba/pouch/events","assignees_url":"https://api.github.com/repos/alibaba/pouch/assignees{/user}","branches_url":"https://api.github.com/repos/alibaba/pouch/branches{/branch}","tags_url":"https://api.github.com/repos/alibaba/pouch/tags","blobs_url":"https://api.github.com/repos/alibaba/pouch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibaba/pouch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibaba/pouch/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibaba/pouch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibaba/pouch/statuses/{sha}","languages_url":"https://api.github.com/repos/alibaba/pouch/languages","stargazers_url":"https://api.github.com/repos/alibaba/pouch/stargazers","contributors_url":"https://api.github.com/repos/alibaba/pouch/contributors","subscribers_url":"https://api.github.com/repos/alibaba/pouch/subscribers","subscription_url":"https://api.github.com/repos/alibaba/pouch/subscription","commits_url":"https://api.github.com/repos/alibaba/pouch/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibaba/pouch/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibaba/pouch/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibaba/pouch/issues/comments{/number}","contents_url":"https://api.github.com/repos/alibaba/pouch/contents/{+path}","compare_url":"https://api.github.com/repos/alibaba/pouch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibaba/pouch/merges","archive_url":"https://api.github.com/repos/alibaba/pouch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibaba/pouch/downloads","issues_url":"https://api.github.com/repos/alibaba/pouch/issues{/number}","pulls_url":"https://api.github.com/repos/alibaba/pouch/pulls{/number}","milestones_url":"https://api.github.com/repos/alibaba/pouch/milestones{/number}","notifications_url":"https://api.github.com/repos/alibaba/pouch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibaba/pouch/labels{/name}","releases_url":"https://api.github.com/repos/alibaba/pouch/releases{/id}","deployments_url":"https://api.github.com/repos/alibaba/pouch/deployments","created_at":"2017-09-06T03:01:51Z","updated_at":"2018-08-01T05:26:25Z","pushed_at":"2018-08-01T02:53:22Z","git_url":"git://github.com/alibaba/pouch.git","ssh_url":"git@github.com:alibaba/pouch.git","clone_url":"https://github.com/alibaba/pouch.git","svn_url":"https://github.com/alibaba/pouch","homepage":"","size":18503,"stargazers_count":2979,"watchers_count":2979,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":771,"mirror_url":null,"archived":false,"open_issues_count":215,"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":771,"open_issues":215,"watchers":2979,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alibaba/pouch/pulls/2029"},"html":{"href":"https://github.com/alibaba/pouch/pull/2029"},"issue":{"href":"https://api.github.com/repos/alibaba/pouch/issues/2029"},"comments":{"href":"https://api.github.com/repos/alibaba/pouch/issues/2029/comments"},"review_comments":{"href":"https://api.github.com/repos/alibaba/pouch/pulls/2029/comments"},"review_comment":{"href":"https://api.github.com/repos/alibaba/pouch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alibaba/pouch/pulls/2029/commits"},"statuses":{"href":"https://api.github.com/repos/alibaba/pouch/statuses/a85898d55bfcbb53c48cfe4784a6127ce9f9100e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"allencloud"}}