Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable developer tools build for In-process API + JavaCPP tests (#6296) #6323

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile.QA
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ RUN mkdir -p qa/common && \
cp bin/backend_output_detail_test qa/L0_backend_output_detail/. && \
cp -r deploy/mlflow-triton-plugin qa/L0_mlflow/.

RUN mkdir -p qa/pkgs && \
cp python/triton*.whl qa/pkgs/. && \
cp python/test_binding.py qa/L0_python_api/.

# caffe2plan will not exist if the build was done without TensorRT enabled
RUN if [ -f bin/caffe2plan ]; then \
cp bin/caffe2plan qa/common/.; \
Expand Down Expand Up @@ -369,6 +373,10 @@ RUN rm -fr qa/L0_copyrights qa/L0_build_variants && \
"tritonclient-*linux*.whl" | xargs printf -- '%s[all]' | \
xargs pip3 install --upgrade

# Install Triton Python API
RUN find qa/pkgs/ -maxdepth 1 -type f -name \
"tritonserver-*.whl" | xargs pip3 install --upgrade

ENV LD_LIBRARY_PATH /opt/tritonserver/qa/clients:${LD_LIBRARY_PATH}

# DLIS-3631: Needed to run Perf Analyzer CI tests correctly
Expand Down
10 changes: 9 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,13 @@ def core_build(
os.path.join(repo_install_dir, "lib", "libtritonserver.so"),
os.path.join(install_dir, "lib"),
)
# [FIXME] Placing the Triton server wheel file in 'python' for now, should
# have been upload to pip registry and be able to install directly
cmake_script.mkdir(os.path.join(install_dir, "python"))
cmake_script.cp(
os.path.join(repo_install_dir, "python", "tritonserver*.whl"),
os.path.join(install_dir, "python"),
)

cmake_script.mkdir(os.path.join(install_dir, "include", "triton"))
cmake_script.cpdir(
Expand Down Expand Up @@ -1854,7 +1861,7 @@ def cibase_build(
os.path.join(repo_dir, "src", "test", "models"),
os.path.join(ci_dir, "src", "test"),
)
# Skip copying the artifacts in the bin and lib as those directories will
# Skip copying the artifacts in the bin, lib, and python as those directories will
# be missing when the core build is not enabled.
if not FLAGS.no_core_build:
cmake_script.cpdir(os.path.join(repo_install_dir, "bin"), ci_dir)
Expand All @@ -1863,6 +1870,7 @@ def cibase_build(
os.path.join(repo_install_dir, "lib", "libtritonrepoagent_relocation.so"),
os.path.join(ci_dir, "lib"),
)
cmake_script.cpdir(os.path.join(repo_install_dir, "python"), ci_dir)

# Some of the backends are needed for CI testing
cmake_script.mkdir(os.path.join(ci_dir, "backends"))
Expand Down
14 changes: 10 additions & 4 deletions docs/customization_guide/inference_protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ Java program with the Java bindings with the following steps:
# Run build script
## For In-Process C-API Java Bindings
$ source clientrepo/src/java-api-bindings/scripts/install_dependencies_and_build.sh
## For C-API Wrapper Java Bindings
$ source clientrepo/src/java-api-bindings/scripts/install_dependencies_and_build.sh --enable-developer-tools-server`
## For C-API Wrapper (Triton with C++ bindings) Java Bindings
$ source clientrepo/src/java-api-bindings/scripts/install_dependencies_and_build.sh --enable-developer-tools-server
```
This will install the Java bindings to `/workspace/install/java-api-bindings/tritonserver-java-bindings.jar`

Expand All @@ -472,10 +472,16 @@ If you want to make changes to the Java bindings, then you can use Maven to
build yourself. You can refer to part 1.a of [Run Java program with Java
bindings Jar](#run-java-program-with-java-bindings-jar) to also build the jar
yourself without any modifications to the Tritonserver bindings in
JavaCPP-presets. You can do this using the following steps:
JavaCPP-presets.
You can do this using the following steps:

1. Create the JNI binaries in your local repository (`/root/.m2/repository`)
with [`javacpp-presets/tritonserver`](https://github.com/bytedeco/javacpp-presets/tree/master/tritonserver)
with [`javacpp-presets/tritonserver`](https://github.com/bytedeco/javacpp-presets/tree/master/tritonserver).
For C-API Wrapper Java bindings (Triton with C++ bindings), you need to
install some build specific dependencies including cmake and rapidjson.
Refer to [java installation script](https://github.com/triton-inference-server/client/blob/main/src/java-api-bindings/scripts/install_dependencies_and_build.sh)
for dependencies you need to install and modifications you need to make for your container.
After installing dependencies, you can build the tritonserver project on javacpp-presets:
```bash
$ git clone https://github.com/bytedeco/javacpp-presets.git
$ cd javacpp-presets
Expand Down
11 changes: 5 additions & 6 deletions qa/L0_infer/infer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@

np_dtype_string = np.dtype(object)

# 60 sec is the default value
NETWORK_TIMEOUT = 300.0 if TEST_VALGRIND else 60.0


class InferTest(tu.TestResultCollector):
def _full_exact(
Expand All @@ -66,8 +69,7 @@ def _full_exact(
output0_raw,
output1_raw,
swap,
# 60 sec is the default value
network_timeout=60.0,
network_timeout=NETWORK_TIMEOUT,
):
def _infer_exact_helper(
tester,
Expand All @@ -88,7 +90,7 @@ def _infer_exact_helper(
skip_request_id_check=True,
use_streaming=True,
correlation_id=0,
network_timeout=60.0,
network_timeout=NETWORK_TIMEOUT,
):
for bs in (1, batch_size):
# model that does not support batching
Expand Down Expand Up @@ -550,9 +552,6 @@ def test_class_bbb(self):
output0_raw=False,
output1_raw=False,
swap=True,
# Increase network_timeout for TensorFlow models for
# valgrind test.
network_timeout=100.0 if TEST_VALGRIND else 60.0,
)

def test_class_sss(self):
Expand Down
10 changes: 3 additions & 7 deletions qa/L0_java_memory_growth/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@

# Set up test files based on installation instructions
# https://github.com/bytedeco/javacpp-presets/blob/master/tritonserver/README.md
set +e
rm -r javacpp-presets
git clone https://github.com/bytedeco/javacpp-presets.git
cd javacpp-presets
mvn clean install --projects .,tritonserver
mvn clean install -f platform --projects ../tritonserver/platform -Djavacpp.platform.host
cd ..
set -e
git clone --single-branch --depth=1 -b ${TRITON_CLIENT_REPO_TAG} https://github.com/triton-inference-server/client.git
source client/src/java-api-bindings/scripts/install_dependencies_and_build.sh -b $PWD --keep-build-dependencies
cd ..

export MAVEN_OPTS="-XX:MaxGCPauseMillis=40"
MODEL_REPO=`pwd`/models
Expand Down
10 changes: 3 additions & 7 deletions qa/L0_java_resnet/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,10 @@ done

# Set up test files based on installation instructions
# https://github.com/bytedeco/javacpp-presets/blob/master/tritonserver/README.md
set +e
rm -r javacpp-presets
git clone https://github.com/bytedeco/javacpp-presets.git
cd javacpp-presets
mvn clean install --projects .,tritonserver
mvn clean install -f platform --projects ../tritonserver/platform -Djavacpp.platform.host
cd ..
set -e
git clone --single-branch --depth=1 -b ${TRITON_CLIENT_REPO_TAG} https://github.com/triton-inference-server/client.git
source client/src/java-api-bindings/scripts/install_dependencies_and_build.sh -b $PWD --keep-build-dependencies
cd ..

CLIENT_LOG="client.log"
SAMPLES_REPO=`pwd`/javacpp-presets/tritonserver/samples/simple
Expand Down
10 changes: 3 additions & 7 deletions qa/L0_java_sequence_batcher/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ DATADIR=/data/inferenceserver/${REPO_VERSION}

# Set up test files based on installation instructions
# https://github.com/bytedeco/javacpp-presets/blob/master/tritonserver/README.md
set +e
rm -r javacpp-presets
git clone https://github.com/bytedeco/javacpp-presets.git
cd javacpp-presets
mvn clean install --projects .,tritonserver
mvn clean install -f platform --projects ../tritonserver/platform -Djavacpp.platform.host
cd ..
set -e
git clone --single-branch --depth=1 -b ${TRITON_CLIENT_REPO_TAG} https://github.com/triton-inference-server/client.git
source client/src/java-api-bindings/scripts/install_dependencies_and_build.sh -b $PWD --keep-build-dependencies
cd ..

CLIENT_LOG="client.log"
MODEL_REPO=`pwd`/models
Expand Down
10 changes: 3 additions & 7 deletions qa/L0_java_simple_example/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ if [ -z "$REPO_VERSION" ]; then
exit 1
fi

set +e
rm -r javacpp-presets
git clone https://github.com/bytedeco/javacpp-presets.git
cd javacpp-presets
mvn clean install --projects .,tritonserver
mvn clean install -f platform --projects ../tritonserver/platform -Djavacpp.platform.host
cd ..
set -e
git clone --single-branch --depth=1 -b ${TRITON_CLIENT_REPO_TAG} https://github.com/triton-inference-server/client.git
source client/src/java-api-bindings/scripts/install_dependencies_and_build.sh -b $PWD --keep-build-dependencies
cd ..

CLIENT_LOG="client_cpu_only.log"
DATADIR=/data/inferenceserver/${REPO_VERSION}/qa_model_repository
Expand Down
50 changes: 50 additions & 0 deletions qa/L0_python_api/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NVIDIA CORPORATION nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TEST_LOG="./python_binding.log"

RET=0

rm -f $TEST_LOG

set +e

python test_binding.py > $TEST_LOG 2>&1
if [ $? -ne 0 ]; then
echo -e "\n***\n*** Test Failed\n***"
RET=1
fi
set -e

if [ $RET -eq 0 ]; then
echo -e "\n***\n*** Test Passed\n***"
else
cat $TEST_LOG
echo -e "\n***\n*** Test FAILED\n***"
fi

exit $RET