Skip to content

Commit

Permalink
Dockerfile.ubi: use tensorizer (opendatahub-io#64)
Browse files Browse the repository at this point in the history
add libsodium for tensorizer encryption

---------

Signed-off-by: Prashant Gupta <[email protected]>
Co-authored-by: Daniele <[email protected]>
  • Loading branch information
2 people authored and nathan-weinberg committed Jul 18, 2024
1 parent 59db6b4 commit 23a5a97
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ RUN --mount=type=cache,target=/root/.cache/ccache \
CMAKE_BUILD_TYPE=Release \
python3 setup.py bdist_wheel --dist-dir=dist

#################### libsodium Build IMAGE ####################
FROM base as libsodium-builder

RUN microdnf install -y gcc gzip \
&& microdnf clean all

WORKDIR /usr/src/libsodium

ARG LIBSODIUM_VERSION=1.0.20
RUN curl -LO https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}-RELEASE/libsodium-${LIBSODIUM_VERSION}.tar.gz \
&& tar -xzvf libsodium*.tar.gz \
&& rm -f libsodium*.tar.gz \
&& mv libsodium*/* ./

RUN ./configure --prefix="/usr/" && make && make check

## Release #####################################################################
FROM python-install AS vllm-openai

Expand All @@ -143,7 +159,12 @@ COPY extras/custom_cache_manager.py /opt/vllm/lib/python3.11/site-packages/custo
# install vllm wheel first, so that torch etc will be installed
RUN --mount=type=bind,from=build,src=/workspace/dist,target=/workspace/dist \
--mount=type=cache,target=/root/.cache/pip \
pip install dist/*.whl --verbose
pip install $(echo dist/*.whl)'[tensorizer]' --verbose

# Install libsodium for Tensorizer encryption
RUN --mount=type=bind,from=libsodium-builder,src=/usr/src/libsodium,target=/usr/src/libsodium \
cd /usr/src/libsodium \
&& make install

ENV HF_HUB_OFFLINE=1 \
PORT=8000 \
Expand Down

0 comments on commit 23a5a97

Please sign in to comment.