Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fc4f6f9
upgraded test and sample projects to netcoreapp2.1
shahasad Sep 18, 2019
db34321
Merge branch 'master' of https://github.com/Microsoft/onnxruntime int…
shahasad Sep 18, 2019
0625d41
reverted fc4f6f9d717b45d862e80217eda30b63fa9d5f02
shahasad Sep 18, 2019
b34b04c
modified the nuget package versioning scheme to conform with semver 2…
shahasad Sep 18, 2019
6b709f7
Merge branch 'master' of https://github.com/Microsoft/onnxruntime int…
shahasad Sep 18, 2019
46e8037
fix typo in yml
shahasad Sep 18, 2019
b19fa35
fix formatting/indentation in the yml
shahasad Sep 18, 2019
f185248
fix formatting in yml
shahasad Sep 18, 2019
c940f0f
fix formatting in yml
shahasad Sep 18, 2019
ac81ddf
fix working dir in yml
shahasad Sep 18, 2019
ad63ca1
use semver 1.0
shahasad Sep 18, 2019
f446201
some cleanup
shahasad Sep 19, 2019
85afcd7
some fixes in the batch scripts
shahasad Sep 20, 2019
1f77a82
Merge branch 'master' of https://github.com/Microsoft/onnxruntime int…
shahasad Sep 20, 2019
b44bcf5
some fixes on the scripts regarding the version variable
shahasad Sep 20, 2019
acde40a
Merge branch 'master' of https://github.com/Microsoft/onnxruntime int…
shahasad Sep 27, 2019
2fec7cc
fix download test data in test_win.yml
shahasad Sep 28, 2019
b298f01
fix download test data in test_win.yml
shahasad Sep 28, 2019
fc0e3fc
fix in windows version number setup
shahasad Sep 28, 2019
30d86ba
try again, added some log
shahasad Sep 28, 2019
4c1ac51
add dir and pwd in the log, modified path name to use backslash inste…
shahasad Sep 28, 2019
7c3f3f0
add more log
shahasad Sep 28, 2019
c13063e
use ! instead of % in variables
shahasad Sep 29, 2019
6f93004
cleaned up debug logs. temporarily removed the master condition for t…
shahasad Sep 29, 2019
5136eee
use UtcNow
shahasad Sep 29, 2019
62c3df9
add back master condition for publish
shahasad Sep 29, 2019
69dc398
Merge branch 'master' of https://github.com/Microsoft/onnxruntime int…
shahasad Sep 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,17 @@
</Exec>

<PropertyGroup>
<CurrentDate>$([System.DateTime]::UtcNow.ToString(yyyyMMdd))</CurrentDate>
<CurrentTime>$([System.DateTime]::UtcNow.ToString(hhmm))</CurrentTime>
<PackageVersion>@(MajorVersionNumber)</PackageVersion>
<Version>$(PackageVersion)</Version>
<PackageVersion Condition="'$(IsReleaseBuild)'!='true'">$(PackageVersion)-dev-$(GitCommitHashShort)</PackageVersion>
<PackageVersion Condition="'$(IsReleaseBuild)'!='true'">$(PackageVersion)-dev-$(CurrentDate)-$(CurrentTime)-$(GitCommitHashShort)</PackageVersion>
Comment thread
shahasad marked this conversation as resolved.
</PropertyGroup>
<Message Importance="High" Text="PackageVersion=$(PackageVersion)" />
<Copy SourceFiles="@(LicenseFile)" DestinationFiles="@(LicenseFile->'$(OnnxRuntimeCsharpRoot)\..\%(Filename).txt')"/>
<Copy SourceFiles="@(PropertiesFile)" DestinationFiles="@(PropertiesFile->'$(OnnxRuntimeCsharpRoot)\src\\Microsoft.ML.OnnxRuntime\$(PackageId).props')"/>
<Copy SourceFiles="@(TargetsFile)" DestinationFiles="@(TargetsFile->'$(OnnxRuntimeCsharpRoot)\src\\Microsoft.ML.OnnxRuntime\$(PackageId).targets')"/>

</Target>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@ REM Licensed under the MIT License.
echo on

