mirror of
https://github.com/siderolabs/extensions.git
synced 2025-08-06 06:17:11 +02:00
81 lines
2.5 KiB
YAML
81 lines
2.5 KiB
YAML
name: nvidia-container-cli-production
|
|
variant: scratch
|
|
shell: /bin/bash
|
|
install:
|
|
- build-base
|
|
- gcc-14
|
|
- bash
|
|
- go
|
|
- coreutils
|
|
- sed
|
|
- curl
|
|
- rpcsvc-proto
|
|
- patch
|
|
dependencies:
|
|
- image: cgr.dev/chainguard/wolfi-base@{{ .WOLFI_BASE_REF }}
|
|
# nvidia-pkgs depends on glibc,
|
|
# so any stage depending on nvidia-container-cli will have the updated ld.so.cache,
|
|
# from both nvidia-pkgs and nvidia-container-cli
|
|
- stage: nvidia-pkgs-production
|
|
- stage: libseccomp
|
|
from: /rootfs
|
|
- stage: libcap
|
|
from: /rootfs
|
|
- stage: elfutils
|
|
from: /rootfs
|
|
- stage: zlib
|
|
from: /rootfs
|
|
- stage: libtirpc
|
|
from: /rootfs
|
|
steps:
|
|
- sources:
|
|
- url: https://github.com/NVIDIA/libnvidia-container/archive/refs/tags/{{ .LIBNVIDIA_CONTAINER_VERSION }}.tar.gz
|
|
destination: libnvidia-container.tar.gz
|
|
sha256: {{ .LIBNVIDIA_CONTAINER_SHA256 }}
|
|
sha512: {{ .LIBNVIDIA_CONTAINER_SHA512 }}
|
|
env:
|
|
CC: gcc-14
|
|
CXX: g++-14
|
|
SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }}
|
|
REVISION: {{ .LIBNVIDIA_CONTAINER_REF }}
|
|
LIB_VERSION: {{ .LIBNVIDIA_CONTAINER_VERSION | replace "v" "" }}
|
|
WITH_NVCGO: yes
|
|
WITH_LIBELF: yes
|
|
WITH_TIRPC: no # setting no means we'll use the system libtirpc
|
|
WITH_SECCOMP: yes
|
|
PKG_CONFIG_PATH: /usr/local/glibc/lib/pkgconfig # to find runtime libraries compiled in extensions (libseccomp)
|
|
PATH: "/usr/bin:{{ .PATH }}" # bldr doesn't have /usr/bin in PATH
|
|
prepare:
|
|
- |
|
|
mkdir libnvidia-container
|
|
tar -xzf libnvidia-container.tar.gz --strip-components=1 -C libnvidia-container
|
|
# FIXME: make downloads nvidia-modprobe
|
|
- network: default
|
|
build:
|
|
- |
|
|
cd libnvidia-container
|
|
|
|
# LDLIBS=-L/usr/local/glibc/lib is set so that libnvidia-container-cli libs which are hardcoded as -llibname and not using pkg-config
|
|
CPPFLAGS="-I/usr/local/glibc/include/tirpc" LDLIBS="-L/usr/local/glibc/lib -ltirpc -lelf -lseccomp" LDFLAGS='-Wl,--rpath=\$$ORIGIN/../glibc/\$$LIB' make
|
|
- network: none
|
|
install:
|
|
- |
|
|
mkdir -p /rootfs
|
|
|
|
cd libnvidia-container
|
|
|
|
make install DESTDIR=/rootfs
|
|
|
|
# run ldconfig to update the cache
|
|
/rootfs/usr/local/glibc/sbin/ldconfig -r /rootfs
|
|
sbom:
|
|
outputPath: /rootfs/usr/local/share/spdx/nvidia-container-cli.spdx.json
|
|
version: {{ .LIBNVIDIA_CONTAINER_VERSION }}
|
|
licenses:
|
|
- Apache-2.0
|
|
- GPL-3.0
|
|
- LGPL-3.0
|
|
finalize:
|
|
- from: /rootfs
|
|
to: /rootfs
|