Skip to content

Commit 87bf3a2

Browse files
Shafi-HussainMu Huai
authored andcommitted
[fix]: Dockerfile.ppc64le fixes for opencv-python and hf-xet (vllm-project#16048)
Signed-off-by: Md. Shafi Hussain <[email protected]> Signed-off-by: Mu Huai <[email protected]>
1 parent eda00a7 commit 87bf3a2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

docker/Dockerfile.ppc64le

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,16 @@ RUN --mount=type=cache,target=/root/.cache/uv \
126126
FROM base-builder AS cv-builder
127127

128128
ARG MAX_JOBS
129-
ARG OPENCV_VERSION=84
129+
ARG OPENCV_VERSION=86
130+
# patch for version 4.11.0.86
131+
ARG OPENCV_PATCH=97f3f39
130132
ARG ENABLE_HEADLESS=1
131133
RUN --mount=type=cache,target=/root/.cache/uv \
132134
source /opt/rh/gcc-toolset-13/enable && \
133135
git clone --recursive https://github.com/opencv/opencv-python.git -b ${OPENCV_VERSION} && \
134136
cd opencv-python && \
135-
sed -i 's/"setuptools==59.2.0",/"setuptools<70.0",/g' pyproject.toml && \
137+
sed -i -E -e 's/"setuptools.+",/"setuptools",/g' pyproject.toml && \
138+
cd opencv && git cherry-pick --no-commit $OPENCV_PATCH && cd .. && \
136139
python -m build --wheel --installer=uv --outdir /opencvwheels/
137140

138141
###############################################################
@@ -148,9 +151,15 @@ COPY --from=arrow-builder /tmp/control /dev/null
148151
COPY --from=cv-builder /tmp/control /dev/null
149152

150153
ARG VLLM_TARGET_DEVICE=cpu
154+
ARG GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
151155

152156
# this step installs vllm and populates uv cache
153157
# with all the transitive dependencies
158+
RUN --mount=type=cache,target=/root/.cache/uv \
159+
source /opt/rh/gcc-toolset-13/enable && \
160+
git clone https://github.com/huggingface/xet-core.git && cd xet-core/hf_xet/ && \
161+
uv pip install maturin && \
162+
uv build --wheel --out-dir /hf_wheels/
154163
RUN --mount=type=cache,target=/root/.cache/uv \
155164
--mount=type=bind,from=torch-builder,source=/torchwheels/,target=/torchwheels/,ro \
156165
--mount=type=bind,from=arrow-builder,source=/arrowwheels/,target=/arrowwheels/,ro \
@@ -159,7 +168,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
159168
source /opt/rh/gcc-toolset-13/enable && \
160169
uv pip install /opencvwheels/*.whl /arrowwheels/*.whl /torchwheels/*.whl && \
161170
sed -i -e 's/.*torch.*//g' /src/pyproject.toml /src/requirements/*.txt && \
162-
uv pip install pandas pythran pybind11 && \
171+
uv pip install pandas pythran pybind11 /hf_wheels/*.whl && \
163172
# sentencepiece.pc is in some pkgconfig inside uv cache
164173
export PKG_CONFIG_PATH=$(find / -type d -name "pkgconfig" 2>/dev/null | tr '\n' ':') && \
165174
uv pip install -r /src/requirements/common.txt -r /src/requirements/cpu.txt -r /src/requirements/build.txt --no-build-isolation && \
@@ -247,8 +256,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
247256
--mount=type=bind,from=torch-builder,source=/torchwheels/,target=/torchwheels/,ro \
248257
--mount=type=bind,from=arrow-builder,source=/arrowwheels/,target=/arrowwheels/,ro \
249258
--mount=type=bind,from=cv-builder,source=/opencvwheels/,target=/opencvwheels/,ro \
259+
--mount=type=bind,from=vllmcache-builder,source=/hf_wheels/,target=/hf_wheels/,ro \
250260
--mount=type=bind,from=vllmcache-builder,source=/vllmwheel/,target=/vllmwheel/,ro \
251-
HOME=/root uv pip install /opencvwheels/*.whl /arrowwheels/*.whl /torchwheels/*.whl /vllmwheel/*.whl
261+
HOME=/root uv pip install /opencvwheels/*.whl /arrowwheels/*.whl /torchwheels/*.whl /hf_wheels/*.whl /vllmwheel/*.whl
252262

253263
COPY ./ /workspace/vllm
254264
WORKDIR /workspace/vllm

0 commit comments

Comments
 (0)