{"action":"closed","number":54,"pull_request":{"url":"https://api.github.com/repos/cristim/autospotting/pulls/54","id":98138141,"html_url":"https://github.com/cristim/autospotting/pull/54","diff_url":"https://github.com/cristim/autospotting/pull/54.diff","patch_url":"https://github.com/cristim/autospotting/pull/54.patch","issue_url":"https://api.github.com/repos/cristim/autospotting/issues/54","number":54,"state":"closed","locked":false,"title":"algo: Making the minimum on-demand value configurable","user":{"login":"xlr-8","id":1583638,"avatar_url":"https://avatars.githubusercontent.com/u/1583638?v=3","gravatar_id":"","url":"https://api.github.com/users/xlr-8","html_url":"https://github.com/xlr-8","followers_url":"https://api.github.com/users/xlr-8/followers","following_url":"https://api.github.com/users/xlr-8/following{/other_user}","gists_url":"https://api.github.com/users/xlr-8/gists{/gist_id}","starred_url":"https://api.github.com/users/xlr-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlr-8/subscriptions","organizations_url":"https://api.github.com/users/xlr-8/orgs","repos_url":"https://api.github.com/users/xlr-8/repos","events_url":"https://api.github.com/users/xlr-8/events{/privacy}","received_events_url":"https://api.github.com/users/xlr-8/received_events","type":"User","site_admin":false},"body":"The configuration regarding the minimum instance number can be\r\nconfigured from the CLI as well as from the tag of the ASG.\r\n\r\nThe priority goes as following:\r\n* Tag - Strict number\r\n* Tag - Percentage\r\n* CLI - Strict number\r\n* CLI - Percentage\r\n\r\nWhich means the CLI parameters can be overidden by the tags, but\r\npercentages value can never overide the strict numbers - except if\r\nthe value is invalid (out of range, negative, etc). Which means,\r\nthat as soon as a good value is found the processing stops.\r\n\r\nThe percentage is the percentage of instances currently in the ASG,\r\nnot Max/Min/Desired. Please note that the values are rounded up,\r\nso use it with logic.\r\n\r\nIf the number of On-Demand is above the minimum required, then the\r\nprocessing of the ASG continues.\r\nIf the value is equal, then nothing needs to be done, the processing\r\nstops.\r\nIf the value is below, then it means that a spot-instance need to be\r\nterminated in order for the ELB to recreate an On-Demand instance.\r\n\r\nI believe that with the current way of making the algorithm\r\nconfigurable, it shouldn't be too complicated to implement extra\r\nelements.\r\n\r\nReviews are more than welcome.\r\n\r\nExtra notes to consider:\r\n*  ~~many if/else are for logging/debugging and could be removed~~\r\n* tag values can obviously be changed, it was just to test the functioning\r\n* added date/time in the logs to make it, more like proper logs\r\n* some logs about regions have been moved to 'debug' to avoid extra unnecessary information\r\n* should help and/or close such issues: https://github.com/cristim/autospotting/issues/5 https://github.com/cristim/autospotting/issues/10 https://github.com/cristim/autospotting/issues/12 https://github.com/cristim/autospotting/issues/21 https://github.com/cristim/autospotting/issues/47 ","created_at":"2016-12-15T12:04:18Z","updated_at":"2016-12-21T23:18:37Z","closed_at":"2016-12-21T23:18:37Z","merged_at":"2016-12-21T23:18:37Z","merge_commit_sha":"dda01eba0ef1a7d0109528443dc573813318337b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cristim/autospotting/pulls/54/commits","review_comments_url":"https://api.github.com/repos/cristim/autospotting/pulls/54/comments","review_comment_url":"https://api.github.com/repos/cristim/autospotting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cristim/autospotting/issues/54/comments","statuses_url":"https://api.github.com/repos/cristim/autospotting/statuses/b79de7ef9d011040edc3a2c7c270772dd0724e62","head":{"label":"xlr-8:conf-algo","ref":"conf-algo","sha":"b79de7ef9d011040edc3a2c7c270772dd0724e62","user":{"login":"xlr-8","id":1583638,"avatar_url":"https://avatars.githubusercontent.com/u/1583638?v=3","gravatar_id":"","url":"https://api.github.com/users/xlr-8","html_url":"https://github.com/xlr-8","followers_url":"https://api.github.com/users/xlr-8/followers","following_url":"https://api.github.com/users/xlr-8/following{/other_user}","gists_url":"https://api.github.com/users/xlr-8/gists{/gist_id}","starred_url":"https://api.github.com/users/xlr-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlr-8/subscriptions","organizations_url":"https://api.github.com/users/xlr-8/orgs","repos_url":"https://api.github.com/users/xlr-8/repos","events_url":"https://api.github.com/users/xlr-8/events{/privacy}","received_events_url":"https://api.github.com/users/xlr-8/received_events","type":"User","site_admin":false},"repo":{"id":75390090,"name":"autospotting","full_name":"xlr-8/autospotting","owner":{"login":"xlr-8","id":1583638,"avatar_url":"https://avatars.githubusercontent.com/u/1583638?v=3","gravatar_id":"","url":"https://api.github.com/users/xlr-8","html_url":"https://github.com/xlr-8","followers_url":"https://api.github.com/users/xlr-8/followers","following_url":"https://api.github.com/users/xlr-8/following{/other_user}","gists_url":"https://api.github.com/users/xlr-8/gists{/gist_id}","starred_url":"https://api.github.com/users/xlr-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlr-8/subscriptions","organizations_url":"https://api.github.com/users/xlr-8/orgs","repos_url":"https://api.github.com/users/xlr-8/repos","events_url":"https://api.github.com/users/xlr-8/events{/privacy}","received_events_url":"https://api.github.com/users/xlr-8/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xlr-8/autospotting","description":"Simple tool that can greatly reduce AWS EC2 costs by automatically replacing on-demand instances from existing AutoScaling groups with compatible but much cheaper spot instances.","fork":true,"url":"https://api.github.com/repos/xlr-8/autospotting","forks_url":"https://api.github.com/repos/xlr-8/autospotting/forks","keys_url":"https://api.github.com/repos/xlr-8/autospotting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xlr-8/autospotting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xlr-8/autospotting/teams","hooks_url":"https://api.github.com/repos/xlr-8/autospotting/hooks","issue_events_url":"https://api.github.com/repos/xlr-8/autospotting/issues/events{/number}","events_url":"https://api.github.com/repos/xlr-8/autospotting/events","assignees_url":"https://api.github.com/repos/xlr-8/autospotting/assignees{/user}","branches_url":"https://api.github.com/repos/xlr-8/autospotting/branches{/branch}","tags_url":"https://api.github.com/repos/xlr-8/autospotting/tags","blobs_url":"https://api.github.com/repos/xlr-8/autospotting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xlr-8/autospotting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xlr-8/autospotting/git/refs{/sha}","trees_url":"https://api.github.com/repos/xlr-8/autospotting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xlr-8/autospotting/statuses/{sha}","languages_url":"https://api.github.com/repos/xlr-8/autospotting/languages","stargazers_url":"https://api.github.com/repos/xlr-8/autospotting/stargazers","contributors_url":"https://api.github.com/repos/xlr-8/autospotting/contributors","subscribers_url":"https://api.github.com/repos/xlr-8/autospotting/subscribers","subscription_url":"https://api.github.com/repos/xlr-8/autospotting/subscription","commits_url":"https://api.github.com/repos/xlr-8/autospotting/commits{/sha}","git_commits_url":"https://api.github.com/repos/xlr-8/autospotting/git/commits{/sha}","comments_url":"https://api.github.com/repos/xlr-8/autospotting/comments{/number}","issue_comment_url":"https://api.github.com/repos/xlr-8/autospotting/issues/comments{/number}","contents_url":"https://api.github.com/repos/xlr-8/autospotting/contents/{+path}","compare_url":"https://api.github.com/repos/xlr-8/autospotting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xlr-8/autospotting/merges","archive_url":"https://api.github.com/repos/xlr-8/autospotting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xlr-8/autospotting/downloads","issues_url":"https://api.github.com/repos/xlr-8/autospotting/issues{/number}","pulls_url":"https://api.github.com/repos/xlr-8/autospotting/pulls{/number}","milestones_url":"https://api.github.com/repos/xlr-8/autospotting/milestones{/number}","notifications_url":"https://api.github.com/repos/xlr-8/autospotting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xlr-8/autospotting/labels{/name}","releases_url":"https://api.github.com/repos/xlr-8/autospotting/releases{/id}","deployments_url":"https://api.github.com/repos/xlr-8/autospotting/deployments","created_at":"2016-12-02T11:31:26Z","updated_at":"2016-12-15T09:42:04Z","pushed_at":"2016-12-19T23:45:49Z","git_url":"git://github.com/xlr-8/autospotting.git","ssh_url":"git@github.com:xlr-8/autospotting.git","clone_url":"https://github.com/xlr-8/autospotting.git","svn_url":"https://github.com/xlr-8/autospotting","homepage":"http://autospotting.cloudprowess.com","size":724,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"cristim:master","ref":"master","sha":"df2e3038313bda2c4e404292e3dbc91a230da1e6","user":{"login":"cristim","id":95209,"avatar_url":"https://avatars.githubusercontent.com/u/95209?v=3","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"repo":{"id":63696142,"name":"autospotting","full_name":"cristim/autospotting","owner":{"login":"cristim","id":95209,"avatar_url":"https://avatars.githubusercontent.com/u/95209?v=3","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cristim/autospotting","description":"Simple tool that can greatly reduce AWS EC2 costs by automatically replacing on-demand instances from existing AutoScaling groups with compatible but much cheaper spot instances.","fork":false,"url":"https://api.github.com/repos/cristim/autospotting","forks_url":"https://api.github.com/repos/cristim/autospotting/forks","keys_url":"https://api.github.com/repos/cristim/autospotting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cristim/autospotting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cristim/autospotting/teams","hooks_url":"https://api.github.com/repos/cristim/autospotting/hooks","issue_events_url":"https://api.github.com/repos/cristim/autospotting/issues/events{/number}","events_url":"https://api.github.com/repos/cristim/autospotting/events","assignees_url":"https://api.github.com/repos/cristim/autospotting/assignees{/user}","branches_url":"https://api.github.com/repos/cristim/autospotting/branches{/branch}","tags_url":"https://api.github.com/repos/cristim/autospotting/tags","blobs_url":"https://api.github.com/repos/cristim/autospotting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cristim/autospotting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cristim/autospotting/git/refs{/sha}","trees_url":"https://api.github.com/repos/cristim/autospotting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cristim/autospotting/statuses/{sha}","languages_url":"https://api.github.com/repos/cristim/autospotting/languages","stargazers_url":"https://api.github.com/repos/cristim/autospotting/stargazers","contributors_url":"https://api.github.com/repos/cristim/autospotting/contributors","subscribers_url":"https://api.github.com/repos/cristim/autospotting/subscribers","subscription_url":"https://api.github.com/repos/cristim/autospotting/subscription","commits_url":"https://api.github.com/repos/cristim/autospotting/commits{/sha}","git_commits_url":"https://api.github.com/repos/cristim/autospotting/git/commits{/sha}","comments_url":"https://api.github.com/repos/cristim/autospotting/comments{/number}","issue_comment_url":"https://api.github.com/repos/cristim/autospotting/issues/comments{/number}","contents_url":"https://api.github.com/repos/cristim/autospotting/contents/{+path}","compare_url":"https://api.github.com/repos/cristim/autospotting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cristim/autospotting/merges","archive_url":"https://api.github.com/repos/cristim/autospotting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cristim/autospotting/downloads","issues_url":"https://api.github.com/repos/cristim/autospotting/issues{/number}","pulls_url":"https://api.github.com/repos/cristim/autospotting/pulls{/number}","milestones_url":"https://api.github.com/repos/cristim/autospotting/milestones{/number}","notifications_url":"https://api.github.com/repos/cristim/autospotting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cristim/autospotting/labels{/name}","releases_url":"https://api.github.com/repos/cristim/autospotting/releases{/id}","deployments_url":"https://api.github.com/repos/cristim/autospotting/deployments","created_at":"2016-07-19T13:27:31Z","updated_at":"2016-12-17T01:08:55Z","pushed_at":"2016-12-21T23:18:37Z","git_url":"git://github.com/cristim/autospotting.git","ssh_url":"git@github.com:cristim/autospotting.git","clone_url":"https://github.com/cristim/autospotting.git","svn_url":"https://github.com/cristim/autospotting","homepage":"http://autospotting.cloudprowess.com","size":474,"stargazers_count":85,"watchers_count":85,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":26,"forks":17,"open_issues":26,"watchers":85,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/54"},"html":{"href":"https://github.com/cristim/autospotting/pull/54"},"issue":{"href":"https://api.github.com/repos/cristim/autospotting/issues/54"},"comments":{"href":"https://api.github.com/repos/cristim/autospotting/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/cristim/autospotting/statuses/b79de7ef9d011040edc3a2c7c270772dd0724e62"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"cristim","id":95209,"avatar_url":"https://avatars.githubusercontent.com/u/95209?v=3","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"comments":8,"review_comments":5,"commits":6,"additions":1372,"deletions":30,"changed_files":10}}
{"actor":{"display_login":"cristim"}}