feat: optional /dev/fuse injection via CW_INJECT_FUSE_DEVICE#13
Open
wimarkuske wants to merge 1 commit into
Open
feat: optional /dev/fuse injection via CW_INJECT_FUSE_DEVICE#13wimarkuske wants to merge 1 commit into
wimarkuske wants to merge 1 commit into
Conversation
Add an opt-in flag that injects /dev/fuse (with the device-cgroup rw rule) into device-plugin allocations, so rootless apptainer/squashfuse works in NON-privileged GPU pods (e.g. SUNK slurmd) without a privileged securityContext or a separate fuse device plugin. On cgroup-v2 + containerd 2.x, a plain hostPath mount of /dev/fuse is insufficient: open() is gated by the per-container device cgroup, which only the kubelet can populate at pod creation (via a device plugin, DRA, or privileged). This appends a /dev/fuse DeviceSpec to apiDeviceSpecs() when CW_INJECT_FUSE_DEVICE=true, so the kubelet adds the node + cgroup allow rule. - internal/plugin/server.go: env-gated DeviceSpec append (PassDeviceSpecs path) - chart: injectFuseDevice value renders CW_INJECT_FUSE_DEVICE on the container Default behavior unchanged (flag off). Covers the PassDeviceSpecs / volume-mounts device-list strategy; CDI strategies (updateResponseForCDI) are a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in flag —
CW_INJECT_FUSE_DEVICE=true/ chart valueinjectFuseDevice: true— that injects/dev/fuse(with the device-cgrouprwrule) into device-plugin allocations. This lets rootless apptainer / squashfuse run in non-privileged GPU pods (e.g. SUNK slurmd) without a privilegedsecurityContextor a separate fuse device plugin.Default behavior is unchanged (flag off).
Why
On cgroup v2 + containerd 2.x, mounting
/dev/fuseinto a container as ahostPathis not sufficient —open("/dev/fuse")is gated by the per-container device cgroup, which denies char10:229even for root. Only the kubelet can populate that allow-list at pod creation, via one of:privileged: true(all devices), a DRA driver, or a device plugin DeviceSpec.Since slurmd already requests this plugin's
sunk.coreweave.com/acceleratorresource (and the plugin already returns GPUDeviceSpecs underPASS_DEVICE_SPECS), the cheapest path is to append a/dev/fuseDeviceSpecto that same allocation. The kubelet then creates the node and adds the cgroup rule — non-privileged.Change
internal/plugin/server.go—apiDeviceSpecs()appends a/dev/fuseDeviceSpec(HostPath/ContainerPath/dev/fuse,rw) whenCW_INJECT_FUSE_DEVICE=true.deployments/helm/nvidia-device-plugin/values.yaml— newinjectFuseDevice: false.deployments/helm/nvidia-device-plugin/templates/daemonset-device-plugin.yml— renders the env on the plugin container when the value is set.Scope / follow-up
Covers the PassDeviceSpecs (volume-mounts) device-list strategy, which is what SUNK uses. CDI device-list strategies allocate via
updateResponseForCDI()and are not covered by this PR — adding a fuse CDI device throughcdiHandleris a clean follow-up.Validation (live, CoreWeave SUNK test cluster
cw1690/ wm-usw09b, k8s 1.35, containerd 2.1.4)A patched build of this image was deployed as the
sunk-nvidia-device-pluginwithCW_INJECT_FUSE_DEVICE=true. On a slurmd pod requesting onlysunk.coreweave.com/accelerator: 8(no extra resource, noprivileged):/dev/fusepresent ascrw-rw-rw-(character device)uid 65534)open()on/dev/fusesucceeds (wasEPERMbefore)apptainer exec docker://alpine …mounts via squashfuse + user namespaces successfullyHelm render verified: env absent by default, present only with
injectFuseDevice=true.Enablement (downstream)
Via SUNK chart values (subchart passthrough), once the SUNK
nvidia-device-plugindependency is bumped to a release containing this change:🤖 Generated with Claude Code