Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing the CodeQL GitHub Action within a Docker container results in the detection of only a single CPU, due to the /sys/fs/cgroup/cpuset.cpus file being empty. #2139

Closed
kouberl-bosch opened this issue Feb 14, 2024 · 3 comments · Fixed by #2151
Assignees

Comments

@kouberl-bosch
Copy link

Hi,

when using the github action in a container action with a docker image which has cgroup v2 it cannot be run multithreaded.

Example output:

While resolving threads, found a cgroup CPUs file with 32 CPUs in /sys/fs/cgroup/cpuset.cpus.effective.
While resolving threads, found a cgroup CPUs file with 1 CPUs in /sys/fs/cgroup/cpuset.cpus.

This happens because at my docker image (ubuntu:22.04) the /sys/fs/cgroup/cpuset.cpus is empty which is legit:
see https://www.kernel.org/doc/Documentation/admin-guide/cgroup-v2.rst

If "cpuset.cpus" is empty, the "cpuset.cpus.effective" file shows
all the CPUs from the parent cgroup that can be available to
be used by this cgroup.

Now this lead to a maximum number of 1 CPU.
Relates to #2083

@kouberl-bosch kouberl-bosch changed the title Running codeql-action in container action leads to found only 1 CPU due to empty /sys/fs/cgroup/cpuset.cpus file Executing the CodeQL GitHub Action within a Docker container results in the detection of only a single CPU, due to the /sys/fs/cgroup/cpuset.cpus file being empty. Feb 14, 2024
@angelapwen
Copy link
Contributor

Hello! Thank you for reporting. I can look into this for you as I authored #2083. I'd like to understand why /sys/fs/cgroup/cpuset.cpus is reporting 1 CPU here:

`While resolving threads, found a cgroup CPUs file with ${cpuCount} CPUs in ${cpusFile}.`,
. If I understand correctly, the file exists in your container but is empty. Is that right?

@angelapwen angelapwen self-assigned this Feb 15, 2024
@kouberl-bosch
Copy link
Author

kouberl-bosch commented Feb 15, 2024

Yes the file exists, but it is empty, I'm using ubuntu 22.04 docker image.
Edit:
Empty is not correct, it has no content. It has a newline character:

$ xxd /sys/fs/cgroup/cpuset.cpus
$ 00000000: 0a

@angelapwen
Copy link
Contributor

Ah, I understand why the count is reporting as 1 now. I've put up #2151 which should address this issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants