11ARG BASE_UBI_IMAGE_TAG=9.5-1741850109
22
3+ ###############################################################
4+ # base stage with dependencies coming from centos mirrors
5+ ###############################################################
6+
7+ FROM registry.access.redhat.com/ubi9/ubi-minimal:${BASE_UBI_IMAGE_TAG} AS centos-deps-builder
8+ RUN microdnf install -y dnf && \
9+ dnf install -y https://mirror.stream.centos.org/9-stream/BaseOS/`arch`/os/Packages/centos-gpg-keys-9.0-24.el9.noarch.rpm \
10+ https://mirror.stream.centos.org/9-stream/BaseOS/`arch`/os/Packages/centos-stream-repos-9.0-24.el9.noarch.rpm \
11+ https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
12+ dnf config-manager --set-enabled crb
13+
14+ RUN dnf install -y openjpeg2-devel lcms2-devel tcl-devel tk-devel fribidi-devel && \
15+ dnf remove -y centos-gpg-keys-9.0-24.el9.noarch centos-stream-repos-9.0-24.el9.noarch
16+
317###############################################################
418# base stage with basic dependencies
519###############################################################
620
7- FROM registry.access.redhat.com/ubi9/ubi-minimal:${BASE_UBI_IMAGE_TAG} AS base-builder
21+ FROM centos-deps-builder AS base-builder
822
923ARG PYTHON_VERSION=3.12
1024ARG OPENBLAS_VERSION=0.3.29
@@ -19,19 +33,13 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64:/usr/local/lib:/usr/lib64:
1933# Note: A symlink for libatomic.so is created for gcc-13 (linker fails to find libatomic otherwise - reqd. for sentencepiece)
2034# Note: A dummy file 'control' is created in /tmp/ to artificially create dependencies between stages when building stages in parallel
2135# when `--jobs=<N>` is passed with podman build command
22- RUN microdnf install -y dnf openssl-devel \
23- && dnf install -y https://mirror.stream.centos.org/9-stream/BaseOS/`arch`/os/Packages/centos-gpg-keys-9.0-24.el9.noarch.rpm \
24- https://mirror.stream.centos.org/9-stream/BaseOS/`arch`/os/Packages/centos-stream-repos-9.0-24.el9.noarch.rpm \
25- https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
26- && dnf config-manager --add-repo https://mirror.stream.centos.org/9-stream/BaseOS/`arch`/os \
27- && dnf config-manager --add-repo https://mirror.stream.centos.org/9-stream/AppStream/`arch`/os \
28- && dnf config-manager --set-enabled crb \
29- && dnf install -y \
30- git tar gcc-toolset-13 automake libtool numactl-devel lapack-devel \
36+
37+ RUN dnf install -y openssl-devel \
38+ git tar gcc-toolset-13 automake libtool \
3139 pkgconfig xsimd zeromq-devel kmod \
32- libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
33- freetype-devel lcms2-devel libwebp-devel tcl-devel tk -devel \
34- harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel libxcb-devel \
40+ libtiff-devel libjpeg-devel zlib-devel \
41+ freetype-devel libwebp-devel \
42+ harfbuzz-devel libraqm-devel libimagequant-devel libxcb-devel \
3543 python${PYTHON_VERSION}-devel python${PYTHON_VERSION}-pip \
3644 && dnf clean all \
3745 && ln -sf /usr/lib64/libatomic.so.1 /usr/lib64/libatomic.so \
@@ -165,6 +173,21 @@ RUN --mount=type=cache,target=/root/.cache/uv \
165173 grep "opencv" requirements/common.txt | uv pip install -r /dev/stdin --no-build-isolation && \
166174 uv pip list
167175
176+ ###############################################################
177+ # Stage to build numactl
178+ ###############################################################
179+
180+ FROM base-builder AS numa-builder
181+
182+ # Note: Building numactl with gcc-11. Compiling with gcc-13 in this builder stage will
183+ # trigger recompilation with gcc-11 (and require libtool) in the final stage where we do not have gcc-13
184+ ARG MAX_JOBS
185+ ARG NUMACTL_VERSION=2.0.19
186+ RUN git clone --recursive https://github.com/numactl/numactl.git -b v${NUMACTL_VERSION} \
187+ && cd numactl \
188+ && autoreconf -i && ./configure \
189+ && make -j ${MAX_JOBS:-$(nproc)}
190+
168191
169192###############################################################
170193# Stage to build vllm - this stage builds and installs
@@ -177,6 +200,7 @@ FROM base-builder AS vllmcache-builder
177200COPY --from=torch-builder /tmp/control /dev/null
178201COPY --from=arrow-builder /tmp/control /dev/null
179202COPY --from=cv-builder /tmp/control /dev/null
203+ COPY --from=numa-builder /tmp/control /dev/null
180204
181205ARG VLLM_TGIS_ADAPTER_VERSION=0.7.0
182206ARG VLLM_TARGET_DEVICE=cpu
@@ -193,31 +217,19 @@ RUN --mount=type=cache,target=/root/.cache/uv \
193217 --mount=type=bind,from=torch-builder,source=/torchwheels/,target=/torchwheels/,ro \
194218 --mount=type=bind,from=arrow-builder,source=/arrowwheels/,target=/arrowwheels/,ro \
195219 --mount=type=bind,from=cv-builder,source=/opencvwheels/,target=/opencvwheels/,ro \
220+ --mount=type=bind,from=numa-builder,source=/numactl/,target=/numactl/,rw \
196221 --mount=type=bind,src=.,dst=/src/,rw \
197222 source /opt/rh/gcc-toolset-13/enable && \
198- uv pip install /opencvwheels/*.whl /arrowwheels/*.whl /torchwheels/*.whl && \
223+ uv pip install pythran pybind11 /opencvwheels/*.whl /arrowwheels/*.whl /torchwheels/*.whl && \
199224 sed -i -e 's/.*torch.*//g' /src/pyproject.toml /src/requirements/*.txt && \
200225 uv pip install pandas /hf_wheels/*.whl && \
226+ make -C /numactl install && \
201227 uv pip install -r /src/requirements/common.txt -r /src/requirements/cpu.txt -r /src/requirements/build.txt --no-build-isolation && \
202228 cd /src/ && \
203229 uv build --wheel --out-dir /vllmwheel/ --no-build-isolation && \
204230 uv pip install "$(echo /vllmwheel/*.whl)[tensorizer]" vllm-tgis-adapter==${VLLM_TGIS_ADAPTER_VERSION}
205231
206232
207- ###############################################################
208- # Stage to build numactl
209- ###############################################################
210-
211- FROM base-builder AS numa-builder
212-
213- # Note: Building numactl with gcc-11. Compiling with gcc-13 in this builder stage will
214- # trigger recompilation with gcc-11 (and require libtool) in the final stage where we do not have gcc-13
215- ARG MAX_JOBS
216- ARG NUMACTL_VERSION=2.0.19
217- RUN git clone --recursive https://github.com/numactl/numactl.git -b v${NUMACTL_VERSION} \
218- && cd numactl \
219- && autoreconf -i && ./configure \
220- && make -j ${MAX_JOBS:-$(nproc)}
221233
222234###############################################################
223235# Stage to build lapack
0 commit comments