Commit 94601e77 authored by Ryan McCormick's avatar Ryan McCormick Committed by GitHub
Browse files

fix: Remove duplicate venv setup in Dockerfile (#205)

parent 8588e33a
...@@ -70,34 +70,6 @@ RUN find /opt/tritonserver/python -maxdepth 1 -type f -name \ ...@@ -70,34 +70,6 @@ RUN find /opt/tritonserver/python -maxdepth 1 -type f -name \
ARG GENAI_PERF_TAG="r25.01" ARG GENAI_PERF_TAG="r25.01"
RUN pip install "git+https://github.com/triton-inference-server/perf_analyzer.git@${GENAI_PERF_TAG}#subdirectory=genai-perf" RUN pip install "git+https://github.com/triton-inference-server/perf_analyzer.git@${GENAI_PERF_TAG}#subdirectory=genai-perf"
# Working directory
WORKDIR /workspace
COPY runtime /workspace/runtime
RUN cd runtime/rust && \
cargo build --release --locked && cargo doc --no-deps
# Generate C bindings. Note that this is required for TRTLLM backend re-build
COPY llm /workspace/llm
RUN cd llm/rust/ && \
cargo build --release --locked && cargo doc --no-deps
# Install uv and create virtualenv for general use
COPY python-wheel /workspace/python-wheel
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN mkdir /opt/triton && \
uv venv /opt/triton/venv --python 3.12 && \
source /opt/triton/venv/bin/activate && \
cd python-wheel && \
uv build && \
uv pip install dist/triton_distributed_rs*cp312*.whl
# Package the bindings
RUN mkdir -p /opt/triton/llm_binding/wheels && mkdir /opt/triton/llm_binding/lib
RUN cp python-wheel/dist/triton_distributed_rs*cp312*.whl /opt/triton/llm_binding/wheels/.
RUN cp llm/rust/target/release/libtriton_llm_capi.so /opt/triton/llm_binding/lib/.
RUN cp -r llm/rust/libtriton-llm/include /opt/triton/llm_binding/.
# Backend & Framework Specific Installation # Backend & Framework Specific Installation
ARG FRAMEWORK="STANDARD" ARG FRAMEWORK="STANDARD"
ARG TENSORRTLLM_BACKEND_REPO_TAG= ARG TENSORRTLLM_BACKEND_REPO_TAG=
...@@ -153,39 +125,43 @@ RUN rm -rf /etc/nginx/sites-enabled/default ...@@ -153,39 +125,43 @@ RUN rm -rf /etc/nginx/sites-enabled/default
RUN apt-get install nvtop -y RUN apt-get install nvtop -y
RUN apt-get install tmux -y RUN apt-get install tmux -y
##########################################################
# Tokenizers #
##########################################################
# Todo Pull in from network and not local to repo
#
# RUN --mount=type=bind,source=./container/deps/llama3-tok.tgz,target=/tmp/llama3-tok.tgz \
# mkdir -p /genai-perf/tokenizers && cd /genai-perf/tokenizers && tar -xzf /tmp/llama3-tok.tgz
# Working directory # Working directory
WORKDIR /workspace WORKDIR /workspace
COPY icp /workspace/icp
RUN /workspace/icp/protos/gen_python.sh
COPY runtime /workspace/runtime COPY runtime /workspace/runtime
RUN cd runtime/rust && \ RUN cd runtime/rust && \
cargo build --release --locked && cargo doc --no-deps cargo build --release --locked && cargo doc --no-deps
# Install uv and create virtualenv for general use # Generate C bindings. Note that this is required for TRTLLM backend re-build
COPY llm /workspace/llm
RUN cd llm/rust/ && \
cargo build --release --locked && cargo doc --no-deps
# Install uv, create virtualenv for general use, and build triton_distributed_rs wheel
COPY python-wheel /workspace/python-wheel
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN mkdir /opt/triton && \ RUN mkdir /opt/triton && \
uv venv /opt/triton/venv --python 3.12 && \ uv venv /opt/triton/venv --python 3.12 && \
source /opt/triton/venv/bin/activate && \ source /opt/triton/venv/bin/activate && \
cd runtime/rust/python-wheel && \ cd python-wheel && \
uv build && \ uv build && \
uv pip install dist/triton_distributed_rs*cp312*.whl uv pip install dist/triton_distributed_rs*cp312*.whl
# Package the bindings
RUN mkdir -p /opt/triton/llm_binding/wheels && \
mkdir /opt/triton/llm_binding/lib && \
cp python-wheel/dist/triton_distributed_rs*cp312*.whl /opt/triton/llm_binding/wheels/. && \
cp llm/rust/target/release/libtriton_llm_capi.so /opt/triton/llm_binding/lib/. && \
cp -r llm/rust/libtriton-llm/include /opt/triton/llm_binding/.
# Install triton_distributed_rs wheel globally in container for tests that # Install triton_distributed_rs wheel globally in container for tests that
# currently run without virtual environment activated. # currently run without virtual environment activated.
# TODO: In future, we may use a virtualenv for everything and remove this. # TODO: In future, we may use a virtualenv for everything and remove this.
RUN pip install /opt/triton/llm_binding/wheels/triton_distributed_rs*cp312*.whl RUN pip install /opt/triton/llm_binding/wheels/triton_distributed_rs*cp312*.whl
COPY icp /workspace/icp
RUN /workspace/icp/protos/gen_python.sh
# Install python packages # Install python packages
ARG PYTHON_PACKAGE_VERSION=0.0.1.dev+unknown ARG PYTHON_PACKAGE_VERSION=0.0.1.dev+unknown
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment