Skip to content

Commit 73de967

Browse files
authored
[Cherry Pick] ci: Fix Windows CI Errors (#7886)
1 parent 3271f69 commit 73de967

File tree

9 files changed

+35
-16
lines changed

9 files changed

+35
-16
lines changed

qa/L0_backend_python/lifecycle/lifecycle_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def setUp(self):
6868
self._shm_leak_detector = shm_util.ShmLeakDetector()
6969

7070
def _get_metrics(self):
71-
metrics_url = "http://localhost:8002/metrics"
71+
metrics_url = f"http://{_tritonserver_ipaddr}:8002/metrics"
7272
r = requests.get(metrics_url)
7373
r.raise_for_status()
7474
return r.text
@@ -305,7 +305,9 @@ def test_triton_grpc_error_cancel(self):
305305
shape = [2, 2]
306306
number_of_requests = 1
307307
user_data = UserData()
308-
triton_server_url = "localhost:8001" # Replace with your Triton server address
308+
triton_server_url = (
309+
f"{_tritonserver_ipaddr}:8001" # Replace with your Triton server address
310+
)
309311
stream_end = False
310312
triton_client = grpcclient.InferenceServerClient(triton_server_url)
311313

qa/L0_backend_python/response_sender/response_sender_complete_final_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
import numpy as np
3232
import tritonclient.grpc as grpcclient
3333

34+
# By default, find tritonserver on "localhost", but for windows tests
35+
# we overwrite the IP address with the TRITONSERVER_IPADDR envvar
36+
_tritonserver_ipaddr = os.environ.get("TRITONSERVER_IPADDR", "localhost")
37+
3438

3539
class ResponseSenderTest(unittest.TestCase):
3640
def _generate_streaming_callback_and_responses_pair(self):
@@ -53,7 +57,7 @@ def test_respond_after_complete_final(self):
5357
inputs[0].set_data_from_numpy(input0_np)
5458

5559
callback, responses = self._generate_streaming_callback_and_responses_pair()
56-
with grpcclient.InferenceServerClient("localhost:8001") as client:
60+
with grpcclient.InferenceServerClient(f"{_tritonserver_ipaddr}:8001") as client:
5761
client.start_stream(callback)
5862
client.async_stream_infer(model_name, inputs)
5963
client.stop_stream()

qa/L0_backend_python/response_sender/response_sender_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@
2424
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2525
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

27+
import os
2728
import unittest
2829

2930
import numpy as np
3031
import tritonclient.grpc as grpcclient
3132
from tritonclient.utils import InferenceServerException
3233

34+
# By default, find tritonserver on "localhost", but for windows tests
35+
# we overwrite the IP address with the TRITONSERVER_IPADDR envvar
36+
_tritonserver_ipaddr = os.environ.get("TRITONSERVER_IPADDR", "localhost")
37+
3338

3439
class ResponseSenderTest(unittest.TestCase):
3540
_inputs_parameters_zero_response_pre_return = {
@@ -148,7 +153,7 @@ def callback(result, error):
148153

149154
def _infer_parallel(self, model_name, parallel_inputs):
150155
callback, responses = self._generate_streaming_callback_and_responses_pair()
151-
with grpcclient.InferenceServerClient("localhost:8001") as client:
156+
with grpcclient.InferenceServerClient(f"{_tritonserver_ipaddr}:8001") as client:
152157
client.start_stream(callback)
153158
for inputs in parallel_inputs:
154159
client.async_stream_infer(model_name, inputs)

qa/L0_backend_python/response_sender/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ if [ $? -ne 0 ]; then
9494
fi
9595
set -e
9696

97-
kill $SERVER_PID
98-
wait $SERVER_PID
97+
kill_server
9998

10099
#
101100
# Test response sender to raise exception on response after complete final flag
@@ -125,8 +124,7 @@ if [ $? -ne 0 ]; then
125124
fi
126125
set -e
127126

128-
kill $SERVER_PID
129-
wait $SERVER_PID
127+
kill_server
130128

131129
#
132130
# Test async response sender under decoupled / non-decoupled

qa/L0_batcher/queue_timeout_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,23 @@
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929
import concurrent.futures
30+
import os
3031
import time
3132
import unittest
3233

3334
import numpy as np
3435
import tritonclient.grpc as grpcclient
3536
from tritonclient.utils import InferenceServerException
3637

38+
# By default, find tritonserver on "localhost", but for windows tests
39+
# we overwrite the IP address with the TRITONSERVER_IPADDR envvar
40+
_tritonserver_ipaddr = os.environ.get("TRITONSERVER_IPADDR", "localhost")
41+
3742

3843
class TestMaxQueueDelayTimeout(unittest.TestCase):
3944
def setUp(self):
4045
# Initialize client
41-
self._triton = grpcclient.InferenceServerClient("localhost:8001")
46+
self._triton = grpcclient.InferenceServerClient(f"{_tritonserver_ipaddr}:8001")
4247

4348
def _get_inputs(self, batch_size):
4449
self.assertIsInstance(batch_size, int)

qa/L0_batcher/test.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ if [[ -v WSL_DISTRO_NAME ]] || [[ -v MSYSTEM ]]; then
8585
BACKEND_DIR=${BACKEND_DIR:=C:/tritonserver/backends}
8686
SERVER=${SERVER:=/mnt/c/tritonserver/bin/tritonserver.exe}
8787
export WSLENV=$WSLENV:TRITONSERVER_DELAY_SCHEDULER
88+
TEST_WINDOWS=1
89+
# DLIS-7683 This test fails performance-related response time parameters
90+
# when using HTTP protocol. Use gRPC protocol for now as a WAR.
91+
export USE_GRPC=1
8892
else
8993
MODELDIR=${MODELDIR:=`pwd`}
9094
DATADIR=${DATADIR:="/data/inferenceserver/${REPO_VERSION}"}
@@ -601,7 +605,7 @@ done
601605
TEST_CASE=test_multi_batch_preserve_ordering
602606

603607
# Skip test for Windows. Trace file concats at 8192 chars on Windows.
604-
if [[ ! -v WSL_DISTRO_NAME ]] || [[ ! -v MSYSTEM ]]; then
608+
if [ $TEST_WINDOWS -eq 0 ]; then
605609
rm -fr ./custom_models && mkdir ./custom_models && \
606610
cp -r ../custom_models/custom_zero_1_float32 ./custom_models/. && \
607611
mkdir -p ./custom_models/custom_zero_1_float32/1
@@ -754,7 +758,7 @@ mkdir -p models/dynamic_batch/1 && (cd models/dynamic_batch && \
754758
TEST_LOG="queue_timeout_test.log"
755759
SERVER_LOG="./queue_timeout_test.server.log"
756760

757-
SERVER_ARGS="--model-repository=`pwd`/models --log-verbose=2"
761+
SERVER_ARGS="--model-repository=$MODELDIR/models --log-verbose=2 --backend-directory=${BACKEND_DIR}"
758762
run_server
759763
if [ "$SERVER_PID" == "0" ]; then
760764
echo -e "\n***\n*** Failed to start $SERVER\n***"
@@ -771,8 +775,7 @@ if [ $? -ne 0 ]; then
771775
fi
772776
set -e
773777

774-
kill $SERVER_PID
775-
wait $SERVER_PID
778+
kill_server
776779

777780
if [ $RET -eq 0 ]; then
778781
echo -e "\n***\n*** Test Passed\n***"

qa/L0_trt_compat/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ -z "$REPO_VERSION" ]; then
3434
echo -e "\n***\n*** Test Failed\n***"
3535
exit 1
3636
fi
37-
if [ ! -z "$TEST_REPO_ARCH" ]; then
37+
if [ ! -z "$TEST_REPO_ARCH" ]; then
3838
REPO_VERSION=${REPO_VERSION}_${TEST_REPO_ARCH}
3939
fi
4040

qa/L0_trt_plugin/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ if [[ -v WSL_DISTRO_NAME ]] || [[ -v MSYSTEM ]]; then
5353
CUSTOMPLUGIN=${CUSTOMPLUGIN:=$MODELDIR/HardmaxPlugin.dll}
5454
BACKEND_DIR=${BACKEND_DIR:=C:/tritonserver/backends}
5555
SERVER=${SERVER:=/mnt/c/tritonserver/bin/tritonserver.exe}
56+
TEST_WINDOWS=1
5657
else
5758
DATADIR=${DATADIR:="/data/inferenceserver/${REPO_VERSION}"}
5859
MODELDIR=${MODELDIR:=`pwd`/models}
@@ -135,7 +136,8 @@ SERVER_LD_PRELOAD=$CUSTOMPLUGIN
135136
SERVER_ARGS=$SERVER_ARGS_BASE
136137
SERVER_LOG="./inference_server_$LOG_IDX.log"
137138

138-
if [[ ! -v WSL_DISTRO_NAME ]] || [[ ! -v MSYSTEM ]]; then
139+
# Skip test for Windows
140+
if [ $TEST_WINDOWS -eq 0 ]; then
139141
run_server
140142
if [ "$SERVER_PID" == "0" ]; then
141143
echo -e "\n***\n*** Failed to start $SERVER\n***"

qa/common/infer_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def inferAndCheckResults(
701701
)
702702
if cidx == expected0_sort_idx[b][idx]:
703703
tester.assertEqual(
704-
ctuple[2],
704+
ctuple[2].strip("\r"),
705705
"label{}".format(expected0_sort_idx[b][idx]),
706706
)
707707
elif result_name == OUTPUT1:

0 commit comments

Comments
 (0)