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

Fix emulated cgroups v1 subsystem when running docker-in-docker #2532

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

jprendes
Copy link
Contributor

Fixes #2528.

Normally the pid-1 cgroup path is empty, but this is not the case when running inside a container.
This needs to be accounted on for the cgroups subsystem emulation.
This PR fixes the source of the mountpoints for the emulated cgroups subsystem by stripping the cgroup paths of pid-1 from the mountpoint source path.

I also makes the failure to setup tracing to syslog a warning instead of fatal, as that fails with the docker image used for docker-in-docker.

I would like to add testing for this based on the reproduction steps in #2528, but that would be better done by building youki as a static binary using musl (since the docker image is based on alpine). I would like to wait until we merge #2498 to add musl support and add a test.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Merging #2532 (f493994) into main (7b4160a) will increase coverage by 0.01%.
Report is 6 commits behind head on main.
The diff coverage is 75.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2532      +/-   ##
==========================================
+ Coverage   65.87%   65.89%   +0.01%     
==========================================
  Files         133      133              
  Lines       16868    16892      +24     
==========================================
+ Hits        11112    11131      +19     
- Misses       5756     5761       +5     

@jprendes jprendes changed the title Fix emulated cgroups v1 subsystem when running _docker-in-docker_ Fix emulated cgroups v1 subsystem when running docker-in-docker Nov 15, 2023
Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. Let's continue to add a test on this PR if you want.

@jprendes
Copy link
Contributor Author

Let's continue to add a test on this PR if you want.

Yes, that's a good plan :-)

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Dec 18, 2023

Hey, should we go ahead and merge this fix as it is? We can add the tests in a separate PR if you want 👍

@utam0k
Copy link
Member

utam0k commented Dec 19, 2023

Hey, should we go ahead and merge this fix as it is? We can add the tests in a separate PR if you want 👍

I'd like to include this PR in the next patch release, so please send out another PR 🙏

@utam0k utam0k merged commit 4c6fa31 into youki-dev:main Dec 19, 2023
15 checks passed
@jprendes
Copy link
Contributor Author

please send out another PR

Will do. The tests will need the musl builds PR to be merged. I'll work on that first.
Sorry for the delay, I have limited bandwidth as I'm currently on parental leave.

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

Successfully merging this pull request may close these issues.

youki fails to run in docker-in-docker with cgroups v1
4 participants