1
1
# Base UBI image for s390x architecture
2
2
ARG BASE_UBI_IMAGE_TAG=9.5-1741850109
3
3
ARG PYTHON_VERSION=3.12
4
+ ARG VLLM_TGIS_ADAPTER_VERSION="0.6.3"
4
5
FROM registry.access.redhat.com/ubi9/ubi-minimal:${BASE_UBI_IMAGE_TAG} AS base
5
6
6
7
# Install basic dependencies
@@ -64,9 +65,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
64
65
FROM python-install AS numa-build
65
66
# Install numactl (needed for numa.h dependency)
66
67
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 && \
70
71
./autogen.sh && \
71
72
./configure && \
72
73
make
@@ -94,10 +95,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
94
95
cd vision && \
95
96
git checkout $TORCH_VISION_VERSION && \
96
97
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
98
100
99
101
# Final build stage
100
- FROM python-install AS vllm-cpu
102
+ FROM python-install AS vllm-openai
101
103
ARG PYTHON_VERSION
102
104
103
105
# Set correct library path for torch and numactl
@@ -108,33 +110,28 @@ ENV UV_LINK_MODE=copy
108
110
COPY . /workspace/vllm
109
111
WORKDIR /workspace/vllm
110
112
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 \
112
114
make -C /numactl install
113
115
114
116
# Install dependencies, including PyTorch and Apache Arrow
115
117
RUN --mount=type=cache,target=/root/.cache/uv \
116
118
--mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
117
119
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
118
120
--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) && \
123
123
sed -i '/^torch/d' requirements-build.txt && \
124
124
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 \
130
127
--extra-index-url https://download.pytorch.org/whl/nightly/cpu \
131
128
--index-strategy unsafe-best-match \
132
129
-r requirements-build.txt \
133
- -r requirements-cpu.txt
130
+ -r requirements-cpu.txt
134
131
135
132
# Build and install vllm
136
133
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 && \
138
135
uv pip install "$(echo dist/*.whl)[tensorizer]"
139
136
140
137
ENV HF_HUB_OFFLINE=1 \
@@ -163,20 +160,33 @@ WORKDIR /home/vllm
163
160
# Set the default entrypoint
164
161
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
165
162
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
168
165
169
166
USER root
170
167
168
+ RUN microdnf install -y perl-core
169
+
171
170
ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
172
171
173
172
RUN --mount=type=cache,target=/root/.cache/uv \
174
173
--mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
175
174
--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}
180
190
181
191
ENV GRPC_PORT=8033 \
182
192
PORT=8000 \
0 commit comments