@@ -96,6 +96,7 @@ locale_test() {
9696 set -e
9797}
9898
99+ # This is only run for the default installation of python version, 3.12.
99100extraction_test () {
100101 # # Test re-extraction of environment.
101102 SERVER_ARGS=" --model-repository=` pwd` /models --log-verbose=1 --model-control-mode=explicit"
@@ -131,6 +132,9 @@ extraction_test() {
131132}
132133
133134aws_test () {
135+ local EXPECTED_VERSION_STRING=$1
136+ local MODEL_TYPE=$2 # Can be one of: python_3_6, python_3_12
137+
134138 # Test execution environments with S3
135139 # S3 credentials are necessary for this test. Pass via ENV variables
136140 aws configure set default.region $AWS_DEFAULT_REGION && \
@@ -151,10 +155,6 @@ aws_test() {
151155 BUCKET_URL=${BUCKET_URL%/ }
152156 BUCKET_URL_SLASH=" ${BUCKET_URL} /"
153157
154- # Remove Python 3.7 model because it contains absolute paths and cannot be used
155- # with S3.
156- rm -rf models/python_3_7
157-
158158 # Test with the bucket url as model repository
159159 aws s3 cp models/ " ${BUCKET_URL_SLASH} " --recursive --include " *"
160160
@@ -172,10 +172,10 @@ aws_test() {
172172 wait $SERVER_PID
173173
174174 set +e
175- grep " $PY36_VERSION_STRING " $SERVER_LOG
175+ grep " $EXPECTED_VERSION_STRING " $SERVER_LOG
176176 if [ $? -ne 0 ]; then
177177 cat $SERVER_LOG
178- echo -e " \n***\n*** $PY36_VERSION_STRING was not found in Triton logs. \n***"
178+ echo -e " \n***\n*** $EXPECTED_VERSION_STRING was not found in Triton logs. \n***"
179179 RET=1
180180 fi
181181 set -e
@@ -184,11 +184,14 @@ aws_test() {
184184 aws s3 rm " ${BUCKET_URL_SLASH} " --recursive --include " *"
185185
186186 # Test with EXECUTION_ENV_PATH outside the model directory
187- sed -i " s/TRITON_MODEL_DIRECTORY\/python_3_6_environment/TRITON_MODEL_DIRECTORY\/..\/python_3_6_environment/" models/python_3_6/config.pbtxt
188- mv models/python_3_6/python_3_6_environment.tar.gz models
189- sed -i " s/\$\$ TRITON_MODEL_DIRECTORY\/python_3_12_environment/s3:\/\/triton-bucket-${CI_JOB_ID} \/python_3_12_environment/" models/python_3_12/config.pbtxt
190- mv models/python_3_12/python_3_12_environment.tar.gz models
191-
187+ if [[ " $MODEL_TYPE " == " python_3_6" ]]; then
188+ sed -i " s/TRITON_MODEL_DIRECTORY\/python_3_6_environment/TRITON_MODEL_DIRECTORY\/..\/python_3_6_environment/" models/python_3_6/config.pbtxt
189+ mv models/python_3_6/python_3_6_environment.tar.gz models
190+ elif [[ " $MODEL_TYPE " == " python_3_12" ]]; then
191+ sed -i " s/\$\$ TRITON_MODEL_DIRECTORY\/python_3_12_environment/s3:\/\/triton-bucket-${CI_JOB_ID} \/python_3_12_environment/" models/python_3_12/config.pbtxt
192+ mv models/python_3_12/python_3_12_environment.tar.gz models
193+ fi
194+
192195 aws s3 cp models/ " ${BUCKET_URL_SLASH} " --recursive --include " *"
193196
194197 SERVER_ARGS=" --model-repository=$BUCKET_URL_SLASH --log-verbose=1"
@@ -205,14 +208,12 @@ aws_test() {
205208 wait $SERVER_PID
206209
207210 set +e
208- for EXPECTED_VERSION_STRING in " $PY36_VERSION_STRING " " $PY312_VERSION_STRING " ; do
209- grep " $EXPECTED_VERSION_STRING " $SERVER_LOG
210- if [ $? -ne 0 ]; then
211- cat $SERVER_LOG
212- echo -e " \n***\n*** $EXPECTED_VERSION_STRING was not found in Triton logs. \n***"
213- RET=1
214- fi
215- done
211+ grep " $EXPECTED_VERSION_STRING " $SERVER_LOG
212+ if [ $? -ne 0 ]; then
213+ cat $SERVER_LOG
214+ echo -e " \n***\n*** $EXPECTED_VERSION_STRING was not found in Triton logs. \n***"
215+ RET=1
216+ fi
216217 set -e
217218
218219 # Clean up bucket contents and delete bucket
@@ -240,6 +241,7 @@ PY37_VERSION_STRING="Python version is 3.7, NumPy version is 1.20.1, and Tensorf
240241create_python_backend_stub
241242conda-pack -o python3.7.tar.gz
242243path_to_conda_pack=` pwd` /python3.7.tar.gz
244+ rm -r models/ || true
243245mkdir -p models/python_3_7/1/
244246cp ../../python_models/python_version/config.pbtxt ./models/python_3_7
245247(cd models/python_3_7 && \
@@ -252,12 +254,6 @@ conda deactivate
252254if [[ " ${PROPERTIES} " =~ " locale" ]]; then
253255 locale_test $PY37_VERSION_STRING
254256fi
255- if [[ " ${PROPERTIES} " =~ " extraction" ]]; then
256- extraction_test
257- fi
258- if [[ " ${PROPERTIES} " =~ " aws" ]]; then
259- aws_test
260- fi
261257
262258
263259# Use python-3-7 without conda pack
@@ -273,6 +269,7 @@ conda install -c conda-forge libstdcxx-ng=14 -y
273269
274270PY37_1_VERSION_STRING=" Python version is 3.7, NumPy version is 1.20.3, and Tensorflow version is 2.1.0"
275271create_python_backend_stub
272+ rm -r models/ || true
276273mkdir -p models/python_3_7_1/1/
277274cp ../../python_models/python_version/config.pbtxt ./models/python_3_7_1
278275(cd models/python_3_7_1 && \
@@ -285,14 +282,11 @@ cp python_backend/builddir/triton_python_backend_stub ./models/python_3_7_1
285282conda deactivate
286283
287284if [[ " ${PROPERTIES} " =~ " locale" ]]; then
288- locale_test $PY37_1_VERSION_STRING
289- fi
290- if [[ " ${PROPERTIES} " =~ " extraction" ]]; then
291- extraction_test
292- fi
293- if [[ " ${PROPERTIES} " =~ " aws" ]]; then
294- aws_test
285+ locale_test " $PY37_1_VERSION_STRING "
295286fi
287+ # if [[ "${PROPERTIES}" =~ "aws" ]]; then
288+ # aws_test "$PY37_1_VERSION_STRING" "python_3_7_1"
289+ # fi
296290
297291# Create a model with python 3.6 version
298292# Tensorflow 2.1.0 only works with Python 3.4 - 3.7. Successful execution of
@@ -307,6 +301,7 @@ conda-pack -o python3.6.tar.gz
307301# Test relative execution env path
308302path_to_conda_pack=' $$TRITON_MODEL_DIRECTORY/python_3_6_environment.tar.gz'
309303create_python_backend_stub
304+ rm -r models/ || true
310305mkdir -p models/python_3_6/1/
311306cp ../../python_models/python_version/config.pbtxt ./models/python_3_6
312307cp python3.6.tar.gz models/python_3_6/python_3_6_environment.tar.gz
@@ -320,11 +315,8 @@ conda deactivate
320315if [[ " ${PROPERTIES} " =~ " locale" ]]; then
321316 locale_test $PY36_VERSION_STRING
322317fi
323- if [[ " ${PROPERTIES} " =~ " extraction" ]]; then
324- extraction_test
325- fi
326318if [[ " ${PROPERTIES} " =~ " aws" ]]; then
327- aws_test
319+ aws_test " $PY36_VERSION_STRING " " python_3_6 "
328320fi
329321
330322# Test conda env without custom Python backend stub This environment should
@@ -338,6 +330,7 @@ conda install numpy=1.26.4 -y
338330conda install tensorflow=2.16.2 -y
339331PY312_VERSION_STRING=" Python version is 3.12, NumPy version is 1.26.4, and Tensorflow version is 2.16.2"
340332conda pack -o python3.12.tar.gz
333+ rm -r models/ || true
341334mkdir -p models/python_3_12/1/
342335cp ../../python_models/python_version/config.pbtxt ./models/python_3_12
343336cp python3.12.tar.gz models/python_3_12/python_3_12_environment.tar.gz
@@ -352,10 +345,10 @@ if [[ "${PROPERTIES}" =~ "locale" ]]; then
352345 locale_test $PY312_VERSION_STRING
353346fi
354347if [[ " ${PROPERTIES} " =~ " extraction" ]]; then
355- extraction_test
348+ extraction_test
356349fi
357350if [[ " ${PROPERTIES} " =~ " aws" ]]; then
358- aws_test
351+ aws_test " $PY312_VERSION_STRING " " python_3_12 "
359352fi
360353
361354if [ $RET -eq 0 ]; then
0 commit comments