{"action":"created","comment":{"url":"https://api.github.com/repos/ray-project/ray/pulls/comments/158208350","pull_request_review_id":84980719,"id":158208350,"diff_hunk":"@@ -4,8 +4,10 @@\n \n import json\n import hashlib\n+import math","path":"python/ray/autoscaler/autoscaler.py","position":4,"original_position":4,"commit_id":"03f47de082538a645d9afdc1ce075e244ae9b503","original_commit_id":"03f47de082538a645d9afdc1ce075e244ae9b503","user":{"login":"robertnishihara","id":249517,"avatar_url":"https://avatars3.githubusercontent.com/u/249517?v=4","gravatar_id":"","url":"https://api.github.com/users/robertnishihara","html_url":"https://github.com/robertnishihara","followers_url":"https://api.github.com/users/robertnishihara/followers","following_url":"https://api.github.com/users/robertnishihara/following{/other_user}","gists_url":"https://api.github.com/users/robertnishihara/gists{/gist_id}","starred_url":"https://api.github.com/users/robertnishihara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertnishihara/subscriptions","organizations_url":"https://api.github.com/users/robertnishihara/orgs","repos_url":"https://api.github.com/users/robertnishihara/repos","events_url":"https://api.github.com/users/robertnishihara/events{/privacy}","received_events_url":"https://api.github.com/users/robertnishihara/received_events","type":"User","site_admin":false},"body":"shall we just use numpy everywhere?","created_at":"2017-12-21T07:04:11Z","updated_at":"2017-12-21T07:04:11Z","html_url":"https://github.com/ray-project/ray/pull/1348#discussion_r158208350","pull_request_url":"https://api.github.com/repos/ray-project/ray/pulls/1348","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ray-project/ray/pulls/comments/158208350"},"html":{"href":"https://github.com/ray-project/ray/pull/1348#discussion_r158208350"},"pull_request":{"href":"https://api.github.com/repos/ray-project/ray/pulls/1348"}}},"pull_request":{"url":"https://api.github.com/repos/ray-project/ray/pulls/1348","id":159102571,"html_url":"https://github.com/ray-project/ray/pull/1348","diff_url":"https://github.com/ray-project/ray/pull/1348.diff","patch_url":"https://github.com/ray-project/ray/pull/1348.patch","issue_url":"https://api.github.com/repos/ray-project/ray/issues/1348","number":1348,"state":"open","locked":false,"title":"[WIP] Auto-scale ray clusters based on GCS load metrics","user":{"login":"ericl","id":14922,"avatar_url":"https://avatars3.githubusercontent.com/u/14922?v=4","gravatar_id":"","url":"https://api.github.com/users/ericl","html_url":"https://github.com/ericl","followers_url":"https://api.github.com/users/ericl/followers","following_url":"https://api.github.com/users/ericl/following{/other_user}","gists_url":"https://api.github.com/users/ericl/gists{/gist_id}","starred_url":"https://api.github.com/users/ericl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericl/subscriptions","organizations_url":"https://api.github.com/users/ericl/orgs","repos_url":"https://api.github.com/users/ericl/repos","events_url":"https://api.github.com/users/ericl/events{/privacy}","received_events_url":"https://api.github.com/users/ericl/received_events","type":"User","site_admin":false},"body":"## What do these changes do?\r\n\r\nThis adds (experimental) auto-scaling support for Ray clusters based on GCS load metrics. The auto-scaling algorithm is as follows:\r\n- Based on current (instantaneous) load information, we compute the approximate number of \"used workers\". This is based on the bottleneck resource, e.g. if 8/8 GPUs are used in a 8-node cluster but all the CPUs are idle, the number of used nodes is still counted as 8. This number can also be fractional.\r\n- We scale that number by `1 / target_utilization_fraction` and round up to determine the target cluster size (subject to the `max_workers` constraint). The autoscaler control loop takes care of launching new nodes until the target cluster size is met.\r\n- When a node is idle for more than `idle_timeout_minutes`, we remove it from the cluster if that would not drop the cluster size below `min_workers`.\r\n\r\nTODO: unit tests","created_at":"2017-12-19T08:12:51Z","updated_at":"2017-12-21T07:04:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95c888e8102482a5cfac39b7c60a963c01a5e165","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ray-project/ray/pulls/1348/commits","review_comments_url":"https://api.github.com/repos/ray-project/ray/pulls/1348/comments","review_comment_url":"https://api.github.com/repos/ray-project/ray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ray-project/ray/issues/1348/comments","statuses_url":"https://api.github.com/repos/ray-project/ray/statuses/03f47de082538a645d9afdc1ce075e244ae9b503","head":{"label":"ericl:load-metrics","ref":"load-metrics","sha":"03f47de082538a645d9afdc1ce075e244ae9b503","user":{"login":"ericl","id":14922,"avatar_url":"https://avatars3.githubusercontent.com/u/14922?v=4","gravatar_id":"","url":"https://api.github.com/users/ericl","html_url":"https://github.com/ericl","followers_url":"https://api.github.com/users/ericl/followers","following_url":"https://api.github.com/users/ericl/following{/other_user}","gists_url":"https://api.github.com/users/ericl/gists{/gist_id}","starred_url":"https://api.github.com/users/ericl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericl/subscriptions","organizations_url":"https://api.github.com/users/ericl/orgs","repos_url":"https://api.github.com/users/ericl/repos","events_url":"https://api.github.com/users/ericl/events{/privacy}","received_events_url":"https://api.github.com/users/ericl/received_events","type":"User","site_admin":false},"repo":{"id":91077004,"name":"ray","full_name":"ericl/ray","owner":{"login":"ericl","id":14922,"avatar_url":"https://avatars3.githubusercontent.com/u/14922?v=4","gravatar_id":"","url":"https://api.github.com/users/ericl","html_url":"https://github.com/ericl","followers_url":"https://api.github.com/users/ericl/followers","following_url":"https://api.github.com/users/ericl/following{/other_user}","gists_url":"https://api.github.com/users/ericl/gists{/gist_id}","starred_url":"https://api.github.com/users/ericl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericl/subscriptions","organizations_url":"https://api.github.com/users/ericl/orgs","repos_url":"https://api.github.com/users/ericl/repos","events_url":"https://api.github.com/users/ericl/events{/privacy}","received_events_url":"https://api.github.com/users/ericl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericl/ray","description":"An experimental distributed execution engine","fork":true,"url":"https://api.github.com/repos/ericl/ray","forks_url":"https://api.github.com/repos/ericl/ray/forks","keys_url":"https://api.github.com/repos/ericl/ray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericl/ray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericl/ray/teams","hooks_url":"https://api.github.com/repos/ericl/ray/hooks","issue_events_url":"https://api.github.com/repos/ericl/ray/issues/events{/number}","events_url":"https://api.github.com/repos/ericl/ray/events","assignees_url":"https://api.github.com/repos/ericl/ray/assignees{/user}","branches_url":"https://api.github.com/repos/ericl/ray/branches{/branch}","tags_url":"https://api.github.com/repos/ericl/ray/tags","blobs_url":"https://api.github.com/repos/ericl/ray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericl/ray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericl/ray/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericl/ray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericl/ray/statuses/{sha}","languages_url":"https://api.github.com/repos/ericl/ray/languages","stargazers_url":"https://api.github.com/repos/ericl/ray/stargazers","contributors_url":"https://api.github.com/repos/ericl/ray/contributors","subscribers_url":"https://api.github.com/repos/ericl/ray/subscribers","subscription_url":"https://api.github.com/repos/ericl/ray/subscription","commits_url":"https://api.github.com/repos/ericl/ray/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericl/ray/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericl/ray/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericl/ray/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericl/ray/contents/{+path}","compare_url":"https://api.github.com/repos/ericl/ray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericl/ray/merges","archive_url":"https://api.github.com/repos/ericl/ray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericl/ray/downloads","issues_url":"https://api.github.com/repos/ericl/ray/issues{/number}","pulls_url":"https://api.github.com/repos/ericl/ray/pulls{/number}","milestones_url":"https://api.github.com/repos/ericl/ray/milestones{/number}","notifications_url":"https://api.github.com/repos/ericl/ray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericl/ray/labels{/name}","releases_url":"https://api.github.com/repos/ericl/ray/releases{/id}","deployments_url":"https://api.github.com/repos/ericl/ray/deployments","created_at":"2017-05-12T09:51:04Z","updated_at":"2017-05-12T09:51:06Z","pushed_at":"2017-12-21T06:59:07Z","git_url":"git://github.com/ericl/ray.git","ssh_url":"git@github.com:ericl/ray.git","clone_url":"https://github.com/ericl/ray.git","svn_url":"https://github.com/ericl/ray","homepage":"","size":8256,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ray-project:master","ref":"master","sha":"24b93b11231fe627c4b4527535ae0c83a99485f8","user":{"login":"ray-project","id":22125274,"avatar_url":"https://avatars3.githubusercontent.com/u/22125274?v=4","gravatar_id":"","url":"https://api.github.com/users/ray-project","html_url":"https://github.com/ray-project","followers_url":"https://api.github.com/users/ray-project/followers","following_url":"https://api.github.com/users/ray-project/following{/other_user}","gists_url":"https://api.github.com/users/ray-project/gists{/gist_id}","starred_url":"https://api.github.com/users/ray-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ray-project/subscriptions","organizations_url":"https://api.github.com/users/ray-project/orgs","repos_url":"https://api.github.com/users/ray-project/repos","events_url":"https://api.github.com/users/ray-project/events{/privacy}","received_events_url":"https://api.github.com/users/ray-project/received_events","type":"Organization","site_admin":false},"repo":{"id":71932349,"name":"ray","full_name":"ray-project/ray","owner":{"login":"ray-project","id":22125274,"avatar_url":"https://avatars3.githubusercontent.com/u/22125274?v=4","gravatar_id":"","url":"https://api.github.com/users/ray-project","html_url":"https://github.com/ray-project","followers_url":"https://api.github.com/users/ray-project/followers","following_url":"https://api.github.com/users/ray-project/following{/other_user}","gists_url":"https://api.github.com/users/ray-project/gists{/gist_id}","starred_url":"https://api.github.com/users/ray-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ray-project/subscriptions","organizations_url":"https://api.github.com/users/ray-project/orgs","repos_url":"https://api.github.com/users/ray-project/repos","events_url":"https://api.github.com/users/ray-project/events{/privacy}","received_events_url":"https://api.github.com/users/ray-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ray-project/ray","description":"A high-performance distributed execution engine","fork":false,"url":"https://api.github.com/repos/ray-project/ray","forks_url":"https://api.github.com/repos/ray-project/ray/forks","keys_url":"https://api.github.com/repos/ray-project/ray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ray-project/ray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ray-project/ray/teams","hooks_url":"https://api.github.com/repos/ray-project/ray/hooks","issue_events_url":"https://api.github.com/repos/ray-project/ray/issues/events{/number}","events_url":"https://api.github.com/repos/ray-project/ray/events","assignees_url":"https://api.github.com/repos/ray-project/ray/assignees{/user}","branches_url":"https://api.github.com/repos/ray-project/ray/branches{/branch}","tags_url":"https://api.github.com/repos/ray-project/ray/tags","blobs_url":"https://api.github.com/repos/ray-project/ray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ray-project/ray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ray-project/ray/git/refs{/sha}","trees_url":"https://api.github.com/repos/ray-project/ray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ray-project/ray/statuses/{sha}","languages_url":"https://api.github.com/repos/ray-project/ray/languages","stargazers_url":"https://api.github.com/repos/ray-project/ray/stargazers","contributors_url":"https://api.github.com/repos/ray-project/ray/contributors","subscribers_url":"https://api.github.com/repos/ray-project/ray/subscribers","subscription_url":"https://api.github.com/repos/ray-project/ray/subscription","commits_url":"https://api.github.com/repos/ray-project/ray/commits{/sha}","git_commits_url":"https://api.github.com/repos/ray-project/ray/git/commits{/sha}","comments_url":"https://api.github.com/repos/ray-project/ray/comments{/number}","issue_comment_url":"https://api.github.com/repos/ray-project/ray/issues/comments{/number}","contents_url":"https://api.github.com/repos/ray-project/ray/contents/{+path}","compare_url":"https://api.github.com/repos/ray-project/ray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ray-project/ray/merges","archive_url":"https://api.github.com/repos/ray-project/ray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ray-project/ray/downloads","issues_url":"https://api.github.com/repos/ray-project/ray/issues{/number}","pulls_url":"https://api.github.com/repos/ray-project/ray/pulls{/number}","milestones_url":"https://api.github.com/repos/ray-project/ray/milestones{/number}","notifications_url":"https://api.github.com/repos/ray-project/ray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ray-project/ray/labels{/name}","releases_url":"https://api.github.com/repos/ray-project/ray/releases{/id}","deployments_url":"https://api.github.com/repos/ray-project/ray/deployments","created_at":"2016-10-25T19:38:30Z","updated_at":"2017-12-21T06:44:03Z","pushed_at":"2017-12-21T07:02:40Z","git_url":"git://github.com/ray-project/ray.git","ssh_url":"git@github.com:ray-project/ray.git","clone_url":"https://github.com/ray-project/ray.git","svn_url":"https://github.com/ray-project/ray","homepage":"","size":7504,"stargazers_count":909,"watchers_count":909,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":166,"mirror_url":null,"archived":false,"open_issues_count":209,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":166,"open_issues":209,"watchers":909,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ray-project/ray/pulls/1348"},"html":{"href":"https://github.com/ray-project/ray/pull/1348"},"issue":{"href":"https://api.github.com/repos/ray-project/ray/issues/1348"},"comments":{"href":"https://api.github.com/repos/ray-project/ray/issues/1348/comments"},"review_comments":{"href":"https://api.github.com/repos/ray-project/ray/pulls/1348/comments"},"review_comment":{"href":"https://api.github.com/repos/ray-project/ray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ray-project/ray/pulls/1348/commits"},"statuses":{"href":"https://api.github.com/repos/ray-project/ray/statuses/03f47de082538a645d9afdc1ce075e244ae9b503"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"robertnishihara"}}