From 9f1148b11079f2246b78f99b67ac51e4f9da94da Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 30 Jun 2026 22:25:46 -0400 Subject: [PATCH] =?UTF-8?q?chore(agent):=20modernise=20base=20=E2=86=92=20?= =?UTF-8?q?Ubuntu=2024.04=20/=20Python=203.12=20/=20CUDA=2012.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump the GPU-agent base image from 12.4.1-cudnn-runtime-ubuntu22.04 (Python 3.10, CUDA 12.4, early-2024) to 12.9.2-cudnn-runtime-ubuntu24.04: - Ubuntu 24.04 LTS → Python 3.12 — one modern runtime, no more 3.10. - CUDA 12.9 + cuDNN 9 — current within the CUDA-12 / cuDNN-9 line that the default onnxruntime-gpu wheel AND torch cu124 are built against. NOT CUDA 13: ONNX Runtime's CUDA-13 support is still nascent (separate wheels + open "Unsupported CUDA version: 13" reports), and torch bundles cu124 anyway. The GPU (Ampere/Ada, 12 GB) is fine on either — this is a library-alignment call, not a hardware limit. - PIP_BREAK_SYSTEM_PACKAGES=1: 24.04 marks system Python externally-managed (PEP 668); a single-purpose container owns its environment, so global installs are fine and simplest. - agent/ruff.toml pinned to py312 (was py310) so CI lints against the real runtime; from __future__ import annotations stays (PEP 649 lazy annotations are 3.14, so self-refs still evaluate on 3.12). CI builds the image but has no GPU — validate on the desktop after pull that it starts and loads CUDAExecutionProvider (not CPU fallback). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa --- agent/Dockerfile | 22 ++++++++++++++-------- agent/fc_agent/app.py | 2 +- agent/ruff.toml | 12 ++++++------ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/agent/Dockerfile b/agent/Dockerfile index fe76d41..2f79e0c 100644 --- a/agent/Dockerfile +++ b/agent/Dockerfile @@ -1,18 +1,24 @@ # FabledCurator GPU agent — runs on the desktop with the GPU. -# CUDA + cuDNN runtime so onnxruntime-gpu can use the card (it needs cuDNN 9 — -# the plain -runtime image lacks it: "libcudnn.so.9: cannot open shared object -# file"); ffmpeg for video frames. -FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 +# CUDA 12.9 + cuDNN 9 runtime so onnxruntime-gpu can use the card (it needs +# cuDNN 9 — the plain -runtime image lacks it: "libcudnn.so.9: cannot open +# shared object file"); ffmpeg for video frames. Ubuntu 24.04 → Python 3.12. +# Stays on the CUDA-12 / cuDNN-9 line the default onnxruntime-gpu + torch are +# built against (CUDA 13 has only nascent ONNX Runtime support). +FROM nvidia/cuda:12.9.2-cudnn-runtime-ubuntu24.04 -ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 +# PIP_BREAK_SYSTEM_PACKAGES: Ubuntu 24.04 marks its system Python as externally +# managed (PEP 668), so a global `pip install` errors without this. It's a +# single-purpose container — we own the whole environment, so installing into +# the system site-packages is fine (and simplest — no venv on PATH to manage). +ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 PIP_BREAK_SYSTEM_PACKAGES=1 RUN apt-get update \ && apt-get install -y --no-install-recommends python3 python3-pip ffmpeg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app -# torch from the CUDA-12.4 wheel index (matches the base image); its wheels -# bundle their own CUDA + cuDNN and coexist with onnxruntime-gpu. Installed -# first + separately so the GPU build of torch is deterministic and layer-cached. +# torch from the CUDA-12.4 wheel index; its wheels bundle their own CUDA + cuDNN +# so they run on the 12.9 base and coexist with onnxruntime-gpu. Installed first +# + separately so the GPU build of torch is deterministic and layer-cached. RUN pip3 install --no-cache-dir torch==2.6.0 --index-url https://download.pytorch.org/whl/cu124 COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt diff --git a/agent/fc_agent/app.py b/agent/fc_agent/app.py index 3a225e1..1f001ca 100644 --- a/agent/fc_agent/app.py +++ b/agent/fc_agent/app.py @@ -15,7 +15,7 @@ from .worker import Worker # Bump on every agent change. The page embeds this and /status reports it; the UI # warns to reload when they differ — so a stale browser-cached page can't be # mistaken for "the new image didn't deploy". (Belt-and-braces with no-store.) -VERSION = "2026-06-30.6 · submit-retry+py310" +VERSION = "2026-06-30.7 · ubuntu24.04-py312-cuda12.9" logbuf.install() cfg = Config.from_env() diff --git a/agent/ruff.toml b/agent/ruff.toml index c796be5..5f7bf7a 100644 --- a/agent/ruff.toml +++ b/agent/ruff.toml @@ -1,7 +1,7 @@ -# The agent runs on the CUDA base image's Python 3.10 — NOT the 3.14 that CI's -# ci-python image and the repo-root ruff.toml target. Pin the agent to py310 so -# ruff enforces 3.10 compatibility and never auto-applies a 3.11+/3.14-only fix -# (e.g. unquoting a self-referential annotation, which PEP 649 makes safe on 3.14 -# but NameErrors on 3.10). Inherit the root lint rules. +# The agent runs on the CUDA base image's Python 3.12 (Ubuntu 24.04) — NOT the +# 3.14 that CI's ci-python image and the repo-root ruff.toml target. Pin the +# agent to py312 so ruff enforces 3.12 compatibility and never auto-applies a +# 3.14-only fix (e.g. unquoting a self-referential annotation, which PEP 649 +# makes safe on 3.14 but NameErrors on 3.12). Inherit the root lint rules. extend = "../ruff.toml" -target-version = "py310" +target-version = "py312"