-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathpkg.yaml
60 lines (52 loc) · 1.97 KB
/
pkg.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: nvidia-container-runtime
variant: scratch
shell: /bin/bash
install:
- build-base
- 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:
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
finalize:
- from: /rootfs
to: /rootfs