{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/35791077","id":35791077,"diff_hunk":"@@ -0,0 +1,88 @@\n+/*\n+Copyright 2015 The Kubernetes Authors All rights reserved.\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+    http://www.apache.org/licenses/LICENSE-2.0\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package oom\n+\n+import (\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"path\"\n+\t\"strconv\"\n+\n+\t\"github.com/docker/libcontainer/cgroups/fs\"\n+\t\"github.com/docker/libcontainer/configs\"\n+)\n+\n+// Writes 'value' to /proc/<pid>/oom_score_adj. PID = 0 means self\n+func ApplyOomScoreAdj(pid int, oomScoreAdj int) error {\n+\tif pid < 0 {\n+\t\treturn fmt.Errorf(\"invalid PID %d specified for oom_score_adj\", pid)\n+\t}\n+\n+\tvar pidStr string\n+\tif pid == 0 {\n+\t\tpidStr = \"self\"\n+\t} else {\n+\t\tpidStr = strconv.Itoa(pid)\n+\t}\n+\n+\toomScoreAdjPath := path.Join(\"/proc\", pidStr, \"oom_score_adj\")\n+\toom_value, err := ioutil.ReadFile(oomScoreAdjPath)\n+\tif err != nil {\n+\t\treturn fmt.Errorf(\"failed to read oom_score_adj: %v\", err)\n+\t} else if string(oom_value) != strconv.Itoa(oomScoreAdj) {\n+\t\tif err := ioutil.WriteFile(oomScoreAdjPath, []byte(strconv.Itoa(oomScoreAdj)), 0700); err != nil {\n+\t\t\treturn fmt.Errorf(\"failed to set oom_score_adj to %d: %v\", oomScoreAdj, err)\n+\t\t}\n+\t}\n+\n+\treturn nil\n+}\n+\n+// Writes 'value' to /proc/<pid>/oom_score_adj for all processes in cgroup cgroupName.\n+// Keeps trying to write until the process list of the cgroup stabilizes, or until maxTries tries.\n+func ApplyOomScoreAdjContainer(cgroupName string, oomScoreAdj, maxTries int) error {\n+\tfsManager := fs.Manager{\n+\t\tCgroups: &configs.Cgroup{\n+\t\t\tName:            cgroupName,\n+\t\t\tAllowAllDevices: true,","path":"pkg/util/oom/oom.go","position":58,"original_position":58,"commit_id":"27e7c6a98f2b19a0652b5c6f0540fec6974dc097","original_commit_id":"27e7c6a98f2b19a0652b5c6f0540fec6974dc097","user":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"body":"Will remove.","created_at":"2015-07-29T18:02:06Z","updated_at":"2015-07-29T18:02:06Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11967#discussion_r35791077","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/35791077"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11967#discussion_r35791077"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967","id":41084677,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11967","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11967.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11967.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11967","number":11967,"state":"open","locked":false,"title":"Add support for multiple tiers","user":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"body":"I refactored Kubelet and scheduler, so the unit tests fail. I'll fix the unit tests tonight, and add more tests later. Sending the PR now to parallelize review.\r\n\r\nI'm not sure who to assign it, so I'm cc'ing the people I discussed the proposal with. @vmarmol @bgrant0607 @vishh @rjnagal @davidopp @dchen1107 \r\n\r\nThanks!","created_at":"2015-07-29T03:44:52Z","updated_at":"2015-07-29T18:02:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65a8952127cc866f5cfd065b74e427eacb30bc40","assignee":{"login":"vmarmol","id":985208,"avatar_url":"https://avatars.githubusercontent.com/u/985208?v=3","gravatar_id":"","url":"https://api.github.com/users/vmarmol","html_url":"https://github.com/vmarmol","followers_url":"https://api.github.com/users/vmarmol/followers","following_url":"https://api.github.com/users/vmarmol/following{/other_user}","gists_url":"https://api.github.com/users/vmarmol/gists{/gist_id}","starred_url":"https://api.github.com/users/vmarmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmarmol/subscriptions","organizations_url":"https://api.github.com/users/vmarmol/orgs","repos_url":"https://api.github.com/users/vmarmol/repos","events_url":"https://api.github.com/users/vmarmol/events{/privacy}","received_events_url":"https://api.github.com/users/vmarmol/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11967/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/27e7c6a98f2b19a0652b5c6f0540fec6974dc097","head":{"label":"AnanyaKumar:qos","ref":"qos","sha":"27e7c6a98f2b19a0652b5c6f0540fec6974dc097","user":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"repo":{"id":37498217,"name":"kubernetes","full_name":"AnanyaKumar/kubernetes","owner":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnanyaKumar/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/AnanyaKumar/kubernetes","forks_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/forks","keys_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/teams","hooks_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/events","assignees_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/tags","blobs_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/languages","stargazers_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/subscription","commits_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/merges","archive_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/downloads","issues_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/AnanyaKumar/kubernetes/releases{/id}","created_at":"2015-06-16T00:14:24Z","updated_at":"2015-06-16T00:14:30Z","pushed_at":"2015-07-29T16:55:24Z","git_url":"git://github.com/AnanyaKumar/kubernetes.git","ssh_url":"git@github.com:AnanyaKumar/kubernetes.git","clone_url":"https://github.com/AnanyaKumar/kubernetes.git","svn_url":"https://github.com/AnanyaKumar/kubernetes","homepage":null,"size":93850,"stargazers_count":0,"watchers_count":0,"language":"Go","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:master","ref":"master","sha":"dde72229dc9cbbdacfb2e44b22d9d5b357027020","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":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","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/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-07-29T16:27:46Z","pushed_at":"2015-07-29T17:55:14Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":"http://kubernetes.io","size":333505,"stargazers_count":9435,"watchers_count":9435,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2173,"mirror_url":null,"open_issues_count":1678,"forks":2173,"open_issues":1678,"watchers":9435,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11967"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11967"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11967/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11967/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/27e7c6a98f2b19a0652b5c6f0540fec6974dc097"}}}}