Skip to content

Commit

Permalink
fix reviewDog
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Jun 21, 2024
1 parent 8b53355 commit 30f426f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tools/ci_build/github/linux/run_dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ORTMODULE_BUILD=false
#Training only
USE_CONDA=false
ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV="ALLOW_RELEASED_ONNX_OPSET_ONLY="$ALLOW_RELEASED_ONNX_OPSET_ONLY
echo "ALLOW_RELEASED_ONNX_OPSET_ONLY environment variable is set as "$ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV
echo "ALLOW_RELEASED_ONNX_OPSET_ONLY environment variable is set as $ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV"

while getopts o:d:p:x:v:y:t:i:mue parameter_Option
do case "${parameter_Option}"
Expand Down Expand Up @@ -48,9 +48,11 @@ m) INSTALL_DEPS_DISTRIBUTED_SETUP=true;;
u) ORTMODULE_BUILD=true;;
# install and use conda
e) USE_CONDA=true;;
*) echo "Invalid option";;
esac
done

# shellcheck disable=SC2034
EXIT_CODE=1
DEFAULT_PYTHON_VER="3.8"

Expand All @@ -69,19 +71,19 @@ if [[ $BUILD_OS == ubuntu* ]]; then
fi

NEED_BUILD_SHARED_LIB=true
cd $SCRIPT_DIR/docker
if [ $BUILD_OS = "yocto" ]; then
cd "$SCRIPT_DIR"/docker
if [ "$BUILD_OS" = "yocto" ]; then
IMAGE="arm-yocto-$YOCTO_VERSION"
DOCKER_FILE=Dockerfile.ubuntu_for_arm
# ACL 19.05 need yocto 4.19
TOOL_CHAIN_SCRIPT=fsl-imx-xwayland-glibc-x86_64-fsl-image-qt5-aarch64-toolchain-4.19-warrior.sh
if [ $YOCTO_VERSION = "4.14" ]; then
if [ "$YOCTO_VERSION" = "4.14" ]; then
TOOL_CHAIN_SCRIPT=fsl-imx-xwayland-glibc-x86_64-fsl-image-qt5-aarch64-toolchain-4.14-sumo.sh
fi
$GET_DOCKER_IMAGE_CMD --repository "onnxruntime-$IMAGE" \
--docker-build-args="--build-arg TOOL_CHAIN=$TOOL_CHAIN_SCRIPT --build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=${PYTHON_VER}" \
--dockerfile $DOCKER_FILE --context .
elif [ $BUILD_DEVICE = "gpu" ]; then
elif [ "$BUILD_DEVICE" = "gpu" ]; then
# This code path is only for training. Inferecing pipeline uses CentOS
IMAGE="$BUILD_OS-gpu_training"
# Current build script doesn't support building shared lib with Python dependency. To enable building with PythonOp,
Expand Down Expand Up @@ -122,10 +124,11 @@ set +e
mkdir -p ~/.onnx

if [ -z "$NIGHTLY_BUILD" ]; then
# shellcheck disable=SC2121
set NIGHTLY_BUILD=0
fi

if [ $BUILD_DEVICE = "cpu" ] || [ $BUILD_DEVICE = "openvino" ] || [ $BUILD_DEVICE = "arm" ]; then
if [ "$BUILD_DEVICE" = "cpu" ] || [ "$BUILD_DEVICE" = "openvino" ] || [ "$BUILD_DEVICE" = "arm" ]; then
RUNTIME=
else
RUNTIME="--gpus all"
Expand All @@ -137,13 +140,13 @@ DOCKER_RUN_PARAMETER="--volume $SOURCE_ROOT:/onnxruntime_src \
--volume /data/onnx:/data/onnx:ro \
--volume $HOME/.cache/onnxruntime:/home/onnxruntimedev/.cache/onnxruntime \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx"
if [ $BUILD_DEVICE = "openvino" ] && [[ $BUILD_EXTR_PAR == *"--use_openvino GPU_FP"* ]]; then
if [ "$BUILD_DEVICE" = "openvino" ] && [[ $BUILD_EXTR_PAR == *"--use_openvino GPU_FP"* ]]; then
DOCKER_RUN_PARAMETER="$DOCKER_RUN_PARAMETER --device /dev/dri:/dev/dri"
fi
# Though this command has a yocto version argument, none of our ci build pipelines use yocto.
$DOCKER_CMD run $RUNTIME --rm $DOCKER_RUN_PARAMETER \
$DOCKER_CMD run "$RUNTIME" --rm "$DOCKER_RUN_PARAMETER" \
-e NIGHTLY_BUILD \
-e $ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV \
-e "$ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV" \
"onnxruntime-$IMAGE" \
/bin/bash /onnxruntime_src/tools/ci_build/github/linux/run_build.sh \
-d $BUILD_DEVICE -x "$BUILD_EXTR_PAR" -o $BUILD_OS -y $YOCTO_VERSION
-d "$BUILD_DEVICE" -x "$BUILD_EXTR_PAR" -o "$BUILD_OS" -y "$YOCTO_VERSION"

0 comments on commit 30f426f

Please sign in to comment.