set LocalNuGetRepo=%1
SET CurrentOnnxRuntimeVersion=%2
setlocal enableextensions disabledelayedexpansion

REM WorkingDirectory is Build.SourcesDirectory\csharp
set /p MajorVersionNumber=<..\VERSION_NUMBER
set VersionSuffix=
IF NOT DEFINED IsReleaseBuild (
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO (
set VersionSuffix=-dev-%%F
)
)

set CurrentOnnxRuntimeVersion=%MajorVersionNumber%%VersionSuffix%

@echo %CurrentOnnxRuntimeVersion%

pushd test\Microsoft.ML.OnnxRuntime.EndToEndTests.Capi
Comment thread
shahasad marked this conversation as resolved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@ ECHO on
SET LocalNuGetRepo=%1
SET TargetArch=x64
IF NOT "%2"=="" (SET TargetArch=%2)
SET CurrentOnnxRuntimeVersion=%3

SETLOCAL enableextensions disabledelayedexpansion

REM WorkingDirectory is Build.SourcesDirectory\csharp
SET /p MajorVersionNumber=<..\VERSION_NUMBER
SET VersionSuffix=
IF NOT DEFINED IsReleaseBuild (
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO (
SET VersionSuffix=-dev-%%F
)
)

SET CurrentOnnxRuntimeVersion=%MajorVersionNumber%%VersionSuffix%
@ECHO %CurrentOnnxRuntimeVersion%

PUSHD test\Microsoft.ML.OnnxRuntime.EndToEndTests.Capi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -x
SOURCE_ROOT=$1
BUILD_DIR=$2
NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR
CurrentOnnxRuntimeVersion=$4
PackageName=${PACKAGENAME:-Microsoft.ML.OnnxRuntime.Gpu}
RunTestCsharp=${RunTestCsharp:-true}
RunTestNative=${RunTestNative:-true}
Expand Down Expand Up @@ -45,7 +46,7 @@ docker run -h $HOSTNAME \
-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 &
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $CurrentOnnxRuntimeVersion &

wait -n

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ set -x
SOURCE_ROOT=$1
BUILD_DIR=$2
NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR
Arch=${4:-x64} # x32, x64
CurrentOnnxRuntimeVersion=$4
Arch=${5:-x64} # x32, x64
PackageName=${PACKAGENAME:-Microsoft.ML.OnnxRuntime}
RunTestCsharp=${RunTestCsharp:-true}
RunTestNative=${RunTestNative:-true}
Expand Down Expand Up @@ -43,7 +44,7 @@ docker run -h $HOSTNAME \
-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 &
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $CurrentOnnxRuntimeVersion &

wait -n

Expand Down
15 changes: 5 additions & 10 deletions csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ SET dn="C:\Program Files\dotnet\dotnet"
SET LocalNuGetRepo=%1
IF NOT "%2"=="" (SET TargetFramework=%2)
IF NOT "%3"=="" (SET TargetArch=%3)
IF NOT "%4"=="" (
SET CurrentOnnxRuntimeVersion=%4
) ELSE (
echo "Usage: runtest.bat LocalNuGetRepoPath TargetFramework TargetArch NuGetPackageVersion"
)

