saltstack / saltstack/salt

"docker_container.running" doesn't support setting number of CPU

Open
#56,582 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.