mirror of
https://github.com/siderolabs/extensions.git
synced 2025-08-06 06:17:11 +02:00
71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
name: nvidia-container-runtime
|
|
variant: scratch
|
|
shell: /bin/bash
|
|
install:
|
|
- build-base
|
|
- gcc-14
|
|
- bash
|
|
- go
|
|
- patch
|
|
dependencies:
|
|
- image: cgr.dev/chainguard/wolfi-base@{{ .WOLFI_BASE_REF }}
|
|
steps:
|
|
- sources:
|
|
- url: https://github.com/NVIDIA/nvidia-container-toolkit/archive/refs/tags/{{ .CONTAINER_TOOLKIT_VERSION }}.tar.gz
|
|
destination: container-toolkit.tar.gz
|
|
sha256: {{ .CONTAINER_TOOLKIT_SHA256 }}
|
|
sha512: {{ .CONTAINER_TOOLKIT_SHA512 }}
|
|
env:
|
|
CC: gcc-14
|
|
CXX: g++-14
|
|
GIT_COMMIT: {{ substr 0 7 .CONTAINER_TOOLKIT_REF }} # build is using short sha
|
|
prepare:
|
|
- |
|
|
mkdir -p container-toolkit
|
|
tar -xzf container-toolkit.tar.gz --strip-components=1 -C container-toolkit
|
|
|
|
cd container-toolkit
|
|
patch -p0 < /pkg/patches/ldcache_path.patch
|
|
build:
|
|
- |
|
|
cd container-toolkit
|
|
|
|
make cmds
|
|
install:
|
|
- |
|
|
mkdir -p /rootfs/usr/local/bin
|
|
|
|
cd container-toolkit
|
|
|
|
# let's copy all built binaries suffixing them with .real
|
|
# the wrapper binary will call the real binary with the same name
|
|
for file in $(find . -maxdepth 1 -type f -executable); do
|
|
clean_file=$(basename $file)
|
|
|
|
# oci-nvidia-hook is a shell script calling nvidia-container-runtime-hook
|
|
if [[ $clean_file == "oci-nvidia-hook" ]]; then
|
|
ln -sv nvidia-container-runtime-hook /rootfs/usr/local/bin/$clean_file
|
|
|
|
continue
|
|
fi
|
|
|
|
ln -sv nvidia-container-runtime-wrapper /rootfs/usr/local/bin/$(basename $clean_file)
|
|
cp $clean_file /rootfs/usr/local/bin/$(basename $clean_file).real
|
|
done
|
|
- |
|
|
mkdir -p /rootfs/etc/cri/conf.d
|
|
cp /pkg/10-nvidia-container-runtime.part /rootfs/etc/cri/conf.d/10-nvidia-container-runtime.part
|
|
|
|
mkdir -p /rootfs/usr/local/etc/nvidia-container-runtime
|
|
cp /pkg/nvidia-container-runtime.toml /rootfs/usr/local/etc/nvidia-container-runtime/config.toml
|
|
sbom:
|
|
outputPath: /rootfs/usr/local/share/spdx/nvidia-container-runtime.spdx.json
|
|
version: {{ .CONTAINER_TOOLKIT_VERSION }}
|
|
cpes:
|
|
- cpe:2.3:a:nvidia:nvidia_container_toolkit:{{ .CONTAINER_TOOLKIT_VERSION }}:*:*:*:*:*:*:*
|
|
licenses:
|
|
- Apache-2.0
|
|
finalize:
|
|
- from: /rootfs
|
|
to: /rootfs
|