Closed hhorak closed 1 year ago
[test]
[test-all]
Thanks, I've re-implemented the nproc
call to something that should work on both, Python 2 and 3.
[test-all]
[test-all]
[test]
I don't understand why, but some commits from this PR are already merged in master. The remaining fix that fixes #319 is is now separately in #322, so let's close this PR that is not needed in its most part.
Resource limits detection was enhanced via: https://github.com/sclorg/container-common-scripts/pull/237 While this is not directly connected, mentioning to connect both issues that touch resource limits detection.
Per podman-run(1) man page, on some systems, changing the resource limits may not be allowed for non-root users. For more details, see https://github.com/containers/podman/blob/main/troubleshooting.md#26-running-containers-with-resource-limits-fails-with-a-permissions-error.
This caused the cgroup-limits script to fail with python traceback:
This change implements another way to see number of CPUs (without cgroups), using nproc tool.
This might work as the last resort when running a container as non-root, so we get the same output as when the same container is run as a root on the same machine.
Also tracked internally: https://issues.redhat.com/browse/RHELPLAN-141599