Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_container - missing --cpus=<value> #34320

Closed
benbro opened this issue Dec 31, 2017 · 19 comments · Fixed by #64683
Closed

docker_container - missing --cpus=<value> #34320

benbro opened this issue Dec 31, 2017 · 19 comments · Fixed by #64683
Labels
affects_2.4 This issue/PR affects Ansible v2.4 cloud docker feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.

Comments

@benbro
Copy link

benbro commented Dec 31, 2017

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

docker_container

ANSIBLE VERSION
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/me/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 20160609]
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

Ansible is missing support for the docker run --cpus=. This flag is available since Docker 1.3.

@benbro benbro changed the title docker_container - missing cpus docker_container - missing --cpus=<value> Dec 31, 2017
@ansibot
Copy link
Contributor

ansibot commented Dec 31, 2017

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Dec 31, 2017

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 cloud docker feature_idea module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Dec 31, 2017
@maxamillion
Copy link
Contributor

!needs_triage

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jan 2, 2018
@ko-christ
Copy link

ko-christ commented Feb 21, 2018

This option doesn't seem to be supported is nano_cpus in the docker.py API.
https://docker-py.readthedocs.io/en/stable/containers.html
docker/docker-py#1920

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@Akasurde
Copy link
Member

resolved_by_pr #38063

@Akasurde
Copy link
Member

@benbro Could you please check if this PR works for you ? Let us know.

@Akasurde Akasurde added the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 29, 2018
@benbro
Copy link
Author

benbro commented Mar 29, 2018

@Akasurde this issue is about --cpus=value config but the PR use nano_cpus which I don't understand.

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 29, 2018
@Akasurde
Copy link
Member

@benbro CPU quota is called as nano_cpus in API library - please refer this docker/docker-py#1920 (comment)

@benbro
Copy link
Author

benbro commented Mar 31, 2018

@Akasurde There are different ways to limit CPU in docker with the command line. This blog says:

Specifying cpu usage in nanoseconds for a user is sometimes hard to determine when you want to do simple tasks such as limiting a container to one core.

nano_cpus is very confusing:

NanoCPUs - CPU quota in units of 10-9 CPUs.

Any reason not to give the user just: --cpus=value?

@Akasurde
Copy link
Member

Agree. nano_cpus is very confusing. Maybe you can add comment in PR itself, stating that nano_cpus should be renamed to something less confusing. Also, to add more documentation around that parameter.

@benbro
Copy link
Author

benbro commented Mar 31, 2018

Already done.

@alandotcom
Copy link

What's the status on this? I'd be happy to help with any work to get things moving along

@felixfontein
Copy link
Contributor

There's a PR for this (#38063), which seems to be stuck. Also, there's disagreement how the interface for this should look like.

@ansibot
Copy link
Contributor

ansibot commented Nov 2, 2018

@ansibot
Copy link
Contributor

ansibot commented Dec 12, 2018

@ansibot
Copy link
Contributor

ansibot commented Feb 9, 2019

@ansibot ansibot added the has_pr This issue has an associated PR. label Jul 27, 2019
@hdiass
Copy link

hdiass commented Nov 11, 2019

Is there any update on this option to be available on docker_container module ?
thanks,

@felixfontein
Copy link
Contributor

@hdiass so far, nothing happened. I'll work on a PR today; I would be glad if you could test it once it is ready.

@felixfontein
Copy link
Contributor

resolved_by_pr #64683

@ansible ansible locked and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 cloud docker feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
8 participants