fix(docker): refresh CUDA/ROCm images, restore share assets, and update entrypoint

Draft
GR
2d ago
+308-284

Summary

Audited the Docker build, runtime images, entrypoint, CI workflow, and local tooling against main (a0a071cb) and fixed the build break, missing runtime assets, model-handling gaps, and legacy bloat.

Fixes

  • CUDA 12 build break: add missing #include <cstddef> to server/src/common/concurrency/paged_kv_pool.h (broke GCC 11.4 in Docker prebuilds → cuda12).
  • Missing server/share/ assets in both runtime images: builder prune previously deleted build/share/ (status.html, deepseek41/*), runtime never copied them, and .dockerignore's **/*.bin excluded server/share/deepseek41/router_bias_lucebox_40x384_f32.bin. Restores server/share/, adds !server/share/**/*.bin, symlinks build/share -> ../share, and asserts all files exist during image build.
  • server/scripts/entrypoint.sh + server/test/test_entrypoint.sh:
    • Support deepseek41 (prefer 4.1 DSpark draft, drop draft on paged serving, skip --ddtree).
    • Support inkling2 / inkling2_loop (mtp.safetensors DSpark draft, never pick .gguf, skip --ddtree).
    • Support qwen3.8 draft pattern ahead of generic *dflash*, prevent qwen4exp from picking unrelated DFlash drafts, skip auto-draft for bailingmoe3 / qwen3.
    • Guard --ddtree on PAGED=0 and model_capabilities.h DDTree-capable architectures (fixes concurrent Qwen 3.5/3.6/3.8 --paged-attention + DFlash2, which feature_gate.cpp previously rejected with --paged-attention does not support DDTree).
    • Add LUCE_KV_CACHE_DIR support and /opt/lucebox-hub/kv-cache VOLUME (mode 1777) so the on-disk KV session cache stays off the container overlay and works under non-root -u uid:gid.

Image & Build Refresh

  • Drop Python / uv / PyTorch cu128 (~3+ GB) from both runtime images (including NVIDIA cu128 PyTorch that was being installed into :rocm) — runtime images only exec native C++ luce_server.
  • Ship luce_server only: drop test_dflash and test_server_unit (each duplicated static libluce_common.a fat-binary kernels) and configure with -DLUCE_TESTS=OFF without copying server/test.
  • Align cuda12 with ci.yml and :rocm: bump UBUNTU_VERSION from 22.04 to 24.04 (GCC 13) and pass -DLUCE_FA_ALL_QUANTS=OFF (keeps all symmetric KV quants, ~3× faster CUDA builds).
  • ROCm linking: pass -fuse-ld=lld when ROCm's ld.lld is present in Dockerfile.rocm.
  • CI / tooling / docs: update .github/workflows/docker.yml path triggers (server/share/**, share/model_cards/**, server/hip_compat/**, server/scripts/entrypoint.sh; drop server/test/**, pyproject.toml, uv.lock), add rocm support to scripts/build_image.sh, and update README.md Docker docs.

Follow-up (intentionally left out of this PR)

  • Slimming Dockerfile.rocm runtime off rocm/dev-ubuntu-24.04 to ubuntu:24.04 + ROCm runtime packages (best tested directly on an AMD host in a dedicated PR).

Validation

  • bash server/test/test_entrypoint.sh server/scripts/entrypoint.sh → PASS
  • bash -n on entrypoint.sh, test_entrypoint.sh, build_image.sh → PASS
  • c++ -std=gnu++17 -fsyntax-only on paged_kv_pool.h → PASS
  • .githooks/pre-push + YAML validation on .github/workflows/docker.yml → PASS
  • Full cuda12 + rocm image builds will be verified by the Docker prebuilds PR workflow.