Skip to content

Commit 907253f

Browse files
committed
Add fallback on previous version
1 parent ae70831 commit 907253f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

qa/common/gen_qa_model_repository

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,18 @@ chmod -R 777 $TRITON_MDLS_QA_TRT_DATA_DEPENDENT_MODEL
344344
if [ -d "/usr/src/tensorrt/samples/python/onnx_custom_plugin" ]; then
345345
cd /usr/src/tensorrt/samples/python/onnx_custom_plugin
346346
else
347-
git clone -b release/\$( echo \$TRT_VERSION | cut -d . -f -2) --depth 1 https://github.com/NVIDIA/TensorRT.git /workspace/TensorRT
347+
TRT_BRANCH=\$(echo \$TRT_VERSION | cut -d . -f -2)
348+
if ! git clone -b release/\${TRT_BRANCH} --depth 1 https://github.com/NVIDIA/TensorRT.git /workspace/TensorRT; then
349+
MAJOR=\$(echo "\$TRT_BRANCH" | cut -d . -f 1)
350+
MINOR=\$(echo "\$TRT_BRANCH" | cut -d . -f 2)
351+
if [ -n "\$MINOR" ] && [ "\$MINOR" -gt 0 ] 2>/dev/null; then
352+
TRT_BRANCH="\${MAJOR}.\$((MINOR - 1))"
353+
echo "Fallback: cloning TensorRT release/\${TRT_BRANCH} (previous minor)"
354+
git clone -b release/\${TRT_BRANCH} --depth 1 https://github.com/NVIDIA/TensorRT.git /workspace/TensorRT
355+
else
356+
exit 1
357+
fi
358+
fi
348359
cd /workspace/TensorRT/samples/python/onnx_custom_plugin
349360
fi
350361
rm -rf build && mkdir build && \

0 commit comments

Comments
 (0)