Skip to content

Commit 39ea9c8

Browse files
[None][chore]: reduce the layers of the devel docker image
Signed-off-by: Martin Marciniszyn Mehringer <11665257+MartinMarciniszyn@users.noreply.github.com>
1 parent b10137f commit 39ea9c8

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

docker/Dockerfile.multi

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,48 +43,41 @@ COPY docker/common/install.sh \
4343
docker/common/install_ucx.sh \
4444
docker/common/install_nixl.sh \
4545
docker/common/install_etcd.sh \
46-
docker/common/install_mooncake.sh \
4746
./
4847

49-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} \
50-
PYTHON_VERSION=${PYTHON_VERSION} \
51-
bash ./install.sh --base && rm install_base.sh
52-
53-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install.sh --cmake && rm install_cmake.sh
54-
55-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install.sh --ccache && rm install_ccache.sh
56-
57-
RUN bash ./install.sh --cuda_toolkit && rm install_cuda_toolkit.sh
58-
5948
ARG TRT_VER
6049
ARG CUDA_VER
6150
ARG CUDNN_VER
6251
ARG NCCL_VER
6352
ARG CUBLAS_VER
64-
RUN TRT_VER=${TRT_VER} \
53+
ARG TORCH_INSTALL_TYPE="skip"
54+
RUN GITHUB_MIRROR=${GITHUB_MIRROR} \
55+
PYTHON_VERSION=${PYTHON_VERSION} \
56+
TRT_VER=${TRT_VER} \
6557
CUDA_VER=${CUDA_VER} \
6658
CUDNN_VER=${CUDNN_VER} \
6759
NCCL_VER=${NCCL_VER} \
6860
CUBLAS_VER=${CUBLAS_VER} \
69-
bash ./install.sh --tensorrt && rm install_tensorrt.sh
70-
71-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install.sh --polygraphy && rm install_polygraphy.sh
72-
73-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install.sh --mpi4py && rm install_mpi4py.sh
74-
75-
ARG TORCH_INSTALL_TYPE="skip"
76-
RUN TORCH_INSTALL_TYPE=${TORCH_INSTALL_TYPE} bash ./install.sh --pytorch && rm install_pytorch.sh
77-
78-
RUN bash ./install.sh --opencv && rm install.sh
79-
80-
# Install UCX first
81-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_ucx.sh && rm install_ucx.sh
82-
83-
# Install NIXL
84-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_nixl.sh && rm install_nixl.sh
85-
86-
# Install etcd
87-
RUN bash ./install_etcd.sh && rm install_etcd.sh
61+
TORCH_INSTALL_TYPE=${TORCH_INSTALL_TYPE} \
62+
bash ./install.sh --base --cmake --ccache --cuda_toolkit --tensorrt --polygraphy --mpi4py --pytorch --opencv && \
63+
rm install_base.sh && \
64+
rm install_cmake.sh && \
65+
rm install_ccache.sh && \
66+
rm install_cuda_toolkit.sh && \
67+
rm install_tensorrt.sh && \
68+
rm install_polygraphy.sh && \
69+
rm install_mpi4py.sh && \
70+
rm install_pytorch.sh && \
71+
rm install.sh
72+
73+
# Install UCX, NIXL, etcd
74+
# TODO: Combine these into the main install.sh script
75+
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_ucx.sh && \
76+
GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_nixl.sh && \
77+
bash ./install_etcd.sh && \
78+
rm install_ucx.sh && \
79+
rm install_nixl.sh && \
80+
rm install_etcd.sh
8881

8982
FROM ${TRITON_IMAGE}:${TRITON_BASE_TAG} AS triton
9083

@@ -99,16 +92,18 @@ COPY --from=triton /opt/tritonserver/caches /opt/tritonserver/caches
9992

10093
# Copy all installation scripts at once to reduce layers
10194
COPY docker/common/install_triton.sh \
95+
docker/common/install_mooncake.sh \
10296
./
10397

104-
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_triton.sh && rm install_triton.sh
105-
10698
# Install Mooncake, after triton handles boost requirement
107-
RUN if [ -f /etc/redhat-release ]; then \
99+
RUN GITHUB_MIRROR=${GITHUB_MIRROR} bash ./install_triton.sh && \
100+
if [ -f /etc/redhat-release ]; then \
108101
echo "Rocky8 detected, skipping mooncake installation"; \
109102
else \
110103
bash ./install_mooncake.sh; \
111-
fi && rm install_mooncake.sh
104+
fi && \
105+
rm install_triton.sh && \
106+
rm install_mooncake.sh
112107

113108
FROM ${DEVEL_IMAGE} AS wheel
114109
WORKDIR /src/tensorrt_llm

0 commit comments

Comments
 (0)