{"action":"closed","number":223,"pull_request":{"url":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/223","id":240609285,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwNjA5Mjg1","html_url":"https://github.com/aws/amazon-ecs-init/pull/223","diff_url":"https://github.com/aws/amazon-ecs-init/pull/223.diff","patch_url":"https://github.com/aws/amazon-ecs-init/pull/223.patch","issue_url":"https://api.github.com/repos/aws/amazon-ecs-init/issues/223","number":223,"state":"closed","locked":false,"title":"bind mount GPU folder only when devices are present","user":{"login":"sharanyad","id":14119911,"node_id":"MDQ6VXNlcjE0MTE5OTEx","avatar_url":"https://avatars1.githubusercontent.com/u/14119911?v=4","gravatar_id":"","url":"https://api.github.com/users/sharanyad","html_url":"https://github.com/sharanyad","followers_url":"https://api.github.com/users/sharanyad/followers","following_url":"https://api.github.com/users/sharanyad/following{/other_user}","gists_url":"https://api.github.com/users/sharanyad/gists{/gist_id}","starred_url":"https://api.github.com/users/sharanyad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharanyad/subscriptions","organizations_url":"https://api.github.com/users/sharanyad/orgs","repos_url":"https://api.github.com/users/sharanyad/repos","events_url":"https://api.github.com/users/sharanyad/events{/privacy}","received_events_url":"https://api.github.com/users/sharanyad/received_events","type":"User","site_admin":false},"body":"<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/aws/amazon-ecs-init/blob/master/CONTRIBUTING.md\r\n\r\nPlease provide the following information:\r\n-->\r\n\r\n### Summary\r\n`ECS_ENABLE_GPU_SUPPORT=true` is now present in all instance types. \r\nas a result of this, `/var/lib/ecs/gpu` folder is bind mounted to agent container on non p2,p3 instances. \r\nHence, check for presence of GPUs in the instances and then bind mount / create the gpu folder. \r\n\r\n\r\n### Implementation details\r\nManual testing (after the fix)\r\nAgent container is inspected for any bind mounts of the folder `/var/lib/ecs`\r\n\r\nOn a m4.2xl instance: \r\n```\r\n# cat /var/lib/ecs/ecs.config\r\nECS_ENABLE_GPU_SUPPORT=true\r\n# ./amazon-ecs-init pre-start\r\n2018-12-22T01:20:44Z [INFO] pre-start\r\n# ls -l /var/lib/ecs/gpu\r\nls: cannot access /var/lib/ecs/gpu: No such file or directory\r\n# ./amazon-ecs-init start\r\n2018-12-22T01:34:19Z [INFO] start\r\n\r\n$ docker inspect 9e2af4ee7869 | grep /var/lib/ecs/gpu\r\n[ec2-user@ip-172-31-18-88 ~]$ *no results*\r\n```\r\n\r\nOn a p3.2xl instance: \r\n```\r\n# ./amazon-ecs-init pre-start\r\n2018-12-22T01:25:44Z [INFO] pre-start\r\n# cat /var/lib/ecs/gpu/nvidia-gpu-info.json | python -mjson.tool\r\n{\r\n    \"DriverVersion\": \"396.26\",\r\n    \"GPUIDs\": [\r\n        \"GPU-095d7090-23f1-c268-804a-028b1ee057aa\"\r\n    ]\r\n}\r\n# ./amazon-ecs-init start\r\n2018-12-22T01:26:01Z [INFO] start\r\n\r\n$ docker inspect fc1898aa074e | grep /var/lib/ecs/gpu\r\n                \"/var/lib/ecs/gpu:/var/lib/ecs/gpu\",\r\n                \"Source\": \"/var/lib/ecs/gpu\",\r\n                \"Destination\": \"/var/lib/ecs/gpu\",\r\n\r\nfound in bind mounts section:\r\n            {\r\n                \"Type\": \"bind\",\r\n                \"Source\": \"/var/lib/ecs/gpu\",\r\n                \"Destination\": \"/var/lib/ecs/gpu\",\r\n                \"Mode\": \"\",\r\n                \"RW\": true,\r\n                \"Propagation\": \"rprivate\"\r\n            },\r\n```\r\n\r\n### Testing\r\n<!-- How was this tested? -->\r\n\r\nNew tests cover the changes: yes\r\n\r\n### Description for the changelog\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog. Prefix the summary with an\r\nindication of the change type, Feature, Enhancement, or Bug. Here is an example:\r\nFeature - Upgrade the something library to the latest stable version 1.2.3\r\n-->\r\n\r\n\r\n### Licensing\r\n<!--\r\nPlease confirm that this contribution is under the terms of the Apache 2.0\r\nLicense.\r\n-->\r\nThis contribution is under the terms of the Apache 2.0 License: yes\r\n","created_at":"2018-12-22T01:41:50Z","updated_at":"2018-12-24T19:05:50Z","closed_at":"2018-12-24T19:05:49Z","merged_at":"2018-12-24T19:05:49Z","merge_commit_sha":"8a00dfb70816a0748cb777920c509454cf4aade2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jhaynes","id":1203056,"node_id":"MDQ6VXNlcjEyMDMwNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1203056?v=4","gravatar_id":"","url":"https://api.github.com/users/jhaynes","html_url":"https://github.com/jhaynes","followers_url":"https://api.github.com/users/jhaynes/followers","following_url":"https://api.github.com/users/jhaynes/following{/other_user}","gists_url":"https://api.github.com/users/jhaynes/gists{/gist_id}","starred_url":"https://api.github.com/users/jhaynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhaynes/subscriptions","organizations_url":"https://api.github.com/users/jhaynes/orgs","repos_url":"https://api.github.com/users/jhaynes/repos","events_url":"https://api.github.com/users/jhaynes/events{/privacy}","received_events_url":"https://api.github.com/users/jhaynes/received_events","type":"User","site_admin":false},{"login":"petderek","id":1487156,"node_id":"MDQ6VXNlcjE0ODcxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1487156?v=4","gravatar_id":"","url":"https://api.github.com/users/petderek","html_url":"https://github.com/petderek","followers_url":"https://api.github.com/users/petderek/followers","following_url":"https://api.github.com/users/petderek/following{/other_user}","gists_url":"https://api.github.com/users/petderek/gists{/gist_id}","starred_url":"https://api.github.com/users/petderek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petderek/subscriptions","organizations_url":"https://api.github.com/users/petderek/orgs","repos_url":"https://api.github.com/users/petderek/repos","events_url":"https://api.github.com/users/petderek/events{/privacy}","received_events_url":"https://api.github.com/users/petderek/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/223/commits","review_comments_url":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/223/comments","review_comment_url":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-init/issues/223/comments","statuses_url":"https://api.github.com/repos/aws/amazon-ecs-init/statuses/17026096e481bdb08824d9af4bd918b6ff53ab0e","head":{"label":"sharanyad:gpu-fix","ref":"gpu-fix","sha":"17026096e481bdb08824d9af4bd918b6ff53ab0e","user":{"login":"sharanyad","id":14119911,"node_id":"MDQ6VXNlcjE0MTE5OTEx","avatar_url":"https://avatars1.githubusercontent.com/u/14119911?v=4","gravatar_id":"","url":"https://api.github.com/users/sharanyad","html_url":"https://github.com/sharanyad","followers_url":"https://api.github.com/users/sharanyad/followers","following_url":"https://api.github.com/users/sharanyad/following{/other_user}","gists_url":"https://api.github.com/users/sharanyad/gists{/gist_id}","starred_url":"https://api.github.com/users/sharanyad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharanyad/subscriptions","organizations_url":"https://api.github.com/users/sharanyad/orgs","repos_url":"https://api.github.com/users/sharanyad/repos","events_url":"https://api.github.com/users/sharanyad/events{/privacy}","received_events_url":"https://api.github.com/users/sharanyad/received_events","type":"User","site_admin":false},"repo":{"id":131761143,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE3NjExNDM=","name":"amazon-ecs-init","full_name":"sharanyad/amazon-ecs-init","private":false,"owner":{"login":"sharanyad","id":14119911,"node_id":"MDQ6VXNlcjE0MTE5OTEx","avatar_url":"https://avatars1.githubusercontent.com/u/14119911?v=4","gravatar_id":"","url":"https://api.github.com/users/sharanyad","html_url":"https://github.com/sharanyad","followers_url":"https://api.github.com/users/sharanyad/followers","following_url":"https://api.github.com/users/sharanyad/following{/other_user}","gists_url":"https://api.github.com/users/sharanyad/gists{/gist_id}","starred_url":"https://api.github.com/users/sharanyad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharanyad/subscriptions","organizations_url":"https://api.github.com/users/sharanyad/orgs","repos_url":"https://api.github.com/users/sharanyad/repos","events_url":"https://api.github.com/users/sharanyad/events{/privacy}","received_events_url":"https://api.github.com/users/sharanyad/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sharanyad/amazon-ecs-init","description":"Amazon EC2 Container Service RPM","fork":true,"url":"https://api.github.com/repos/sharanyad/amazon-ecs-init","forks_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/forks","keys_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/teams","hooks_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/hooks","issue_events_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/issues/events{/number}","events_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/events","assignees_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/assignees{/user}","branches_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/branches{/branch}","tags_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/tags","blobs_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/statuses/{sha}","languages_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/languages","stargazers_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/stargazers","contributors_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/contributors","subscribers_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/subscribers","subscription_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/subscription","commits_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/contents/{+path}","compare_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/merges","archive_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/downloads","issues_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/issues{/number}","pulls_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/pulls{/number}","milestones_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/milestones{/number}","notifications_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/labels{/name}","releases_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/releases{/id}","deployments_url":"https://api.github.com/repos/sharanyad/amazon-ecs-init/deployments","created_at":"2018-05-01T20:43:56Z","updated_at":"2018-05-01T20:43:58Z","pushed_at":"2018-12-22T01:10:40Z","git_url":"git://github.com/sharanyad/amazon-ecs-init.git","ssh_url":"git@github.com:sharanyad/amazon-ecs-init.git","clone_url":"https://github.com/sharanyad/amazon-ecs-init.git","svn_url":"https://github.com/sharanyad/amazon-ecs-init","homepage":"http://aws.amazon.com/ecs","size":2609,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aws:gpu-support","ref":"gpu-support","sha":"b55385747204f5e21b702d5773bea47f0d04c054","user":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":27732828,"node_id":"MDEwOlJlcG9zaXRvcnkyNzczMjgyOA==","name":"amazon-ecs-init","full_name":"aws/amazon-ecs-init","private":false,"owner":{"login":"aws","id":2232217,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzIyMTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aws/amazon-ecs-init","description":"Amazon Elastic Container Service RPM","fork":false,"url":"https://api.github.com/repos/aws/amazon-ecs-init","forks_url":"https://api.github.com/repos/aws/amazon-ecs-init/forks","keys_url":"https://api.github.com/repos/aws/amazon-ecs-init/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/amazon-ecs-init/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/amazon-ecs-init/teams","hooks_url":"https://api.github.com/repos/aws/amazon-ecs-init/hooks","issue_events_url":"https://api.github.com/repos/aws/amazon-ecs-init/issues/events{/number}","events_url":"https://api.github.com/repos/aws/amazon-ecs-init/events","assignees_url":"https://api.github.com/repos/aws/amazon-ecs-init/assignees{/user}","branches_url":"https://api.github.com/repos/aws/amazon-ecs-init/branches{/branch}","tags_url":"https://api.github.com/repos/aws/amazon-ecs-init/tags","blobs_url":"https://api.github.com/repos/aws/amazon-ecs-init/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/amazon-ecs-init/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/amazon-ecs-init/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/amazon-ecs-init/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/amazon-ecs-init/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/amazon-ecs-init/languages","stargazers_url":"https://api.github.com/repos/aws/amazon-ecs-init/stargazers","contributors_url":"https://api.github.com/repos/aws/amazon-ecs-init/contributors","subscribers_url":"https://api.github.com/repos/aws/amazon-ecs-init/subscribers","subscription_url":"https://api.github.com/repos/aws/amazon-ecs-init/subscription","commits_url":"https://api.github.com/repos/aws/amazon-ecs-init/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/amazon-ecs-init/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-init/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/amazon-ecs-init/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/amazon-ecs-init/contents/{+path}","compare_url":"https://api.github.com/repos/aws/amazon-ecs-init/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/amazon-ecs-init/merges","archive_url":"https://api.github.com/repos/aws/amazon-ecs-init/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/amazon-ecs-init/downloads","issues_url":"https://api.github.com/repos/aws/amazon-ecs-init/issues{/number}","pulls_url":"https://api.github.com/repos/aws/amazon-ecs-init/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/amazon-ecs-init/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/amazon-ecs-init/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/amazon-ecs-init/labels{/name}","releases_url":"https://api.github.com/repos/aws/amazon-ecs-init/releases{/id}","deployments_url":"https://api.github.com/repos/aws/amazon-ecs-init/deployments","created_at":"2014-12-08T20:11:28Z","updated_at":"2018-12-19T08:24:55Z","pushed_at":"2018-12-24T19:05:49Z","git_url":"git://github.com/aws/amazon-ecs-init.git","ssh_url":"git@github.com:aws/amazon-ecs-init.git","clone_url":"https://github.com/aws/amazon-ecs-init.git","svn_url":"https://github.com/aws/amazon-ecs-init","homepage":"http://aws.amazon.com/ecs","size":2606,"stargazers_count":119,"watchers_count":119,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":79,"mirror_url":null,"archived":false,"open_issues_count":26,"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":79,"open_issues":26,"watchers":119,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/223"},"html":{"href":"https://github.com/aws/amazon-ecs-init/pull/223"},"issue":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/issues/223"},"comments":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/issues/223/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/223/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/pulls/223/commits"},"statuses":{"href":"https://api.github.com/repos/aws/amazon-ecs-init/statuses/17026096e481bdb08824d9af4bd918b6ff53ab0e"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"sharanyad","id":14119911,"node_id":"MDQ6VXNlcjE0MTE5OTEx","avatar_url":"https://avatars1.githubusercontent.com/u/14119911?v=4","gravatar_id":"","url":"https://api.github.com/users/sharanyad","html_url":"https://github.com/sharanyad","followers_url":"https://api.github.com/users/sharanyad/followers","following_url":"https://api.github.com/users/sharanyad/following{/other_user}","gists_url":"https://api.github.com/users/sharanyad/gists{/gist_id}","starred_url":"https://api.github.com/users/sharanyad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharanyad/subscriptions","organizations_url":"https://api.github.com/users/sharanyad/orgs","repos_url":"https://api.github.com/users/sharanyad/repos","events_url":"https://api.github.com/users/sharanyad/events{/privacy}","received_events_url":"https://api.github.com/users/sharanyad/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":71,"deletions":2,"changed_files":2}}
{"actor":{"display_login":"sharanyad"}}