Skip to content

[WIP] dockerfile for UBI-9 with vllm-rhai#258

Open
ILikeIneine wants to merge 4 commits into
masterfrom
vllm-cpu-dockerfile
Open

[WIP] dockerfile for UBI-9 with vllm-rhai#258
ILikeIneine wants to merge 4 commits into
masterfrom
vllm-cpu-dockerfile

Conversation

@ILikeIneine

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 18, 2026 09:36

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a build script and a multi-stage Dockerfile to create a vLLM CPU image based on UBI 9, including RHSM registration and system dependency management. Key feedback includes correcting the LD_PRELOAD path and moving its declaration to avoid pre-installation errors, removing the 'v' prefix from the VLLM_VERSION build argument, and addressing security concerns regarding the use of --network host and piping curl to sh. Additionally, it is recommended to implement a final runtime stage to reduce image size and security surface by excluding build-time dependencies.

Comment thread docker/vllm-cpu.Dockerfile Outdated
Comment thread docker/build_cpu_image.sh
Comment thread docker/vllm-cpu.Dockerfile
Comment thread docker/vllm-cpu.Dockerfile
Comment thread docker/build_cpu_image.sh

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces manual UBI9 build instructions with an initial Docker-based flow for building a CPU vLLM image using Red Hat UBI9/RHAI package sources and RHSM credentials.

Changes:

  • Adds a UBI9-based CPU Dockerfile that installs system dependencies, creates a uv virtualenv, and installs vLLM.
  • Adds a helper build script and RHSM environment placeholder.
  • Removes the previous manual UBI9 build instructions document.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docker/vllm-cpu.Dockerfile Defines the new UBI9 CPU vLLM image build.
docker/build_cpu_image.sh Adds a helper script for building the CPU Docker image with BuildKit secrets.
docker/rhsm.env Adds placeholder RHSM credential variables for the build secret.
docker/vllm_ubi9_building_instructions.md Removes the old manual UBI9 build guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker/build_cpu_image.sh
Comment thread docker/build_cpu_image.sh
@ILikeIneine

ILikeIneine commented May 18, 2026

Copy link
Copy Markdown
Member Author

As a pending issue, @dtrifiro would suggest to use another base image for vllm-cpu build as discussed in slack. This need to be further pushed by Liming Tsai.

Comment thread docker/vllm-cpu.Dockerfile Outdated
Comment on lines +14 to +104
RUN --mount=type=secret,id=rhsm \
--mount=type=cache,target=/var/cache/dnf,sharing=locked \
bash -euo pipefail -c '\
source /run/secrets/rhsm; \
cleanup() { \
subscription-manager unregister >/dev/null 2>&1 || true; \
subscription-manager clean >/dev/null 2>&1 || true; \
}; \
trap cleanup EXIT; \
subscription-manager register \
--username "$RHSM_USER" \
--password "$RHSM_PASS" \
--auto-attach; \
subscription-manager repos \
--enable codeready-builder-for-rhel-9-x86_64-rpms; \
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \
/usr/bin/crb enable; \
yum makecache; \
yum install -y --setopt=install_weak_deps=False \
python3 \
python3-devel \
zeromq \
bzip2 \
cpio \
elfutils-debuginfod-client \
ffmpeg-free \
fftw \
file \
freetype \
gcc \
gcc-c++ \
gdal-libs \
gdb \
geos \
git-core \
glibc-langpack-en \
glog \
gmp \
gzip \
hdf5 \
jemalloc \
jq \
krb5-libs \
lcms2 \
libaio \
libev \
libjpeg \
libmpc \
libomp \
libpng \
libpq \
libqhull_r \
libsndfile \
libtiff \
libunwind \
libva \
libwebp \
libxml2 \
libxslt \
libzip \
libzstd \
loguru \
lz4 \
make \
mariadb-connector-c \
mpfr \
netcdf \
numactl \
nvtop \
openblas openblas-openmp openblas-openmp64 openblas-serial openblas-serial64 openblas-threads openblas-threads64 \
openjpeg2 \
openmpi \
proj \
protobuf \
qpdf \
re2 \
snappy \
spatialindex \
tbb \
tesseract \
thrift \
unixODBC \
utf8proc \
wget \
xz \
xz-libs \
zlib \
zstd; \
yum clean all'

WORKDIR /workspace

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to get rid of most of these installs once we switch to the rhai base image


WORKDIR /workspace

RUN curl -LsSf https://astral.sh/uv/install.sh | sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv should be already available in the rhai base image, so we should also be able to remove this step

Comment thread docker/vllm-cpu.Dockerfile Outdated

ENV UV_HTTP_TIMEOUT=500

ENV LD_PRELOAD="/opt/venv/lib/libiomp5.so"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this will be available in the rhai image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is copied from vllm's cpu dockerfile. Will check later!

ENV VLLM_LOGGING_LEVEL=DEBUG

ARG VLLM_VERSION
RUN uv pip install --torch-backend=cpu vllm==${VLLM_VERSION}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN uv pip install --torch-backend=cpu vllm==${VLLM_VERSION}
RUN uv pip install vllm==${VLLM_VERSION}

shouldn't need to set the torch backend when using the rhai index

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants