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
This commit is contained in:
Ashwini Khade 2019-12-03 10:16:45 -08:00 committed by GitHub
parent 85a4ed8cf7
commit e32eff826c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 6 deletions

View file

@ -10,7 +10,8 @@ SOURCE_ROOT=$1
BUILD_DIR=$2
NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR
CurrentOnnxRuntimeVersion=$4
Arch=${5:-x64} # x32, x64
UseCentos7=${5:-false}
Arch=${6:-x64} # x32, x64
PackageName=${PACKAGENAME:-Microsoft.ML.OnnxRuntime}
RunTestCsharp=${RunTestCsharp:-true}
RunTestNative=${RunTestNative:-true}
@ -20,10 +21,20 @@ IMAGE="ubuntu16.04_$Arch"
OldDir=$(pwd)
cd $SOURCE_ROOT/tools/ci_build/github/linux/docker
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 .
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
docker build -t "onnxruntime-$IMAGE" --build-arg OS_VERSION=16.04 --build-arg PYTHON_VERSION=${PYTHON_VER} -f Dockerfile.ubuntu .
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

View file

@ -594,7 +594,19 @@ namespace Microsoft.ML.OnnxRuntime.Tests
libName = "libcustom_op_library.dylib";
}
option.RegisterCustomOpLibrary(libName);
string libFullPath = Path.Combine(Directory.GetCurrentDirectory(), libName);
Assert.True(File.Exists(libFullPath), $"Expected lib {libFullPath} does not exist.");
try
{
option.RegisterCustomOpLibrary(libFullPath);
}
catch(Exception ex)
{
var msg = $"Failed to load custom op library {libFullPath}, error = {ex.Message}";
throw new Exception(msg + "\n" + ex.StackTrace);
}
using (var session = new InferenceSession(modelPath, option))
{

View file

@ -34,11 +34,19 @@ jobs:
parameters:
packageFolder: '$(Build.BinariesDirectory)/nuget-artifact'
- ${{ if eq(parameters['TestGPU'], 'false') }}:
- script: |
set -e -x
$(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh $(Build.SourcesDirectory) $(Build.BinariesDirectory) nuget-artifact $(NuGetPackageVersionNumber) true
displayName: 'Run Package Test (x64) on CentOS7'
env:
OnnxRuntimeBuildDirectory: $(Build.BinariesDirectory)
- ${{ if eq(parameters['TestGPU'], 'false') }}:
- script: |
set -e -x
$(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh $(Build.SourcesDirectory) $(Build.BinariesDirectory) nuget-artifact $(NuGetPackageVersionNumber)
displayName: 'Run Package Test (x64)'
displayName: 'Run Package Test (x64) on Ubuntu'
env:
OnnxRuntimeBuildDirectory: $(Build.BinariesDirectory)

View file

@ -21,6 +21,12 @@ elif [ "$os_major_version" == "6" ] && [ ! -d "/opt/python/cp35-cp35m" ]; then
/usr/bin/python3.6 -m pip install --upgrade pip
else
yum install -y redhat-lsb-core expat-devel libcurl-devel tar unzip curl zlib-devel make libunwind icu aria2 rsync bzip2 git bzip2-devel
# install dotnet core dependencies
yum install -y lttng-ust openssl-libs krb5-libs libicu libuuid
# install dotnet runtimes
yum install -y https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
yum install -y dotnet-sdk-2.2
fi