-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathpkg.yaml
More file actions
88 lines (82 loc) · 4.93 KB
/
pkg.yaml
File metadata and controls
88 lines (82 loc) · 4.93 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: nvidia-fabricmanager-lts
variant: scratch
shell: /bin/bash
dependencies:
- stage: base
- stage: nvidia-fabricmanager-gcc-runtime
- stage: nvidia-fabricmanager-wrapper
steps:
- sources:
# {{ if eq .ARCH "aarch64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/nvidia-driver/redist/fabricmanager/linux-sbsa/fabricmanager-linux-sbsa-{{ .NVIDIA_DRIVER_LTS_VERSION }}-archive.tar.xz
destination: fabricmanager.tar.xz
sha256: {{ .NVIDIA_FABRIC_MANAGER_LTS_ARM64_SHA256 }}
sha512: {{ .NVIDIA_FABRIC_MANAGER_LTS_ARM64_SHA512 }}
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvlsm/linux-sbsa/nvlsm-linux-sbsa-{{ .NVIDIA_NVLSM_LTS_VERSION }}-archive.tar.xz
destination: nvlsm.tar.xz
sha256: {{ .NVIDIA_NVLSM_LTS_ARM64_SHA256 }}
sha512: {{ .NVIDIA_NVLSM_LTS_ARM64_SHA512 }}
# {{ else }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/nvidia-driver/redist/fabricmanager/linux-x86_64/fabricmanager-linux-x86_64-{{ .NVIDIA_DRIVER_LTS_VERSION }}-archive.tar.xz
destination: fabricmanager.tar.xz
sha256: {{ .NVIDIA_FABRIC_MANAGER_LTS_AMD64_SHA256 }}
sha512: {{ .NVIDIA_FABRIC_MANAGER_LTS_AMD64_SHA512 }}
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvlsm/linux-x86_64/nvlsm-linux-x86_64-{{ .NVIDIA_NVLSM_LTS_VERSION }}-archive.tar.xz
destination: nvlsm.tar.xz
sha256: {{ .NVIDIA_NVLSM_LTS_AMD64_SHA256 }}
sha512: {{ .NVIDIA_NVLSM_LTS_AMD64_SHA512 }}
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
prepare:
- |
mkdir fm sm
tar -xf fabricmanager.tar.xz --strip-components=1 -C fm
tar -xf nvlsm.tar.xz --strip-components=1 -C sm
install:
- |
mkdir -p /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/bin \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/lib \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/opt/nvidia/nvlsm/sbin \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/opt/nvidia/nvlsm/lib \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvlsm
# nvlsm
- |
cp sm/sbin/nvlsm /rootfs/usr/local/lib/containers/nvidia-fabricmanager/opt/nvidia/nvlsm/sbin/
cp sm/lib/libgrpc_mgr.so /rootfs/usr/local/lib/containers/nvidia-fabricmanager/opt/nvidia/nvlsm/lib/
cp sm/share/nvidia/nvlsm/device_configuration.conf \
sm/share/nvidia/nvlsm/grpc_mgr.conf \
sm/share/nvidia/nvlsm/nvlsm.conf \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvlsm/
# fabricmanager
- |
cp fm/bin/nv-fabricmanager \
fm/bin/nvswitch-audit \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/bin/
cp fm/lib/libnvfm.so.1 /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/lib/
ln -s libnvfm.so.1 /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/lib/libnvfm.so
cp fm/share/nvidia/nvswitch/* \
fm/etc/fabricmanager.cfg \
/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/
sed -i 's/DAEMONIZE=.*/DAEMONIZE=0/g' /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/fabricmanager.cfg
sed -i 's/LOG_FILE_NAME=.*/LOG_FILE_NAME=/g' /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/fabricmanager.cfg
sed -i 's#STATE_FILE_NAME=.*#STATE_FILE_NAME=/var/run/fabricmanager.state#g' /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/fabricmanager.cfg
if grep -q '^DATABASE_PATH=' /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/fabricmanager.cfg
then
sed -i 's#DATABASE_PATH=.*#DATABASE_PATH=/var/run#g' /rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/fabricmanager.cfg
else
echo -e '\nDATABASE_PATH=/var/run\n' >>/rootfs/usr/local/lib/containers/nvidia-fabricmanager/usr/share/nvidia/nvswitch/fabricmanager.cfg
fi
- |
mkdir -p /rootfs/usr/local/etc/containers
cp /pkg/nvidia-fabricmanager.yaml /rootfs/usr/local/etc/containers/nvidia-fabricmanager.yaml
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /