Skip to content

Commit 7b5ecf7

Browse files
authored
s390x: Fix PyArrow build and add CPU test script for Buildkite CI (#16036)
Signed-off-by: Nishan Acharya <[email protected]>
1 parent 9883a18 commit 7b5ecf7

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# This script build the CPU docker image and run the offline inference inside the container.
4+
# It serves a sanity check for compilation and basic model usage.
5+
set -ex
6+
7+
# Setup cleanup
8+
remove_docker_container() { docker rm -f cpu-test || true; docker system prune -f; }
9+
trap remove_docker_container EXIT
10+
remove_docker_container
11+
12+
# Try building the docker image
13+
docker build -t cpu-test -f docker/Dockerfile.s390x .

docker/Dockerfile.s390x

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5858
cd ../../python && \
5959
export PYARROW_PARALLEL=4 && \
6060
export ARROW_BUILD_TYPE=release && \
61-
uv pip install -r requirements/build.txt && \
61+
uv pip install -r requirements-build.txt && \
6262
python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --bundle-arrow-cpp bdist_wheel
6363

6464
FROM python-install AS numa-build
@@ -96,6 +96,22 @@ RUN --mount=type=cache,target=/root/.cache/uv \
9696
uv pip install -v torch==${TORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu && \
9797
python setup.py bdist_wheel
9898

99+
FROM python-install AS hf-xet-builder
100+
# Install hf-xet
101+
WORKDIR /tmp
102+
ENV CARGO_HOME=/root/.cargo
103+
ENV RUSTUP_HOME=/root/.rustup
104+
ENV PATH="$CARGO_HOME/bin:$RUSTUP_HOME/bin:$PATH"
105+
RUN --mount=type=cache,target=/root/.cache/uv \
106+
--mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
107+
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
108+
git clone https://github.com/huggingface/xet-core.git && \
109+
cd xet-core/hf_xet/ && \
110+
uv pip install maturin patchelf && \
111+
python -m maturin build --release --out dist && \
112+
mkdir -p /tmp/hf-xet/dist && \
113+
cp dist/*.whl /tmp/hf-xet/dist/
114+
99115
# Final build stage
100116
FROM python-install AS vllm-cpu
101117
ARG PYTHON_VERSION
@@ -120,12 +136,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \
120136
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
121137
--mount=type=bind,from=pyarrow,source=/tmp/arrow/python/dist,target=/tmp/arrow-wheels \
122138
--mount=type=bind,from=torch-vision,source=/tmp/vision/dist,target=/tmp/vision-wheels/ \
139+
--mount=type=bind,from=hf-xet-builder,source=/tmp/hf-xet/dist,target=/tmp/hf-xet-wheels/ \
123140
sed -i '/^torch/d' requirements/build.txt && \
124141
ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
125142
VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl | head -n 1) && \
143+
HF_XET_WHL_FILE=$(ls /tmp/hf-xet-wheels/*.whl | head -n 1) && \
126144
uv pip install -v \
127145
$ARROW_WHL_FILE \
128146
$VISION_WHL_FILE \
147+
$HF_XET_WHL_FILE \
129148
--extra-index-url https://download.pytorch.org/whl/nightly/cpu \
130149
--index-strategy unsafe-best-match \
131150
-r requirements/build.txt \
@@ -149,4 +168,5 @@ USER 2000
149168
WORKDIR /home/vllm
150169

151170
# Set the default entrypoint
152-
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
171+
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
172+

0 commit comments

Comments
 (0)