Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/provisioner/templates/crio.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@ POLICY
unqualified-search-registries = ["docker.io"]
REGISTRIES
fi
# Expose the opensuse CRI-O package's bundled runtimes on PATH.
# Without this, 'nvidia-ctk runtime configure --runtime=crio' (run
# later by the container-toolkit step) logs
# "Could not infer options from runtimes [runc crun]"
# and writes /etc/crio/crio.conf.d/99-nvidia.toml that omits the
# runc/crun runtime tables, leaving crio with no usable runtime on
# restart. See: nvidia-container-toolkit 1.19.1+ behavior change.
for bin in runc crun conmon pinns; do
src="/usr/libexec/crio/${bin}"
dst="/usr/bin/${bin}"
if [[ -x "${src}" && ! -e "${dst}" ]]; then
sudo ln -s "${src}" "${dst}"
fi
done
;;
rhel)
holodeck_retry 3 "$COMPONENT" pkg_install cri-o crun containers-common
Expand Down
11 changes: 11 additions & 0 deletions pkg/provisioner/templates/crio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ func TestCriO_Execute_PackageTemplate_OSFamilyBranching(t *testing.T) {
"Amazon Linux must create policy.json for CRI-O")
assert.Contains(t, out, "/etc/containers/registries.conf",
"Amazon Linux must create registries.conf")
// AL2023 must expose bundled runtimes on PATH so nvidia-ctk runtime
// configure can infer existing runc/crun entries and preserve them in
// /etc/crio/crio.conf.d/99-nvidia.toml. Without this, nvidia-ctk logs
// "Could not infer options from runtimes [runc crun]" and writes a
// drop-in that omits the runtimes, leaving crio with no usable runtime.
assert.Contains(t, out, "/usr/libexec/crio/",
"Amazon Linux must reference bundled runtimes under /usr/libexec/crio/")
assert.Regexp(t, `for bin in runc crun( |\b)`, out,
"Amazon Linux must iterate at least runc and crun when exposing bundled runtimes")
assert.Contains(t, out, "ln -s",
"Amazon Linux must symlink bundled runtimes onto PATH")

// RHEL uses crun + containers-common
assert.Contains(t, out, "pkg_install cri-o crun containers-common",
Expand Down