question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] get_cpus is not supporting cgroup2

See original GitHub issue

The current detection of https://github.com/conan-io/conan/blob/1.46.2/conans/client/tools/oss.py#L36-L39 seems no longer applicable in case of cgroup2 as the /sys/fs/cgroup/cpu/cpu.cfs_quota_us and /sys/fs/cgroup/cpu/cpu.cfs_period_us are replaced by /sys/fs/cgroup/cpu.max (in case of docker executed with --cpus).

There could be checked if cgroup2 is active for example by checking for existence of /sys/fs/cgroup/cgroup.controllers file and based on that the values for quota and period could be taken from cpu.max file.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
maikelvdhcommented, Jul 18, 2022

@MariaMozgunova the $MAX in cpu.max is basically the same as quota before, so you can use that to calculate in this case the same.

1reaction
memshardedcommented, Jul 17, 2022

Hi @MariaMozgunova

Yes, there are many tests that require to have some tools installed, like different build systems. You can check the conftest.py file, it contains a json declarative syntax to enable/disable/configure required tools. You can write your own confuser_test.py overriding and disabling some tools.

If you are going to touch such a very specific tool, I’d recommend looking in the unittest and integration test folders, the one that are covering the existing functionality and just run them (the folder or the file with pytest <path/to/folder>. It is going to be much faster and convenient. Don’t worry, our CI run all tests for PRs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1796543 – virsh cpu-stats does not work with cgroup v2.
does not work with cgroup v2. The command fails with the error 'operation 'getCpuacctPercpuUsage' not supported'. On further analysis I see ...
Read more >
ubuntu 22.04 net_cls cgroup mounted over cgroup2 prevents ...
It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in...
Read more >
Control Group v2 - The Linux Kernel documentation
cgroup v2 supports thread granularity for a subset of controllers to support use cases requiring hierarchical resource distribution across the threads of a ......
Read more >
#934372 - snapd WARNING: cgroup v2 is not fully supported ...
Report forwarded to debian-bugs-dist@lists.debian.org, ryutaroh.matsumoto@nagoya-u.jp, Michael Hudson-Doyle <mwhudson@debian.org> : Bug#934372 ; ...
Read more >
[Optional] cgroup v2 - Rootless Containers
Enabling cgroup v2 for containers requires kernel 4.15 or later. Kernel 5.2 or later is recommended. And yet, delegating cgroup v2 controllers to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found