diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh index fc0ea19ea5..ab537c300f 100755 --- a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh +++ b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh @@ -9,7 +9,9 @@ set -x SOURCE_ROOT=$1 BUILD_DIR=$2 NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR -PackageName=${PackageName:-Microsoft.ML.OnnxRuntime} +PackageName=${PACKAGENAME:-Microsoft.ML.OnnxRuntime.Gpu} +RunTestCsharp=${RunTestCsharp:-true} +RunTestNative=${RunTestNative:-true} #CUDA_VER=cuda10.0-cudnn7.3, cuda9.1-cudnn7.1, cuda10.0-cudnn7.3 CUDA_VER=${4:-cuda10.0-cudnn7.3} @@ -21,7 +23,7 @@ cd $SOURCE_ROOT/tools/ci_build/github/linux/docker DOCKER_FILE=Dockerfile.ubuntu_gpu_cuda9 if [ $CUDA_VER = "cuda10.0-cudnn7.3" ]; then -DOCKER_FILE=Dockerfile.ubuntu_gpu_cuda +DOCKER_FILE=Dockerfile.ubuntu_gpu fi docker build -t "onnxruntime-$IMAGE" --build-arg OS_VERSION=16.04 --build-arg PYTHON_VERSION=${PYTHON_VER} -f $DOCKER_FILE . @@ -37,10 +39,12 @@ docker run -h $HOSTNAME \ --volume "$BUILD_DIR:/home/onnxruntimedev" \ --volume "$HOME/.cache/onnxruntime:/home/onnxruntimedev/.cache/onnxruntime" \ -e "OnnxRuntimeBuildDirectory=/home/onnxruntimedev" \ - -e "IsReleaseBuild=$IsReleaseBuild" \ + -e "IsReleaseBuild=$ISRELEASEBUILD" \ -e "PackageName=$PackageName" \ + -e "RunTestCsharp=$RunTestCsharp" \ + -e "RunTestNative=$RunTestNative" \ "onnxruntime-$IMAGE" \ - /bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-gpu.sh \ + /bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \ /home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev & wait -n diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh index dd6bd136cd..a17f5b5db5 100755 --- a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh +++ b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh @@ -10,7 +10,7 @@ SOURCE_ROOT=$1 BUILD_DIR=$2 NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR Arch=${4:-x64} # x32, x64 -PackageName=${PackageName:-Microsoft.ML.OnnxRuntime} +PackageName=${PACKAGENAME:-Microsoft.ML.OnnxRuntime} RunTestCsharp=${RunTestCsharp:-true} RunTestNative=${RunTestNative:-true} PYTHON_VER=3.5 @@ -36,7 +36,7 @@ docker run -h $HOSTNAME \ --volume "$BUILD_DIR:/home/onnxruntimedev" \ --volume "$HOME/.cache/onnxruntime:/home/onnxruntimedev/.cache/onnxruntime" \ -e "OnnxRuntimeBuildDirectory=/home/onnxruntimedev" \ - -e "IsReleaseBuild=$IsReleaseBuild" \ + -e "IsReleaseBuild=$ISRELEASEBUILD" \ -e "PackageName=$PackageName" \ -e "DisableContribOps=$DISABLECONTRIBOPS" \ -e "RunTestCsharp=$RunTestCsharp" \ diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml index e7012bc1e4..66b2ec14b0 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/gpu.yml @@ -107,3 +107,4 @@ jobs: - template: test_linux.yml parameters: AgentPool : $(AgentPoolLinux) + TestGPU : 'true' diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml index 1eabf3fdf8..2cb8763745 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml @@ -1,5 +1,6 @@ parameters: AgentPool: 'Linux-CPU' + TestGPU: 'false' jobs: - job: NuGet_Test_Linux @@ -18,12 +19,21 @@ jobs: artifactName: 'drop-signed-nuget' targetPath: '$(Build.BinariesDirectory)/nuget-artifact' - - script: | - set -e -x - $(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh $(Build.SourcesDirectory) $(Build.BinariesDirectory) nuget-artifact - displayName: 'Run Package Test (x64)' - 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 + displayName: 'Run Package Test (x64)' + env: + OnnxRuntimeBuildDirectory: $(Build.BinariesDirectory) + + - ${{ if eq(parameters['TestGPU'], 'true') }}: + - script: | + set -e -x + $(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh $(Build.SourcesDirectory) $(Build.BinariesDirectory) nuget-artifact + displayName: 'Run Package Test GPU (x64)' + env: + OnnxRuntimeBuildDirectory: $(Build.BinariesDirectory) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Detection'