-
Notifications
You must be signed in to change notification settings - Fork 75
/
Dockerfile
92 lines (76 loc) · 3.51 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:24.11-py3
ARG TRITONSDK_BASE_IMAGE=nvcr.io/nvidia/tritonserver:24.11-py3-sdk
ARG MODEL_ANALYZER_VERSION=1.47.0dev
ARG MODEL_ANALYZER_CONTAINER_VERSION=24.12dev
FROM ${TRITONSDK_BASE_IMAGE} as sdk
FROM $BASE_IMAGE
ARG MODEL_ANALYZER_VERSION
ARG MODEL_ANALYZER_CONTAINER_VERSION
ARG BASE_IMAGE
ARG TRITONSDK_BASE_IMAGE
# DCGM version to install for Model Analyzer
ENV DCGM_VERSION=3.3.6
# Ensure apt-get won't prompt for selecting options
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y python3-dev
RUN mkdir -p /opt/triton-model-analyzer
# Install architecture-specific components
# Install DCGM
RUN [ "$(uname -m)" != "x86_64" ] && arch="sbsa" || arch="x86_64" && \
curl -o /tmp/cuda-keyring.deb \
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/$arch/cuda-keyring_1.1-1_all.deb && \
apt-get install /tmp/cuda-keyring.deb && rm /tmp/cuda-keyring.deb && \
apt-get update && apt-get install -y --no-install-recommends software-properties-common && \
apt-get install -y datacenter-gpu-manager=1:${DCGM_VERSION};
# Install Docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && apt-get install -y docker-ce-cli
# Install tritonclient
COPY --from=sdk /workspace/install/python /tmp/tritonclient
RUN find /tmp/tritonclient -maxdepth 1 -type f -name \
"tritonclient-*-manylinux*.whl" | xargs printf -- '%s[all]' | \
xargs pip3 install --upgrade && rm -rf /tmp/tritonclient/
WORKDIR /opt/triton-model-analyzer
RUN rm -fr *
COPY --from=sdk /usr/local/bin/perf_analyzer .
RUN chmod +x ./perf_analyzer
COPY . .
RUN chmod +x /opt/triton-model-analyzer/nvidia_entrypoint.sh
RUN chmod +x build_wheel.sh && \
./build_wheel.sh perf_analyzer true && \
rm -f perf_analyzer
RUN python3 -m pip install nvidia-pyindex && \
python3 -m pip install wheels/triton_model_analyzer-*-manylinux*.whl
#Other pip packages
RUN python3 -m pip install coverage
RUN python3 -m pip install mypy
RUN python3 -m pip install types-PyYAML
RUN python3 -m pip install types-requests
RUN python3 -m pip install types-protobuf
RUN python3 -m pip install mkdocs
RUN python3 -m pip install mkdocs-htmlproofer-plugin==0.10.3
RUN python3 -m pip install yapf==0.32.0
RUN apt-get install -y wkhtmltopdf
ENTRYPOINT ["/opt/triton-model-analyzer/nvidia_entrypoint.sh"]
ENV MODEL_ANALYZER_VERSION ${MODEL_ANALYZER_VERSION}
ENV MODEL_ANALYZER_CONTAINER_VERSION ${MODEL_ANALYZER_CONTAINER_VERSION}
ENV TRITON_SERVER_SDK_CONTAINER_IMAGE_NAME ${TRITONSDK_BASE_IMAGE}
ENV TRITON_SERVER_CONTAINER_IMAGE_NAME ${BASE_IMAGE}