-
Notifications
You must be signed in to change notification settings - Fork 63
[WIP] dockerfile for UBI-9 with vllm-rhai #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a61ccf6
19f6978
8327e97
e289ef8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Current directory should be the root of the repository | ||
|
|
||
| # You may need to pass | ||
| # - VLLM_VERSION | ||
| # - MACA_VERSION | ||
| # to build a specific version | ||
|
|
||
| RHSM_SECRET_FILE=${RHSM_SECRET_FILE:-rhsm.env} | ||
| if [ ! -f "$RHSM_SECRET_FILE" ] && [ -f docker/rhsm.env ]; then | ||
| RHSM_SECRET_FILE=docker/rhsm.env | ||
| fi | ||
|
|
||
| DOCKER_BUILDKIT=1 docker build \ | ||
| --network host \ | ||
|
ILikeIneine marked this conversation as resolved.
|
||
| --secret id=rhsm,src=${RHSM_SECRET_FILE} \ | ||
| -f docker/vllm-cpu.Dockerfile \ | ||
| -t vllm_cpu:new_base_img \ | ||
| --build-arg VLLM_VERSION=v0.18.0 \ | ||
|
ILikeIneine marked this conversation as resolved.
ILikeIneine marked this conversation as resolved.
|
||
| . | ||
|
|
||
| # debug dockerfile and run into shell with buildx: | ||
| # ddocker () { | ||
| # BUILDX_EXPERIMENTAL=1 docker buildx debug --invoke /bin/bash --on=error $@ | ||
| # } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| RHSM_USER='' | ||
| RHSM_PASS='' |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,140 @@ | ||||||
| ARG BUILD_BASE_IMAGE=registry.redhat.io/rhai/base-image-cpu-rhel9:3.4.0-1777399554 | ||||||
| ARG PYTHON_VERSION=3.12 | ||||||
| # ARG UV_EXTRA_INDEX_URL=https://console.redhat.com/api/pypi/public-rhai/rhoai/3.4/cpu-ubi9/simple | ||||||
| ARG UV_INDEX_URL=https://console.redhat.com/api/pypi/public-rhai/rhoai/3.4/cpu-ubi9/simple | ||||||
| # may need passing a particular vllm version during build | ||||||
| ARG VLLM_VERSION | ||||||
|
|
||||||
| ARG RHSM_USER | ||||||
| ARG RHSM_PASS | ||||||
|
|
||||||
| #################### BASE IMAGE #################### | ||||||
| FROM ${BUILD_BASE_IMAGE} AS base | ||||||
|
|
||||||
|
|
||||||
| # # TODO: we most likely do not need all of the dnf installs below: they're already in the base image | ||||||
| # 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 | ||||||
|
|
||||||
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh | ||||||
|
ILikeIneine marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
|
|
||||||
| ENV CC=/usr/bin/gcc CXX=/usr/bin/g++ | ||||||
|
|
||||||
| ENV PATH="/root/.local/bin:$PATH" | ||||||
| ENV VIRTUAL_ENV="/opt/app-root/" | ||||||
| ENV UV_PYTHON_INSTALL_DIR=/opt/app-root/python | ||||||
| ARG PYTHON_VERSION | ||||||
| # RUN uv venv ${VIRTUAL_ENV} --python ${PYTHON_VERSION} --seed | ||||||
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||||||
|
|
||||||
| ENV UV_HTTP_TIMEOUT=500 | ||||||
|
|
||||||
| ENV LD_PRELOAD="/opt/app-root/lib/libiomp5.so" | ||||||
|
|
||||||
| RUN echo 'ulimit -c 0' >> ~/.bashrc | ||||||
|
|
||||||
| ###################### BUILD IMAGE #################### | ||||||
| FROM base AS vllm-cpu-build | ||||||
|
|
||||||
|
|
||||||
| # Install Python dependencies | ||||||
| ARG UV_EXTRA_INDEX_URL | ||||||
| ARG UV_INDEX_URL | ||||||
| ENV UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL} | ||||||
| ENV UV_INDEX_URL=${UV_INDEX_URL} | ||||||
| ENV UV_INDEX_STRATEGY="unsafe-best-match" | ||||||
| ENV UV_LINK_MODE="copy" | ||||||
|
|
||||||
| ENV VLLM_LOGGING_LEVEL=DEBUG | ||||||
|
|
||||||
| ARG VLLM_VERSION | ||||||
| RUN uv pip install --torch-backend=cpu vllm==${VLLM_VERSION} | ||||||
|
ILikeIneine marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
shouldn't need to set the torch backend when using the rhai index
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will fix! |
||||||
Uh oh!
There was an error while loading. Please reload this page.