{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/27958","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/27958/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/27958/comments","events_url":"https://api.github.com/repos/docker/docker/issues/27958/events","html_url":"https://github.com/docker/docker/pull/27958","id":186605564,"number":27958,"title":"Add `--cpus` flag to control cpu resources","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"labels":[{"id":175375520,"url":"https://api.github.com/repos/docker/docker/labels/status/3-docs-review","name":"status/3-docs-review","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/56","html_url":"https://github.com/docker/docker/milestones/1.13.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/56/labels","id":1839404,"number":56,"title":"1.13.0","description":"","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":108,"closed_issues":596,"state":"open","created_at":"2016-06-20T22:51:25Z","updated_at":"2016-11-04T22:05:15Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2016-11-01T18:11:49Z","updated_at":"2016-11-04T22:16:40Z","closed_at":"2016-11-04T18:18:17Z","pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/27958","html_url":"https://github.com/docker/docker/pull/27958","diff_url":"https://github.com/docker/docker/pull/27958.diff","patch_url":"https://github.com/docker/docker/pull/27958.patch"},"body":"**- What I did**\r\n\r\nThis fix tries to address the proposal raised in #27921 and add `--cpus` flag for `docker run/create`.\r\n\r\n**- How I did it**\r\n\r\nBasically, `--cpus` will allow user to specify a number (possibly partial) about how many CPUs the container will use. For example, on a 2-CPU system `--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share.\r\n\r\nThis fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay have a concept of NanoCPUs for tasks. The `--cpus` flag will translate the number into reused `NanoCPUs` to be consistent with swarmkit.\r\n\r\nRelated docs (`docker run` and Remote APIs) have been updated.\r\n\r\n**- How to verify it**\r\n\r\nThis fix adds integration tests to cover the changes.\r\n\r\n**- Description for the changelog**\r\n\r\nAdd `--cpus` flag to control cpu resources for `docker run/create`, and add `NanoCPUs` to `HostConfig`.\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n![cute-animals-illu-002](https://cloud.githubusercontent.com/assets/6932348/19901304/e8ae9e50-a023-11e6-8ec8-530841b346e9.jpg)\r\n\r\nThis fix fixes #27921.\r\n\r\nSigned-off-by: Yong Tang <yong.tang.github@outlook.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/258561277","html_url":"https://github.com/docker/docker/pull/27958#issuecomment-258561277","issue_url":"https://api.github.com/repos/docker/docker/issues/27958","id":258561277,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T22:16:40Z","updated_at":"2016-11-04T22:16:40Z","body":"@tiborvass both could work, although we have `--limit-memory` as well. They _are_ quite descriptive, but I agree it's shorter :smile:"}}
{"actor":{"display_login":"thaJeztah"}}