image: put gcc in the Dockerfile that is actually built (v0.2.63)

v0.2.62 added gcc to Dockerfile.oci. This install builds with --venv, and
build_oci_image.sh uses Dockerfile.oci-venv for that — so the image came out
without a compiler and surya would have gone on falling back exactly as before.
Caught by checking inside the built image rather than trusting the build's exit
code.

The test had the same blind spot: it asserted against one Dockerfile. Both can
ship, so it now checks both, parametrised by file.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182DhR1eFNPQyGmDrpHbedY
parent 8393a10e
......@@ -16,7 +16,7 @@
# Canonical product version for CoderAI — single source of truth. Both the API
# metadata and the admin web UI read from here.
__version__ = "0.2.62"
__version__ = "0.2.63"
__tagline__ = "Complete orchestration, distribution and escalation of remotizable advanced inference."
# Configure the CUDA caching allocator BEFORE torch is imported anywhere.
......
......@@ -109,10 +109,19 @@ ENV DEBIAN_FRONTEND=noninteractive \
CODERAI_COLIBRI_DIR=/cache/colibri \
CODERAI_K3_DIR=/cache/kimi-k3-in-c
# gcc + libc6-dev are a RUNTIME dependency, not a build one: Triton (under vLLM)
# JIT-compiles its CUDA driver module on the first engine start. Without a C
# compiler it dies with
# RuntimeError: Failed to find C compiler. Please specify via CC environment
# variable or set triton.knobs.build.impl.
# which surfaces only as "vLLM exited (code 1) before becoming ready" — so every
# vLLM engine, surya OCR included, silently fell back to another engine.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
ffmpeg \
gcc \
libc6-dev \
git \
libgomp1 \
libgl1 \
......
......@@ -18,8 +18,14 @@ This keeps the two from drifting again.
import pathlib
import re
import pytest
ROOT = pathlib.Path(__file__).resolve().parents[1]
DOCKERFILE = ROOT / "packaging" / "linux" / "Dockerfile.oci"
# BOTH can ship: build_oci_image.sh picks Dockerfile.oci-venv for a --venv build
# and Dockerfile.oci otherwise. Checking only one is how gcc was added to the
# file that was not being used, and the build came out without a compiler.
DOCKERFILES = [ROOT / "packaging" / "linux" / "Dockerfile.oci",
ROOT / "packaging" / "linux" / "Dockerfile.oci-venv"]
RUNPOD_VLLM_APT = ROOT / "packaging" / "runpod" / "profiles" / "vllm.apt"
......@@ -29,22 +35,25 @@ def _runtime_stage(text: str) -> str:
return text[starts[-1]:] if starts else text
def test_the_shipped_stage_installs_a_c_compiler():
stage = _runtime_stage(DOCKERFILE.read_text(encoding="utf-8"))
@pytest.mark.parametrize("dockerfile", DOCKERFILES, ids=lambda p: p.name)
def test_the_shipped_stage_installs_a_c_compiler(dockerfile):
stage = _runtime_stage(dockerfile.read_text(encoding="utf-8"))
assert re.search(r"^\s+gcc\s*\\?\s*$", stage, re.M), \
"no gcc in the runtime stage — Triton cannot build its driver module"
f"no gcc in {dockerfile.name}'s runtime stage — Triton cannot build its driver"
def test_it_also_has_the_headers_the_compile_needs():
stage = _runtime_stage(DOCKERFILE.read_text(encoding="utf-8"))
@pytest.mark.parametrize("dockerfile", DOCKERFILES, ids=lambda p: p.name)
def test_it_also_has_the_headers_the_compile_needs(dockerfile):
stage = _runtime_stage(dockerfile.read_text(encoding="utf-8"))
assert re.search(r"^\s+libc6-dev\s*\\?\s*$", stage, re.M), \
"gcc without libc6-dev cannot compile driver.c"
f"gcc without libc6-dev cannot compile driver.c ({dockerfile.name})"
def test_the_reason_is_recorded_next_to_it():
@pytest.mark.parametrize("dockerfile", DOCKERFILES, ids=lambda p: p.name)
def test_the_reason_is_recorded_next_to_it(dockerfile):
"""A later cleanup would otherwise drop a compiler from a runtime image as
obviously unnecessary."""
text = DOCKERFILE.read_text(encoding="utf-8")
text = dockerfile.read_text(encoding="utf-8")
assert "Triton" in text and "runtime" in text.lower()
assert "Failed to find C compiler" in text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment