forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding UBI 9 based vLLM Dockerfile for Power architecture
- Loading branch information
1 parent
134c042
commit 906b2ff
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi:latest | ||
USER root | ||
|
||
ENV MAMBA_ROOT_PREFIX=~/micromamba | ||
ENV PATH=/root/micromamba/bin:$PATH | ||
ENV CMAKE_PREFIX_PATH=/root/micromamba | ||
|
||
RUN dnf install g++ gcc-toolset-12* git protobuf-* bzip2 libtool autoconf -y | ||
WORKDIR /workspace/ | ||
|
||
# Install numctl library | ||
RUN git clone -b v2.0.16 --single-branch https://github.com/numactl/numactl | ||
RUN cd /workspace/numactl && ./autogen.sh && ./configure && make install | ||
|
||
# Install and setup Micromamba | ||
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-ppc64le/latest | tar -xvj bin/micromamba \ | ||
&& mv bin/micromamba /usr/local/bin/ \ | ||
&& micromamba shell init -s bash -r ~/micromamba && source ~/.bashrc \ | ||
&& micromamba activate | ||
|
||
# Install dependencies | ||
RUN micromamba install -y -n base -c https://ftp.osuosl.org/pub/open-ce/1.11.0-p10/ -c defaults python=3.10 torchvision-cpu=0.16.2 rust \ | ||
&& micromamba clean --all --yes | ||
|
||
COPY ./ /workspace/vllm | ||
WORKDIR /workspace/vllm | ||
|
||
RUN pip install -v --prefer-binary --extra-index-url https://repo.fury.io/mgiessing \ | ||
cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \ | ||
torch==2.3.1 \ | ||
-r requirements-cpu.txt \ | ||
xformers uvloop==0.20.0 | ||
|
||
RUN VLLM_TARGET_DEVICE=cpu python3 setup.py develop | ||
|
||
# Set up the environment for the non-root user | ||
RUN umask 002 \ | ||
&& mkdir -p /home/vllm \ | ||
&& useradd --uid 2000 --gid 0 vllm \ | ||
&& chmod g+rwx $HOME /usr/src /workspace/vllm | ||
|
||
# Set environment variables | ||
ENV HF_HUB_OFFLINE=0 \ | ||
PORT=8000 \ | ||
HOME=/home/vllm \ | ||
VLLM_USAGE_SOURCE=production-docker-image \ | ||
VLLM_WORKER_MULTIPROC_METHOD=fork | ||
|
||
ENTRYPOINT ["/root/micromamba/bin/python3", "-m", "vllm.entrypoints.openai.api_server"] |