VM-like masking of total memory and CPUs at `/proc`
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 3.9k
- Forks
- 230
- Avg merge
- 7h 48m
- Merged PRs (30d)
- 3
Description
I'm not sure if this is out-of-scope or not, but yet I'm opening this issue for discussing.
When we run:
$ docker run --rm --memory 500Mi ubuntu free -h
total used free shared buff/cache available
Mem: 7.7Gi 2.6Gi 186Mi 4.1Gi 4.9Gi 839Mi
Swap: 2.0Gi 1.0Gi 1.0Gi
It shows the total memory of the host machine despite of the --memory constraint. The same happens when using sysbox-runc. This is intended.
The thing is: as Sysbox claims to transform containers to VM-like ones, would it be possible to allow Sysbox to enforce the total memory which the container will recognize just like normal VMs?
By using --memory today, if my containers trespass the limit, they gets killed. Ideally, I would like the containers not to recognize the total memory, so they handle the available memory the way they want without being killed by the daemon. In a CI/CD build pool it's a very desired feature, as I can set a given number of resources for each build and I do not have control over what happens in such builds.
The same rationale and use case applies for CPUs as well.
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 by reviewing the /proc views of total memory and CPUs exposed under Docker --memory constraints, and compare them with the behavior of sysbox-runc. Define the intended masking semantics for memory and CPU resources, including CI/CD use cases, before locating the relevant Sysbox runtime entry points. Done means the container reports the configured resources without breaking enforcement or existing VM-like behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, linux
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100