Files
spinifex/scripts/images/eks-node-gpu/manifest.conf
T
Josh Siviour 6879a3425a feat(gpu): Ubuntu NVIDIA GPU node images + GPU AMI selection (Epic A) (#502)
* feat(gpu): Ubuntu NVIDIA GPU node image + GPU AMI selection

Epic A of GPU passthrough to EKS pods / ECS task containers.

- Add gpu-vendor AMI tag constants + GPUVendorForType/IsGPUTypeName helpers
  (instance-family prefix -> vendor from knownGPUModels).
- EKS + ECS worker AMI resolution branches to a GPU-tagged node image for GPU
  instance types; no fallback to the driverless image (hard error instead).
- Exclude gpu-vendor-tagged AMIs from the plain (non-GPU) lookup so a newer GPU
  AMI cannot hijack ordinary nodes (managed-by tag is shared; filters have no
  negation, so exclude client-side).
- NodegroupRecord caches GPUEnabled/GPUVendor from InstanceTypes.
- Catalog entries spinifex-eks-node-gpu / spinifex-ecs-node-gpu (dual-tagged).
- New Ubuntu 26.04 GPU node images (eks-node-gpu, ecs-agent-gpu): reuse the
  proven DKMS -server driver recipe (drop Docker CE + dev payload), add
  nvidia-container-toolkit, OpenRC->systemd port of the worker/agent service
  subset, udev EBS by-id bridge, nvidia modules-load, first-boot CDI generation.
- build-system-image.sh: SYSTEM_TAG supports multiple space-separated tags.

* build: allow SYSTEM_IMAGE_BUILD_DIR override for image build dir

Ubuntu GPU images are 16G; a RAM-backed /tmp tmpfs is too small to hold the
qcow2 + expanded raw. Default stays /tmp; SYSTEM_IMAGE_BUILD_DIR redirects the
build onto a real disk.
2026-07-10 19:52:12 +10:00

43 lines
2.6 KiB
Plaintext

IMAGE_NAME="eks-node-gpu"
IMAGE_DESCRIPTION="Ubuntu EKS K3s GPU worker node — NVIDIA server driver (DKMS pre-built) + nvidia-container-toolkit; agent-only (GPU nodes never run the EKS control plane)"
DISTRO="ubuntu"
UBUNTU_VERSION="26.04"
UBUNTU_CODENAME="resolute"
# 16G — headroom for kernel headers, NVIDIA driver + DKMS build artefacts, and
# nvidia-container-toolkit, mirroring scripts/images/ubuntu-gpu-nvidia.conf.
IMAGE_SIZE="16G"
# K3s bundles its own containerd, so no containerd/runc package here. The
# NVIDIA server driver + nvidia-utils come from the stock Ubuntu repos and are
# installed in setup.sh (kernel-version-pinned DKMS build, like the ubuntu-gpu
# recipe). nvidia-container-toolkit lives in its own NVIDIA-hosted apt repo,
# which is not enabled on the base cloud image, so it is also added+installed
# in setup.sh rather than here (see scripts/images/ubuntu-gpu-nvidia-setup.sh).
APT_PACKAGES="ca-certificates curl jq iptables conntrack cgroup-tools initramfs-tools"
# Role-agnostic helper scripts are reused verbatim from scripts/images/eks-node/
# (only the init wiring changes: OpenRC -> systemd). k3s-agent-prestart is new —
# it reproduces the k3s-agent.initd start_pre logic (env require + IMDS
# provider-id) for the systemd unit. Server-only units (role selector, k3s
# server, eks-token-webhook, konnectivity, state-report, k3s recovery,
# mgmt-net) are intentionally not ported — GPU nodes are single-NIC workers.
INSTALL_FILES="\
scripts/images/eks-node/mulga-ebs-byid.sh:/usr/local/sbin/mulga-ebs-byid \
scripts/images/eks-node/mulga-eks-provider-id.sh:/usr/local/sbin/mulga-eks-provider-id \
scripts/images/eks-node/mulga-vpc-mtu.sh:/usr/local/sbin/mulga-vpc-mtu \
scripts/images/eks-node-gpu/k3s-agent-prestart.sh:/usr/local/sbin/k3s-agent-prestart \
scripts/images/eks-node-gpu/k3s-agent.service:/etc/systemd/system/k3s-agent.service \
scripts/images/eks-node-gpu/mulga-ebs-byid.service:/etc/systemd/system/mulga-ebs-byid.service \
scripts/images/eks-node-gpu/mulga-eks-provider-id.service:/etc/systemd/system/mulga-eks-provider-id.service \
scripts/images/eks-node-gpu/mulga-vpc-mtu.service:/etc/systemd/system/mulga-vpc-mtu.service \
scripts/images/eks-node-gpu/mulga-cdi-generate.service:/etc/systemd/system/mulga-cdi-generate.service \
scripts/images/eks-node-gpu/99-mulga-ebs-byid.rules:/etc/udev/rules.d/99-mulga-ebs-byid.rules"
ENABLE_SERVICES="k3s-agent mulga-ebs-byid mulga-eks-provider-id mulga-vpc-mtu mulga-cdi-generate"
SETUP_SCRIPT="scripts/images/eks-node-gpu/setup.sh"
AMI_NAME="spinifex-eks-node-gpu"
SYSTEM_TAG="spinifex:managed-by=eks gpu-vendor=nvidia"