"docker_container.running" doesn't support setting number of CPU
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description of Issue
The state module "docker_container.running" supports some cpu related things, but there is no way to set the no. of CPU seen inside the container.
On the commandline this would translate to docker run --cpus 3 somecontainer which is the recommended way to configure the number of CPUs for a docker container.
As I understand it "states.docker_container" uses "docker_py" which requires "NanoCpus" to be set to configure the number of CPU. As describe in issue 1920 for docker_py here:
https://github.com/docker/docker-py/issues/1920
Can you add this option so that the CPUs can be configured?
Setup
n/a
Steps to Reproduce Issue
n/a
Versions Report
n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the docker_container.running state documentation and the linked docker-py issue about NanoCpus. Trace how the state exposes existing CPU-related settings, then verify that the requested option configures the container's CPU count consistently with Docker's --cpus behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100