Skip to content

Commit

Permalink
update build_linux_python_package.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Nov 8, 2023
1 parent 8af7f20 commit 4d48c20
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
inputs:
targetType: filePath
filePath: tools/ci_build/github/linux/run_python_dockerbuild.sh
# please check ONNXRUNTIME_CUDA_VERSION in tools/ci_build/github/linux/build_linux_arm64_python_package.sh
arguments: -i onnxruntimecuda118xtrt86build${{ parameters.arch }} -d "GPU" -c ${{ parameters.cmake_build_type }} -x "${{ parameters.extra_build_arg }}"
# please check ONNXRUNTIME_CUDA_VERSION in tools/ci_build/github/linux/build_linux_python_package.sh
arguments: -i onnxruntimecuda118xtrt86build${{ parameters.arch }} -d "GPU" -c ${{ parameters.cmake_build_type }} -x "${{ parameters.extra_build_arg }} -u "12.2"

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ jobs:
inputs:
targetType: filePath
filePath: tools/ci_build/github/linux/run_python_dockerbuild.sh
# please check ONNXRUNTIME_CUDA_VERSION in tools/ci_build/github/linux/build_linux_arm64_python_package.sh
arguments: -i onnxruntimecuda118xtrt86build${{ parameters.arch }} -d "GPU" -c ${{ parameters.cmake_build_type }} -x "${{ parameters.extra_build_arg }}"
# please check ONNXRUNTIME_CUDA_VERSION in tools/ci_build/github/linux/build_linux_python_package.sh
arguments: -i onnxruntimecuda118xtrt86build${{ parameters.arch }} -d "GPU" -c ${{ parameters.cmake_build_type }} -x "${{ parameters.extra_build_arg } -u "12.2"

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EXTRA_ARG=""
# Put 3.8 at the last because Ubuntu 20.04 use python 3.8 and we will upload the intermediate build files of this
# config to Azure DevOps Artifacts and download them to a Ubuntu 20.04 machine to run the tests.
PYTHON_EXES=("/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp38-cp38/bin/python3.8")
while getopts "d:p:x:c:" parameter_Option
while getopts "d:p:x:c:u:" parameter_Option
do case "${parameter_Option}"
in
#GPU or CPU.
Expand Down Expand Up @@ -59,10 +59,9 @@ if [ "$ARCH" == "x86_64" ]; then
BUILD_ARGS+=("--enable_onnx_tests")
fi

if [ "$BUILD_DEVICE" == "GPU" ]; then
if [ "$BUILD_DEVICE" == "GPU" ] && [ "$CUDA_VERSION" != ""]; then

Check notice on line 62 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L62 <ShellCheck.SC1009>

The mentioned syntax error was in this if expression.
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:62:1: info: The mentioned syntax error was in this if expression. (ShellCheck.SC1009)

Check failure on line 62 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L62 <ShellCheck.SC1073>

Couldn't parse this test expression. Fix to allow more checks.
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:62:36: error: Couldn't parse this test expression. Fix to allow more checks. (ShellCheck.SC1073)

Check failure on line 62 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L62 <ShellCheck.SC1020>

You need a space before the ].
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:62:60: error: You need a space before the ]. (ShellCheck.SC1020)

Check failure on line 62 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L62 <ShellCheck.SC1072>

Missing space before ]. Fix any mentioned problems and try again.
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:62:60: error: Missing space before ]. Fix any mentioned problems and try again. (ShellCheck.SC1072)
#Enable CUDA and TRT EPs.
ONNXRUNTIME_CUDA_VERSION="11.8"
BUILD_ARGS+=("--nvcc_threads=1" "--use_cuda" "--use_tensorrt" "--cuda_version=$ONNXRUNTIME_CUDA_VERSION" "--tensorrt_home=/usr" "--cuda_home=/usr/local/cuda-$ONNXRUNTIME_CUDA_VERSION" "--cudnn_home=/usr/local/cuda-$ONNXRUNTIME_CUDA_VERSION" "--cmake_extra_defines" "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80")
BUILD_ARGS+=("--nvcc_threads=1" "--use_cuda" "--use_tensorrt" "--cuda_version=$CUDA_VERSION" "--tensorrt_home=/usr" "--cuda_home=/usr/local/cuda-$CUDA_VERSION" "--cudnn_home=/usr/local/cuda-$CUDA_VERSION" "--cmake_extra_defines" "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80")
fi

export CFLAGS
Expand Down
78 changes: 0 additions & 78 deletions tools/ci_build/github/linux/build_linux_python_package_cuda12.sh

This file was deleted.

5 changes: 3 additions & 2 deletions tools/ci_build/github/linux/run_python_dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
set -e -x
BUILD_CONFIG="Release"

while getopts "i:d:x:c:" parameter_Option
while getopts "i:d:x:c:u:" parameter_Option
do case "${parameter_Option}"

Check warning on line 6 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L6 <ShellCheck.SC2220>

Invalid flags are not handled. Add a *) case.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:6:4: warning: Invalid flags are not handled. Add a *) case. (ShellCheck.SC2220)
in
i) DOCKER_IMAGE=${OPTARG};;
d) DEVICE=${OPTARG};;
x) BUILD_EXTR_PAR=${OPTARG};;
c) BUILD_CONFIG=${OPTARG};;
u) CUDA_VERSION=${OPTARG};;
esac
done

Expand All @@ -23,7 +24,7 @@ docker run --rm \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
$ADDITIONAL_DOCKER_PARAMETER \

Check notice on line 26 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L26 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:26:5: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
$DOCKER_IMAGE tools/ci_build/github/linux/build_linux_python_package_cuda12.sh -d $DEVICE -c $BUILD_CONFIG -x $BUILD_EXTR_PAR
$DOCKER_IMAGE tools/ci_build/github/linux/build_linux_arm64_python_package.sh -d $DEVICE -c $BUILD_CONFIG -x $BUILD_EXTR_PAR -u $CUDA_VERSION

Check notice on line 27 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L27 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:27:5: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 27 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L27 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:27:86: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 27 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L27 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:27:97: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 27 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L27 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:27:114: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 27 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L27 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:27:133: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

sudo rm -rf $BUILD_BINARIESDIRECTORY/$BUILD_CONFIG/onnxruntime $BUILD_BINARIESDIRECTORY/$BUILD_CONFIG/pybind11 \

Check notice on line 29 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L29 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:29:13: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 29 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L29 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:29:38: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 29 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L29 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:29:64: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 29 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L29 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:29:89: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
$BUILD_BINARIESDIRECTORY/$BUILD_CONFIG/models $BUILD_BINARIESDIRECTORY/$BUILD_CONFIG/_deps \

Check notice on line 30 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L30 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:30:5: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 30 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L30 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:30:30: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 30 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L30 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:30:51: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 30 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/run_python_dockerbuild.sh#L30 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/run_python_dockerbuild.sh:30:76: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
Expand Down

0 comments on commit 4d48c20

Please sign in to comment.