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: let devenv-created OCI images be compatible with libnvidia-container #873

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

Atry
Copy link
Contributor

@Atry Atry commented Nov 15, 2023

Currently OCI images created by devenv contain a symlink /lib -> /nix/store/lf0wpjrj8yx4gsmw2s3xfl58ixmqk8qa-bash-5.2-p15/lib. The symlink conflicts with libnvidia-container because libnvidia-container tries to create a file /lib/firmware/nvidia/525.85.12/gsp_ad10x.bin while it specifies O_NOFOLLOW according to https://github.com/NVIDIA/libnvidia-container/blob/1eb5a30a6ad0415550a9df632ac8832bf7e2bbba/src/utils.c#L523

As a result, libnvidia-container will produce the following error when starting a container built from devenv

mount error: file creation failed: /run/containerd/io.containerd.runtime.v2.task/k8s.io/master-node/rootfs/lib/firmware/nvidia/525.85.12/gsp_ad10x.bin: file exists: unknown

This PR makes /lib a regular directory, and makes files under /lib symlinks, so that the OCI images created by devenv would be compatible with libnvidia-container.

@Atry Atry changed the title Let containers be compatible with libnvidia-container Let OCI images be compatible with libnvidia-container Nov 15, 2023
Currently containers created by `devenv` will contain a symlink `/lib -> /nix/store/lf0wpjrj8yx4gsmw2s3xfl58ixmqk8qa-bash-5.2-p15/lib`. The symlink conflicts with `libnvidia-container` because `libnvidia-container` tries to create a file `/lib/firmware/nvidia/525.85.12/gsp_ad10x.bin` while it specifies `O_NOFOLLOW` according to https://github.com/NVIDIA/libnvidia-container/blob/1eb5a30a6ad0415550a9df632ac8832bf7e2bbba/src/utils.c#L523

This PR makes `/lib` a regular directory, while making files under `/lib` symlinks so that it would be compatible with `libnvidia-container`.
@Atry Atry changed the title Let OCI images be compatible with libnvidia-container Let devenv created OCI images be compatible with libnvidia-container Nov 15, 2023
@Atry Atry changed the title Let devenv created OCI images be compatible with libnvidia-container fix: let devenv created OCI images be compatible with libnvidia-container Nov 15, 2023
@domenkozar domenkozar merged commit 525d60c into cachix:main Nov 16, 2023
121 of 190 checks passed
@Atry Atry deleted the patch-6 branch November 16, 2023 18:33
@Atry Atry changed the title fix: let devenv created OCI images be compatible with libnvidia-container fix: let devenv-created OCI images be compatible with libnvidia-container Mar 27, 2024
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 this pull request may close these issues.

2 participants