Skip to content

Commit a8ce199

Browse files
dilipgbdtrifiro
andauthored
Dockerfile.s390x: fix build
`hf-transfer` build was failing because of missing dependencies: added rust env vars, added perl-core dependency --------- Signed-off-by: Dilip Gowda Bhagavan <[email protected]> Co-authored-by: Daniele <[email protected]>
1 parent a1af218 commit a8ce199

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

Dockerfile.s390x.ubi

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Base UBI image for s390x architecture
22
ARG BASE_UBI_IMAGE_TAG=9.5-1741850109
33
ARG PYTHON_VERSION=3.12
4+
ARG VLLM_TGIS_ADAPTER_VERSION="0.6.3"
45
FROM registry.access.redhat.com/ubi9/ubi-minimal:${BASE_UBI_IMAGE_TAG} AS base
56

67
# Install basic dependencies
@@ -64,9 +65,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
6465
FROM python-install AS numa-build
6566
# Install numactl (needed for numa.h dependency)
6667
WORKDIR /tmp
67-
RUN curl -LO https://github.com/numactl/numactl/archive/refs/tags/v2.0.16.tar.gz && \
68-
tar -xvzf v2.0.16.tar.gz && \
69-
cd numactl-2.0.16 && \
68+
RUN curl -LO https://github.com/numactl/numactl/archive/refs/tags/v2.0.18.tar.gz && \
69+
tar -xvzf v2.0.18.tar.gz && \
70+
cd numactl-2.0.18 && \
7071
./autogen.sh && \
7172
./configure && \
7273
make
@@ -94,10 +95,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
9495
cd vision && \
9596
git checkout $TORCH_VISION_VERSION && \
9697
uv pip install -v torch==${TORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu && \
97-
python setup.py bdist_wheel
98+
python setup.py bdist_wheel && \
99+
uv pip install dist/*.whl
98100

99101
# Final build stage
100-
FROM python-install AS vllm-cpu
102+
FROM python-install AS vllm-openai
101103
ARG PYTHON_VERSION
102104

103105
# Set correct library path for torch and numactl
@@ -108,33 +110,28 @@ ENV UV_LINK_MODE=copy
108110
COPY . /workspace/vllm
109111
WORKDIR /workspace/vllm
110112

111-
RUN --mount=type=bind,from=numa-build,src=/tmp/numactl-2.0.16,target=/numactl \
113+
RUN --mount=type=bind,from=numa-build,src=/tmp/numactl-2.0.18,target=/numactl \
112114
make -C /numactl install
113115

114116
# Install dependencies, including PyTorch and Apache Arrow
115117
RUN --mount=type=cache,target=/root/.cache/uv \
116118
--mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
117119
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
118120
--mount=type=bind,from=pyarrow,source=/tmp/arrow/python/dist,target=/tmp/arrow-wheels \
119-
--mount=type=bind,from=torch-vision,source=/tmp/vision/dist,target=/tmp/vision-wheels/ \
120-
CARGO_HOME=/root/.cargo \
121-
RUSTUP_HOME=/root/.rustup \
122-
PATH="/root/.cargo/bin:/root/.rustup/bin:$PATH" \
121+
export PATH="/root/.cargo/bin:/root/.rustup/bin:$PATH" \
122+
ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
123123
sed -i '/^torch/d' requirements-build.txt && \
124124
sed -i '/^numba/d' requirements-common.txt && \
125-
ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
126-
VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl | head -n 1) && \
127-
uv pip install -v \
128-
$ARROW_WHL_FILE \
129-
$VISION_WHL_FILE \
125+
uv pip install -v \
126+
$ARROW_WHL_FILE \
130127
--extra-index-url https://download.pytorch.org/whl/nightly/cpu \
131128
--index-strategy unsafe-best-match \
132129
-r requirements-build.txt \
133-
-r requirements-cpu.txt
130+
-r requirements-cpu.txt
134131

135132
# Build and install vllm
136133
RUN --mount=type=cache,target=/root/.cache/uv \
137-
VLLM_TARGET_DEVICE=cpu python setup.py bdist_wheel && \
134+
VLLM_TARGET_DEVICE=cpu uv build --wheel --no-build-isolation && \
138135
uv pip install "$(echo dist/*.whl)[tensorizer]"
139136

140137
ENV HF_HUB_OFFLINE=1 \
@@ -163,20 +160,33 @@ WORKDIR /home/vllm
163160
# Set the default entrypoint
164161
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
165162

166-
167-
FROM vllm-cpu as vllm-grpc-adapter
163+
FROM vllm-openai AS vllm-tgis-adapter-cache-builder
164+
ARG VLLM_TGIS_ADAPTER_VERSION
168165

169166
USER root
170167

168+
RUN microdnf install -y perl-core
169+
171170
ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
172171

173172
RUN --mount=type=cache,target=/root/.cache/uv \
174173
--mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
175174
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
176-
CARGO_HOME=/root/.cargo \
177-
RUSTUP_HOME=/root/.rustup \
178-
PATH="/root/.cargo/bin:/root/.rustup/bin:$PATH" \
179-
HOME=/root uv pip install "$(echo /workspace/vllm/dist/*.whl)[tensorizer]" vllm-tgis-adapter==0.6.3
175+
export PATH="$PATH:/root/.cargo/bin:/root/.rustup/bin" && \
176+
HOME=/root uv pip install "$(echo /workspace/vllm/dist/*.whl)[tensorizer]" vllm-tgis-adapter==${VLLM_TGIS_ADAPTER_VERSION} && \
177+
cd /tmp && touch control
178+
179+
FROM vllm-openai as vllm-grpc-adapter
180+
ARG VLLM_TGIS_ADAPTER_VERSION
181+
182+
USER root
183+
184+
ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
185+
186+
COPY --from=vllm-tgis-adapter-cache-builder /tmp/control /dev/null
187+
188+
RUN --mount=type=cache,target=/root/.cache/uv \
189+
HOME=/root uv pip install "$(echo /workspace/vllm/dist/*.whl)[tensorizer]" vllm-tgis-adapter==${VLLM_TGIS_ADAPTER_VERSION}
180190

181191
ENV GRPC_PORT=8033 \
182192
PORT=8000 \

0 commit comments

Comments
 (0)