Machine tags (MAAS-style), changelog-driven release notes
- tags table + machines.tags/auto_tags; match rules as Go templates over .Node
(GPUs, IB, CPUs, memory, disks, NVMe, PCI vendors, manufacturer/product, OS)
re-evaluated at commissioning and on tag changes
- deployment: tag cloud-config fragments appended as MIME parts with additive merge;
deploy/tags/gpu-nvidia.yaml installs the NVIDIA driver per distro family
- stateless: tag overlays appended to the profile's overlays
- CLI: tag, tags, list -tag, deploy/power tag:NAME fan-out; UI: tags column, per-machine
editor, tag definitions panel; API: /api/v1/tags, /machines/{id}/tags, ?tag=
- CHANGELOG.md; release workflow publishes the tag's section as release notes and
refuses tags without one
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
cdd0ad3215
commit
0f798d8797
15 files changed
+844
-36
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# Tag fragments
|
||||
|
||||
Each file here is a cloud-init fragment that a tag can carry. When a machine
|
||||
with that tag is deployed, the fragment is added to the generated user-data as
|
||||
a separate MIME part (cloud-config parts merge with `list(append)`, so
|
||||
`packages`, `runcmd` and `write_files` accumulate; a part starting with `#!`
|
||||
runs as a script).
|
||||
|
||||
| File | Tag | Use |
|
||||
|---|---|---|
|
||||
| `gpu-nvidia.yaml` | `gpu` (auto: `{{ gt .Node.GPUs 0 }}`) | NVIDIA driver from the distro's preferred source, reboot when done |
|
||||
|
||||
Register: `rollcall tags add gpu -match '{{ gt .Node.GPUs 0 }}' -cloud-config deploy/tags/gpu-nvidia.yaml -comment "NVIDIA GPUs"`.
|
||||
|
||||
Match templates see `.Node`: `GPUs`, `IBGUIDs`, `CPUs`, `Sockets`, `MemMB`,
|
||||
`Disks`, `NVMe`, `PCIVendors` (e.g. `10de` NVIDIA, `15b3` Mellanox), `Manufacturer`,
|
||||
`Product`, `MACs`, `Tags`, `OS`. Helpers: `has`, `contains`, `hasPrefix`, `matches`,
|
||||
`gte`, plus Go's `eq/gt/lt/and/or/not`. Examples:
|
||||
|
||||
```
|
||||
{{ gt .Node.GPUs 0 }}
|
||||
{{ has .Node.PCIVendors "15b3" }}
|
||||
{{ and (gte .Node.MemMB 500000) (gt .Node.Sockets 1) }}
|
||||
{{ matches "(?i)PowerEdge R7" .Node.Product }}
|
||||
```
|
||||
@@ -0,0 +1,48 @@
|
||||
#cloud-config
|
||||
# Rollcall tag fragment: NVIDIA driver + container toolkit on GPU nodes.
|
||||
# Register with: rollcall tags add gpu -match '{{ gt .Node.GPUs 0 }}' -cloud-config deploy/tags/gpu-nvidia.yaml
|
||||
# Merged into the deployment user-data of every machine tagged "gpu"; distro is detected at runtime.
|
||||
packages:
|
||||
- pciutils
|
||||
- curl
|
||||
- gnupg
|
||||
write_files:
|
||||
- path: /usr/local/sbin/rollcall-nvidia-install.sh
|
||||
permissions: "0755"
|
||||
content: |
|
||||
#!/bin/sh
|
||||
# Installs the NVIDIA driver from the distribution's preferred source. Logs to /var/log/rollcall-nvidia.log
|
||||
set -eu
|
||||
exec >>/var/log/rollcall-nvidia.log 2>&1
|
||||
. /etc/os-release
|
||||
echo "== $(date -Is) nvidia install on $PRETTY_NAME"
|
||||
lspci -nn | grep -i 10de || { echo "no NVIDIA device"; exit 0; }
|
||||
case "$ID" in
|
||||
debian)
|
||||
# contrib + non-free for nvidia-driver (kernel headers for DKMS)
|
||||
sed -i 's/^\(deb .* main\)$/\1 contrib non-free non-free-firmware/' /etc/apt/sources.list 2>/dev/null || true
|
||||
if [ -f /etc/apt/sources.list.d/debian.sources ]; then sed -i 's/^Components: main$/Components: main contrib non-free non-free-firmware/' /etc/apt/sources.list.d/debian.sources; fi
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y "linux-headers-$(uname -r)" nvidia-driver nvidia-smi firmware-misc-nonfree
|
||||
;;
|
||||
ubuntu)
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-drivers-common
|
||||
ubuntu-drivers install --gpgpu || ubuntu-drivers autoinstall
|
||||
;;
|
||||
rocky|almalinux|centos|rhel)
|
||||
rel=$(echo "$VERSION_ID" | cut -d. -f1)
|
||||
dnf -y install epel-release || dnf -y install "https://dl.fedoraproject.org/pub/epel/epel-release-latest-$rel.noarch.rpm"
|
||||
dnf config-manager --add-repo "https://developer.download.nvidia.com/compute/cuda/repos/rhel$rel/x86_64/cuda-rhel$rel.repo"
|
||||
dnf -y install kernel-devel-"$(uname -r)" kernel-headers-"$(uname -r)" dkms
|
||||
dnf -y module install nvidia-driver:latest-dkms || dnf -y install nvidia-driver nvidia-driver-cuda
|
||||
;;
|
||||
*) echo "unsupported distro $ID"; exit 1 ;;
|
||||
esac
|
||||
echo "== done; nvidia-smi after reboot"
|
||||
runcmd:
|
||||
- [ /usr/local/sbin/rollcall-nvidia-install.sh ]
|
||||
power_state:
|
||||
mode: reboot
|
||||
condition: test -e /var/log/rollcall-nvidia.log && grep -q "== done" /var/log/rollcall-nvidia.log
|
||||
message: "rollcall: rebooting to load the NVIDIA driver"
|
||||
Reference in new issue
Block a user