Skip to content

Commit 997095b

Browse files
committed
Dockerfile*.ubi: fix permissions for vllm user, cleanup
1 parent f835f2e commit 997095b

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

Dockerfile.rocm.ubi

+12-13
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,7 @@ RUN --mount=type=bind,from=build_amdsmi,src=/install,target=/install/amdsmi/ \
213213
/install/flashattention/*.whl\
214214
/install/vllm/*.whl
215215

216-
# Set up a non-root user for OpenShift
217-
RUN umask 002 && \
218-
useradd --uid 2000 --gid 0 vllm && \
219-
mkdir -p /licenses && \
220-
chmod g+rwx $HOME /usr/src /workspace
221-
222-
COPY LICENSE /licenses/vllm.md
223-
COPY examples/*.jinja /app/data/template/
224-
225216
ENV HF_HUB_OFFLINE=1 \
226-
PORT=8000 \
227217
HOME=/home/vllm \
228218
# Allow requested max length to exceed what is extracted from the
229219
# config.json
@@ -236,14 +226,23 @@ ENV HF_HUB_OFFLINE=1 \
236226
TOKENIZERS_PARALLELISM=false \
237227
RAY_EXPERIMENTAL_NOSET_ROCR_VISIBLE_DEVICES=1 \
238228
VLLM_USE_TRITON_FLASH_ATTN=0 \
229+
HIP_FORCE_DEV_KERNARG=1 \
239230
OUTLINES_CACHE_DIR=/tmp/outlines \
240231
NUMBA_CACHE_DIR=/tmp/numba \
241232
TRITON_CACHE_DIR=/tmp/triton
242233

243-
# Switch to the non-root user
234+
# setup non-root user for OpenShift
235+
RUN umask 002 && \
236+
useradd --uid 2000 --gid 0 vllm && \
237+
mkdir -p /licenses /home/vllm && \
238+
chmod g+rwx /home/vllm
239+
240+
COPY LICENSE /licenses/vllm.md
241+
COPY examples/*.jinja /app/data/template/
242+
244243
USER 2000
244+
WORKDIR /home/vllm
245245

246-
# Set the entrypoint
247246
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
248247

249248

@@ -254,7 +253,7 @@ USER root
254253
RUN --mount=type=cache,target=/root/.cache/pip \
255254
--mount=type=cache,target=/root/.cache/uv \
256255
--mount=type=bind,from=build_vllm,src=/workspace/dist,target=/install/vllm/ \
257-
HOME=/root/ uv pip install /install/vllm/*.whl vllm-tgis-adapter==0.5.3
256+
HOME=/root uv pip install /install/vllm/*.whl vllm-tgis-adapter==0.5.3
258257

259258
ENV GRPC_PORT=8033 \
260259
PORT=8000 \

Dockerfile.ubi

+10-8
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ ARG PYTHON_VERSION
146146
WORKDIR /workspace
147147

148148
ENV VIRTUAL_ENV=/opt/vllm
149-
ENV PATH=$VIRTUAL_ENV/bin/:$PATH
149+
ENV PATH=$VIRTUAL_ENV/bin:$PATH
150150

151151
# force using the python venv's cuda runtime libraries
152152
ENV LD_LIBRARY_PATH="${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages/nvidia/cuda_nvrtc/lib:${LD_LIBRARY_PATH}"
@@ -182,22 +182,23 @@ ENV HF_HUB_OFFLINE=1 \
182182
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 \
183183
VLLM_USAGE_SOURCE=production-docker-image \
184184
VLLM_WORKER_MULTIPROC_METHOD=fork \
185+
VLLM_NO_USAGE_STATS=1 \
185186
OUTLINES_CACHE_DIR=/tmp/outlines \
186187
NUMBA_CACHE_DIR=/tmp/numba \
187188
TRITON_CACHE_DIR=/tmp/triton \
188-
VLLM_NO_USAGE_STATS=1
189189

190190
# setup non-root user for OpenShift
191-
RUN umask 002 \
192-
&& useradd --uid 2000 --gid 0 vllm \
193-
&& chmod g+rwx $HOME /usr/src /workspace
191+
RUN umask 002 && \
192+
useradd --uid 2000 --gid 0 vllm && \
193+
mkdir -p /home/vllm && \
194+
chmod g+rwx /home/vllm /usr/src /workspace
194195

195196
COPY LICENSE /licenses/vllm.md
196-
197-
# Copy only .jinja files from example directory to template directory
198197
COPY examples/*.jinja /app/data/template/
199198

200199
USER 2000
200+
WORKDIR /home/vllm
201+
201202
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
202203

203204

@@ -206,8 +207,9 @@ FROM vllm-openai as vllm-grpc-adapter
206207
USER root
207208

208209
RUN --mount=type=cache,target=/root/.cache/pip \
210+
--mount=type=cache,target=/root/.cache/uv \
209211
--mount=type=bind,from=build,src=/workspace/dist,target=/workspace/dist \
210-
uv pip install $(echo dist/*.whl)'[tensorizer]' vllm-tgis-adapter==0.5.3
212+
HOME=/root uv pip install $(echo dist/*.whl)'[tensorizer]' vllm-tgis-adapter==0.5.3
211213

212214
ENV GRPC_PORT=8033 \
213215
PORT=8000 \

0 commit comments

Comments
 (0)