-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[cgroupv2] Enable fuse device #8769
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
Conversation
@csweichel Any idea why this fails in CI? I can build it with leeway in my workspace without issue. |
func (c *CgroupCustomizerV1) WithCgroupBasePath(basePath string) { | ||
c.cgroupBasePath = basePath | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this function now.
func (c *CgroupCustomizerV1) WithCgroupBasePath(basePath string) { | |
c.cgroupBasePath = basePath | |
} |
|
||
deviceRules := make([]*devices.Rule, 0) | ||
deviceRules = append(deviceRules, &denyAll, &allowFuse) | ||
for _, device := range specconv.AllowedDevices { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our current use case, we don't specify cgroup devices. In other words, this is all we need to specify for now. However, if we want to add some devices about the runc layer(e.g. kubelet, contained) in the future, this part will arise a problem. However, it may be an option to decide that the cgroup devices are managed here. In fact, we have been used to overwrite /dev/fuse
here.
@csweichel WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Furisto Since there is currently a way to get the contents of config.json
, why don't we get the original information from here? To be honest, I want to get status.json
, but config.json
should be sufficient.
gitpod/components/ws-daemon/pkg/container/containerd.go
Lines 460 to 470 in 60a9c55
func ExtractCGroupPathFromContainer(container containers.Container) (cgroupPath string, err error) { | |
var spec ocispecs.Spec | |
err = json.Unmarshal(container.Spec.Value, &spec) | |
if err != nil { | |
return | |
} | |
if spec.Linux == nil { | |
return "", xerrors.Errorf("container spec has no Linux section") | |
} | |
return spec.Linux.CgroupsPath, nil | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @utam0k , that sounds like an optimization we could potentially add later, yes? In other words, let's try to keep this PR smaller, ship the skateboard, and ship another one in the future (if we need).
Aside from this observation, do you have any other concerns which are blocking? I ask so that we can get @Furisto the feedback needed to have this approved and merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a little research and as it stands it shouldn't be a problem, because there is no API to change devices normally from k8s. However I think this should be improved. It can create some pretty strange bugs. The skateboard is a very good watchword 🛹
Thanks for your PR. Super. I have two questions.
|
|
@Furisto Thanks for your great reply.
In the worst case, I think the item of most concern is that none of the eBPF codes for the device controller is applied due to errors at load time. This can happen because the existing eBPF code is unloaded at load time. Was the eBPF code loaded in the pod cgroup?
|
@csweichel What do you think of this approach? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
/werft run 👍 started the job as gitpod-build-fo-fuse.9 |
/werft run 👍 started the job as gitpod-build-fo-fuse.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Codecov Report
@@ Coverage Diff @@
## main #8769 +/- ##
=========================================
- Coverage 12.31% 7.34% -4.98%
=========================================
Files 20 32 +12
Lines 1161 2234 +1073
=========================================
+ Hits 143 164 +21
- Misses 1014 2067 +1053
+ Partials 4 3 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Description
Enable fuse device on nodes that are using cgroup v2.
Related Issue(s)
Fixes #8417
How to test
Notes for reviewers
My initial implementation was using a runc facade like we discussed in #8471, but I switched to instead replacing the ebpf program that runc generates with our own.
Release Notes