From e72b1076ca1da86b5ac79a9c3fee3443e38d27ad Mon Sep 17 00:00:00 2001 From: Alexey Rybak <50731695+reluctantfuturist@users.noreply.github.com> Date: Fri, 18 Apr 2025 00:49:10 -0700 Subject: [PATCH] =?UTF-8?q?fix(build):=20add=20UBI=C2=A09=20compiler=20too?= =?UTF-8?q?l=E2=80=91chain=20(#1983)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? Fixes the UBI 9 container build failure ( `error: command 'gcc' failed` when installing `polyleven`, `faiss`, etc.) by installing the missing compiler tool‑chain: - `python3.11-devel gcc` make added to the UBI 9 `dnf install` line. ### Closes #1970 ## Test Plan - Build a distro with an UBI image --- llama_stack/distribution/build_container.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llama_stack/distribution/build_container.sh b/llama_stack/distribution/build_container.sh index ed83b7bff..97259ed0a 100755 --- a/llama_stack/distribution/build_container.sh +++ b/llama_stack/distribution/build_container.sh @@ -72,9 +72,13 @@ if [[ $container_base == *"registry.access.redhat.com/ubi9"* ]]; then FROM $container_base WORKDIR /app +# We install the Python 3.11 dev headers and build tools so that any +# C‑extension wheels (e.g. polyleven, faiss‑cpu) can compile successfully. + RUN dnf -y update && dnf install -y iputils net-tools wget \ vim-minimal python3.11 python3.11-pip python3.11-wheel \ - python3.11-setuptools && ln -s /bin/pip3.11 /bin/pip && ln -s /bin/python3.11 /bin/python && dnf clean all + python3.11-setuptools python3.11-devel gcc make && \ + ln -s /bin/pip3.11 /bin/pip && ln -s /bin/python3.11 /bin/python && dnf clean all ENV UV_SYSTEM_PYTHON=1 RUN pip install uv