3232ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:24.07-py3-min
3333
3434ARG TRITON_CLIENT_REPO_SUBDIR=clientrepo
35+ ARG TRITON_PA_REPO_SUBDIR=perfanalyzerrepo
3536ARG TRITON_COMMON_REPO_TAG=main
3637ARG TRITON_CORE_REPO_TAG=main
38+ ARG TRITON_CLIENT_REPO_TAG=main
3739ARG TRITON_THIRD_PARTY_REPO_TAG=main
3840ARG TRITON_MODEL_ANALYZER_REPO_TAG=main
3941ARG TRITON_ENABLE_GPU=ON
@@ -103,8 +105,10 @@ RUN rm -f /usr/bin/python && \
103105# Build the client library and examples
104106ARG TRITON_REPO_ORGANIZATION
105107ARG TRITON_CLIENT_REPO_SUBDIR
108+ ARG TRITON_PA_REPO_SUBDIR
106109ARG TRITON_COMMON_REPO_TAG
107110ARG TRITON_CORE_REPO_TAG
111+ ARG TRITON_CLIENT_REPO_TAG
108112ARG TRITON_THIRD_PARTY_REPO_TAG
109113ARG TRITON_ENABLE_GPU
110114ARG JAVA_BINDINGS_MAVEN_VERSION
@@ -114,26 +118,53 @@ ARG TARGETPLATFORM
114118WORKDIR /workspace
115119COPY TRITON_VERSION .
116120COPY ${TRITON_CLIENT_REPO_SUBDIR} client
121+ COPY ${TRITON_PA_REPO_SUBDIR} perf_analyzer
117122
118- WORKDIR /workspace/build
123+ WORKDIR /workspace/client_build
119124RUN cmake -DCMAKE_INSTALL_PREFIX=/workspace/install \
120125 -DTRITON_VERSION=`cat /workspace/TRITON_VERSION` \
121126 -DTRITON_REPO_ORGANIZATION=${TRITON_REPO_ORGANIZATION} \
122127 -DTRITON_COMMON_REPO_TAG=${TRITON_COMMON_REPO_TAG} \
123128 -DTRITON_CORE_REPO_TAG=${TRITON_CORE_REPO_TAG} \
124129 -DTRITON_THIRD_PARTY_REPO_TAG=${TRITON_THIRD_PARTY_REPO_TAG} \
130+ -DTRITON_ENABLE_PERF_ANALYZER=OFF \
125131 -DTRITON_ENABLE_CC_HTTP=ON -DTRITON_ENABLE_CC_GRPC=ON \
126- -DTRITON_ENABLE_PYTHON_HTTP=ON -DTRITON_ENABLE_PYTHON_GRPC=ON \
132+ -DTRITON_ENABLE_PYTHON_HTTP=OFF -DTRITON_ENABLE_PYTHON_GRPC=OFF \
127133 -DTRITON_ENABLE_JAVA_HTTP=ON \
128- -DTRITON_ENABLE_PERF_ANALYZER=ON \
134+ -DTRITON_ENABLE_EXAMPLES=ON -DTRITON_ENABLE_TESTS=ON \
135+ -DTRITON_ENABLE_GPU=${TRITON_ENABLE_GPU} /workspace/client
136+ RUN make -j16 cc-clients java-clients && \
137+ rm -fr ~/.m2
138+
139+ # TODO: PA will rebuild the CC clients since it depends on it.
140+ # This should be optimized so that we do not have to build
141+ # the CC clients twice. Similarly, because the SDK expectation is
142+ # that PA is packaged with the python client, we hold off on building
143+ # the python client until now. Post-migration we should focus
144+ # effort on de-tangling these flows.
145+ WORKDIR /workspace/pa_build
146+ RUN cmake -DCMAKE_INSTALL_PREFIX=/workspace/install \
147+ -DTRITON_VERSION=`cat /workspace/TRITON_VERSION` \
148+ -DTRITON_REPO_ORGANIZATION=${TRITON_REPO_ORGANIZATION} \
149+ -DTRITON_COMMON_REPO_TAG=${TRITON_COMMON_REPO_TAG} \
150+ -DTRITON_CORE_REPO_TAG=${TRITON_CORE_REPO_TAG} \
151+ -DTRITON_CLIENT_REPO_TAG=${TRITON_CLIENT_REPO_TAG} \
129152 -DTRITON_ENABLE_PERF_ANALYZER_C_API=ON \
130153 -DTRITON_ENABLE_PERF_ANALYZER_TFS=ON \
131154 -DTRITON_ENABLE_PERF_ANALYZER_TS=ON \
132155 -DTRITON_ENABLE_PERF_ANALYZER_OPENAI=ON \
133- -DTRITON_ENABLE_EXAMPLES=ON -DTRITON_ENABLE_TESTS=ON \
134- -DTRITON_ENABLE_GPU=${TRITON_ENABLE_GPU} /workspace/client
135- RUN make -j16 cc-clients python-clients java-clients && \
136- rm -fr ~/.m2
156+ -DTRITON_ENABLE_CC_HTTP=ON \
157+ -DTRITON_ENABLE_CC_GRPC=ON \
158+ -DTRITON_ENABLE_PYTHON_HTTP=ON \
159+ -DTRITON_ENABLE_PYTHON_GRPC=ON \
160+ -DTRITON_PACKAGE_PERF_ANALYZER=ON \
161+ -DTRITON_ENABLE_GPU=${TRITON_ENABLE_GPU} \
162+ /workspace/perf_analyzer
163+ RUN make -j16 perf-analyzer python-clients
164+
165+ RUN pip3 install build \
166+ && cd /workspace/perf_analyzer/genai-perf \
167+ && python3 -m build --wheel --outdir /workspace/install/python
137168
138169# Install Java API Bindings
139170RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
@@ -144,9 +175,6 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
144175 --jar-install-path /workspace/install/java-api-bindings; \
145176 fi
146177
147- RUN pip3 install build \
148- && cd /workspace/client/src/c++/perf_analyzer/genai-perf \
149- && python3 -m build --wheel --outdir /workspace/install/python
150178############################################################################
151179## Create sdk container
152180############################################################################
0 commit comments