Fix Linux python CUDA package pipeline (#22803)

### Description
Making ::p optional in the Linux python CUDA package pipeline



### Motivation and Context
Linux stage from Python-CUDA-Packaging-Pipeline has failed since merge
of #22773
This commit is contained in:
Jian Chen 2024-11-13 17:20:21 -05:00 committed by GitHub
parent 6d7603f054
commit f423b737a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,13 +9,27 @@ EXTRA_ARG=""
ENABLE_CACHE=false
# Put 3.10 at the last because Ubuntu 22.04 use python 3.10 and we will upload the intermediate build files of this
# config to Azure DevOps Artifacts and download them to a Ubuntu 22.04 machine to run the tests.
PYTHON_EXES=("/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp312-cp312/bin/python3.12" "/opt/python/cp313-cp313/bin/python3.13" "/opt/python/cp313-cp313t/bin/python3.13t" "/opt/python/cp310-cp310/bin/python3.10")
PYTHON_EXES=(
"/opt/python/cp311-cp311/bin/python3.11"
"/opt/python/cp312-cp312/bin/python3.12"
"/opt/python/cp313-cp313/bin/python3.13"
"/opt/python/cp313-cp313t/bin/python3.13t"
"/opt/python/cp310-cp310/bin/python3.10"
)
while getopts "d:p:x:c:e" parameter_Option
do case "${parameter_Option}"
in
#GPU|CPU|NPU.
d) BUILD_DEVICE=${OPTARG};;
p) PYTHON_EXES=("${OPTARG}");;
p)
# Check if OPTARG is empty or starts with a hyphen, indicating a missing or invalid argument for -p
if [[ -z "${OPTARG}" || "${OPTARG}" == -* ]]; then
echo "ERROR: Option -p requires a valid argument, not another option."
exit 1
else
PYTHON_EXES=("${OPTARG}") # Use the provided argument for -p
fi
;;
x) EXTRA_ARG=${OPTARG};;
c) BUILD_CONFIG=${OPTARG};;
e) ENABLE_CACHE=true;;