IF "%TargetArch%"=="x86" (
SET dn="C:\Program Files (x86)\dotnet\dotnet"
Expand All @@ -19,16 +24,6 @@ IF "%TargetArch%"=="x86" (
)

ECHO Target Framework is %TargetFramework%
REM WorkingDirectory is Build.SourcesDirectory\csharp
SET /p MajorVersionNumber=<..\VERSION_NUMBER
SET VersionSuffix=
IF NOT DEFINED IsReleaseBuild (
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO (
set VersionSuffix=-dev-%%F
)
)

SET CurrentOnnxRuntimeVersion=%MajorVersionNumber%%VersionSuffix%

REM Update if CUDA lib paths if set
SET PATH=%CUDA_PATH%\bin;%CUDNN_PATH%\bin;%PATH%
Expand Down
18 changes: 1 addition & 17 deletions csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@
LocalNuGetRepo=$1
SourceRoot=$2
BuildDir=$3
#TestDataUrl=$4
#TestDataChecksum=$5

#TestDataUrl and TestDataChecksum comes from the build env variable

#echo "Downloading test data"
#python3 $SourceRoot/tools/ci_build/build.py --update --download_test_data --build_dir $BuildDir --test_data_url $TestDataUrl --test_data_checksum $TestDataChecksum
#if [ $? -ne 0 ]; then
# echo "Failed to download test data"
# exit 1
#fi
export CurrentOnnxRuntimeVersion=$4
set -x

OldDir=`pwd`
cd $SourceRoot

MajorVersion=$(cat $SourceRoot/VERSION_NUMBER)
VersionSuffix=
if [ "$IsReleaseBuild" != "true" ]; then
VersionSuffix=-dev-$(git rev-parse --short=8 HEAD)
fi
export CurrentOnnxRuntimeVersion=$MajorVersion$VersionSuffix
echo "Current NuGet package version is $CurrentOnnxRuntimeVersion"

if [ $RunTestCsharp = "true" ]; then
Expand Down
9 changes: 6 additions & 3 deletions tools/ci_build/github/azure-pipelines/nuget/templates/cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ jobs:
artifactName: 'drop-signed-nuget'
targetPath: '$(Build.ArtifactStagingDirectory)'


- template: test_all_os.yml

- job: Publish_NuGet_Package_And_Report
Expand All @@ -148,11 +147,15 @@ jobs:
steps:

- template: ../../templates/set-version-number-variables-step.yml

- template: upload-binary-sizes-from-nuget-package.yml
parameters:
downloadPath: $(Build.BinariesDirectory)/nuget-artifact/final-package
gitCommitHash: $(OnnxRuntimeGitCommitHashShort)

- template: get-nuget-package-version-as-variable.yml
parameters:
packageFolder: '$(Build.BinariesDirectory)/nuget-artifact/final-package'

- task: PowerShell@2
displayName: 'Get Current Date'
Expand All @@ -166,7 +169,7 @@ jobs:
displayName: 'Copy Signed NuGet Package to Blob Store'
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
inputs:
sourcePath: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.$(OnnxRuntimeVersion)-dev-$(OnnxRuntimeGitCommitHashShort).nupkg'
sourcePath: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.$(NuGetPackageVersionNumber).nupkg'
azureSubscription: 'AIInfraBuildOnnxRuntimeOSS'
destination: azureBlob
storage: ortpackages
Expand All @@ -178,5 +181,5 @@ jobs:
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
inputs:
command: 'push'
searchPatternPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.$(OnnxRuntimeVersion)-dev-$(OnnxRuntimeGitCommitHashShort).nupkg'
searchPatternPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.$(NuGetPackageVersionNumber).nupkg'
feedPublish: 'OnnxRuntime'
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
parameters:
packageFolder: $(Build.ArtifactStagingDirectory)

steps:
- task: CmdLine@2
condition: eq(variables['Agent.OS'], 'Windows_NT')
displayName: 'Extract version number from the NuPkg file, Windows VMs'
inputs:
workingDirectory: '${{ parameters.packageFolder }}'
script: |
SETLOCAL EnableDelayedExpansion
FOR /R %%i IN (Microsoft.ML.OnnxRuntime*.nupkg) do (
set filename=%%~ni
set ortversion=!filename:~25!
@echo ortversion is !ortversion!
@echo ##vso[task.setvariable variable=NuGetPackageVersionNumber;]!ortversion!
)

- task: CmdLine@2
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
displayName: 'Extract version number from the NuPkg file, Unix VMs'
inputs:
workingDirectory: '${{ parameters.packageFolder }}'
script: |
filenamewithext=$(ls Microsoft.ML.OnnxRuntime*.nupkg)
filename=${filenamewithext%.*}
ortversion=${filename:25}
echo "##vso[task.setvariable variable=NuGetPackageVersionNumber;]$ortversion"
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ jobs:
artifactName: 'drop-signed-nuget'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'

- template: get-nuget-package-version-as-variable.yml
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
$(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh $(Build.SourcesDirectory) $(Build.BinariesDirectory) nuget-artifact $(NuGetPackageVersionNumber)
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
$(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker-gpu.sh $(Build.SourcesDirectory) $(Build.BinariesDirectory) nuget-artifact $(NuGetPackageVersionNumber)
displayName: 'Run Package Test GPU (x64)'
env:
OnnxRuntimeBuildDirectory: $(Build.BinariesDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ jobs:
artifactName: 'drop-signed-nuget'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'

- template: get-nuget-package-version-as-variable.yml
parameters:
packageFolder: '$(Build.BinariesDirectory)/nuget-artifact'

- script: |
$(Build.SourcesDirectory)/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \
$(Build.BinariesDirectory)/nuget-artifact \
$(Build.SourcesDirectory) \
$(Build.BinariesDirectory)
$(Build.BinariesDirectory) \
$(NuGetPackageVersionNumber)

if [ $? -ne 0 ]; then
echo "Failed to run test"
Expand Down
22 changes: 13 additions & 9 deletions tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,51 @@ jobs:
displayName: 'Download Pipeline Artifact'
inputs:
artifactName: 'drop-signed-nuget'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
targetPath: '$(Build.BinariesDirectory)\nuget-artifact'

- template: get-nuget-package-version-as-variable.yml
parameters:
packageFolder: '$(Build.BinariesDirectory)\nuget-artifact'

- script: |
@echo "Running build.py --update"
$(Build.BinariesDirectory)\packages\python\python.exe $(Build.SourcesDirectory)\tools\ci_build\build.py --build_dir $(Build.BinariesDirectory) --config Debug --cmake_path $(Build.BinariesDirectory)\cmake\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake\bin\ctest.exe --update --download_test_data --test_data_url=$(TestDataUrl) --test_data_checksum=$(TestDataChecksum)
@echo "Running download_test_data.py"
$(Build.BinariesDirectory)\packages\python\python.exe $(Build.SourcesDirectory)\tools\ci_build\github\download_test_data.py --test_data_url $(TestDataUrl) --build_dir $(Build.BinariesDirectory)

displayName: 'Download Test Data'

- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact netcoreapp2.1 x64 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .Net Core'
continueOnError: true

- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact netcoreapp2.1 x86
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact netcoreapp2.1 x86 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .Net Core x86'
enabled: false
continueOnError: true

- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net461
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net461 x64 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .NetFramework'
continueOnError: true

- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net461 x86
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net461 x86 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .NetFramework x86'
enabled: false
continueOnError: true

- script: |
@echo "Running runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests.Capi\runtest.bat $(Build.BinariesDirectory)\nuget-artifact
test\Microsoft.ML.OnnxRuntime.EndToEndTests.Capi\runtest.bat $(Build.BinariesDirectory)\nuget-artifact x64 $(NuGetPackageVersionNumber)
REM Need an ErrorLevel check, since the script uses Exit /B
IF NOT %ERRORLEVEL% EQU 0 {
EXIT 1
Expand All @@ -77,7 +81,7 @@ jobs:

- script: |
@echo "Running runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests.Capi\runtest.bat $(Build.BinariesDirectory)\nuget-artifact
test\Microsoft.ML.OnnxRuntime.EndToEndTests.Capi\runtest.bat $(Build.BinariesDirectory)\nuget-artifact x64 $(NuGetPackageVersionNumber)
REM Need an ErrorLevel check, since the script uses Exit /B
IF NOT %ERRORLEVEL% EQU 0 {
EXIT 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ steps:

- task: CmdLine@2
displayName: 'Post binary sizes to the dashboard database using command line'
continueOnError: true # Recently the database connection is failing, so ignoring the error until that is fixed
inputs:
script: |
echo changing directory to artifact download path
Expand All @@ -33,7 +34,7 @@ steps:
echo processing %%~ni.nupkg
copy %%~ni.nupkg %%~ni.zip
echo copied to zip
echo listing lib files in the zip
echo listing lib files in the zip
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra space

REM use a single .csv file to put the data
echo os,arch,build_config,size > binary_size_data.txt
7z.exe l -slt %%~ni.zip runtimes\linux-x64\native\libonnxruntime.so | findstr /R /C:"^Size = [0-9]*" | for /F "tokens=3" %%a in ('more') do if not "%%a" == "" echo linux,x64,openmp,%%a >> binary_size_data.txt
Expand Down