onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh
Ashwini Khade e32eff826c
enable nuget package testing on centos7 (#2527)
* add centos tests to linux cpu ci pipeline

* Disable failing test

* use centos6 instead of centos7

* change back to centos7

* add dotnet runtime dependency

* fix dotnet runtime dependencies

* install dotnet sdk instead of runtimes

* add more dotnet dependencies

* temporary skip failing test

* ix lib path

* reenable failing test
2019-12-03 10:16:45 -08:00

65 lines
2 KiB
Bash
Executable file

#!/bin/bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# build docker image for CPU
set -x
SOURCE_ROOT=$1
BUILD_DIR=$2
NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR
CurrentOnnxRuntimeVersion=$4
UseCentos7=${5:-false}
Arch=${6:-x64} # x32, x64
PackageName=${PACKAGENAME:-Microsoft.ML.OnnxRuntime}
RunTestCsharp=${RunTestCsharp:-true}
RunTestNative=${RunTestNative:-true}
PYTHON_VER=3.5
IMAGE="ubuntu16.04_$Arch"
OldDir=$(pwd)
cd $SOURCE_ROOT/tools/ci_build/github/linux/docker
if [ $UseCentos7 = "false" ]; then
echo "Image used for testing is onnxruntime-$IMAGE"
if [ $Arch = "x86" ]; then
docker build -t "onnxruntime-$IMAGE" --build-arg OS_VERSION=16.04 --build-arg PYTHON_VERSION=${PYTHON_VER} -f Dockerfile.ubuntu_x86 .
else
docker build -t "onnxruntime-$IMAGE" --build-arg OS_VERSION=16.04 --build-arg PYTHON_VERSION=${PYTHON_VER} -f Dockerfile.ubuntu .
fi
else
IMAGE="centos7"
PYTHON_VER=3.6
echo "Image used for testing is onnxruntime-$IMAGE"
docker build -t "onnxruntime-$IMAGE" --build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=${PYTHON_VER} -f Dockerfile.centos .
fi
docker rm -f "onnxruntime-cpu" || true
set +e
docker run -h $HOSTNAME \
--rm \
--name "onnxruntime-cpu" \
--volume "$SOURCE_ROOT:/onnxruntime_src" \
--volume "$BUILD_DIR:/home/onnxruntimedev" \
-e "OnnxRuntimeBuildDirectory=/home/onnxruntimedev" \
-e "IsReleaseBuild=$ISRELEASEBUILD" \
-e "PackageName=$PackageName" \
-e "DisableContribOps=$DISABLECONTRIBOPS" \
-e "RunTestCsharp=$RunTestCsharp" \
-e "RunTestNative=$RunTestNative" \
"onnxruntime-$IMAGE" \
/bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $CurrentOnnxRuntimeVersion &
wait -n
EXIT_CODE=$?
set -e
exit $EXIT_CODE
cd $OldDir