Skip to content

Commit

Permalink
fix version number for tarball packages (#600) (#610)
Browse files Browse the repository at this point in the history
* add variables for version number and git commit hash

* fix typo

* fix typo

* some logging

* some logging

* some logging

* some logging

* some logging

* some logging

* some logging

* some logging

* some more edits to see generic scripts can print

* working

* fixing windows git hash

* try quoted echo

* fix git rev-parse

* echo without quotes

* removed commit hash from artifact filename, added long commit hash as a file inside

* added the missing commit id parameter

* fix windows pipeline

* keep only win 64, others disabled

* remove disabling conditions
  • Loading branch information
shahasad authored Mar 13, 2019
1 parent b8c5bf2 commit 5751f1b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 10 deletions.
34 changes: 24 additions & 10 deletions tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,61 @@ jobs:
pool: Linux-CPU
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml

- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -x " --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64'
artifactName: 'onnxruntime-linux-x64-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml


- job: Linux_C_API_Packaging_CPU_x86
pool: Linux-CPU
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml

- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -a x86 -x " --x86 --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x86'
artifactName: 'onnxruntime-linux-x86-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml


- job: Linux_C_API_Packaging_GPU_x64
pool: Linux-GPU
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml

- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d gpu -c cuda9.1-cudnn7.1 -r $(Build.BinariesDirectory) -x " --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64-gpu'
artifactName: 'onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml


- job: MacOS_C_API_Packaging_CPU_x64
pool:
vmImage: 'macOS-10.13'
steps:

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

- script: |
sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config RelWithDebInfo --enable_onnx_tests --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)
Expand All @@ -57,9 +66,10 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-osx-x64'
artifactName: 'onnxruntime-osx-x64-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.dylib'

commitId: $(OnnxRuntimeGitCommitHash)

- template: templates/clean-agent-build-directory-step.yml


Expand All @@ -72,6 +82,7 @@ jobs:

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

- template: templates/windows-build-tools-setup-steps.yml
parameters:
Expand All @@ -89,8 +100,8 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-$(buildArch)'

artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml


Expand All @@ -103,6 +114,7 @@ jobs:

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

- template: templates/windows-build-tools-setup-steps.yml
parameters:
Expand All @@ -120,8 +132,8 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-$(buildArch)'

artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml


Expand All @@ -134,6 +146,7 @@ jobs:

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

- task: CmdLine@2
displayName: 'Set CUDA 9.1 path'
Expand Down Expand Up @@ -167,7 +180,8 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-gpu-$(buildArch)'
artifactName: 'onnxruntime-win-$(buildArch)-gpu-$(OnnxRuntimeVersion)'
commitId: $(OnnxRuntimeGitCommitHash)

- task: PowerShell@2
displayName: 'Clean up Cuda Path 9.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-linux-x64'
libraryName: 'libonnxruntime.so'
commitId: ''
steps:
- task: CmdLine@2
displayName: 'Copy build artifacts for zipping'
Expand All @@ -20,6 +21,8 @@ steps:
cp $(Build.SourcesDirectory)/docs/C_API.md $(Build.BinariesDirectory)/${{parameters.artifactName}}/C_API.md
cp $(Build.SourcesDirectory)/LICENSE $(Build.BinariesDirectory)/${{parameters.artifactName}}/LICENSE
cp $(Build.SourcesDirectory)/ThirdPartyNotices.txt $(Build.BinariesDirectory)/${{parameters.artifactName}}/ThirdPartyNotices.txt
cp $(Build.SourcesDirectory)/VERSION_NUMBER $(Build.BinariesDirectory)/${{parameters.artifactName}}/VERSION_NUMBER
echo ${{parameters.commitId}} > $(Build.BinariesDirectory)/${{parameters.artifactName}}/GIT_COMMIT_ID
workingDirectory: '$(Build.BinariesDirectory)/${{parameters.buildConfig}}'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-win-x64'
comitId: ''
steps:
- task: CmdLine@2
displayName: 'Copy build artifacts for zipping'
Expand All @@ -21,6 +22,8 @@ steps:
copy $(Build.SourcesDirectory)\docs\C_API.md $(Build.BinariesDirectory)\${{parameters.artifactName}}\C_API.md
copy $(Build.SourcesDirectory)\LICENSE $(Build.BinariesDirectory)\${{parameters.artifactName}}\LICENSE
copy $(Build.SourcesDirectory)\ThirdPartyNotices.txt $(Build.BinariesDirectory)\${{parameters.artifactName}}\ThirdPartyNotices.txt
copy $(Build.SourcesDirectory)/VERSION_NUMBER $(Build.BinariesDirectory)\${{parameters.artifactName}}\VERSION_NUMBER
@echo ${{parameters.commitId}} > $(Build.BinariesDirectory)\${{parameters.artifactName}}\GIT_COMMIT_ID
workingDirectory: '$(Build.BinariesDirectory)\${{parameters.buildConfig}}'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Sets version number from VERSION.txt into a variable. As well as the git commit hash.

steps:
- task: CmdLine@2
displayName: 'Set Version Number variables for Windows'
inputs:
script: |
SETLOCAL EnableDelayedExpansion
set /p _OnnxRuntimeVersion=<$(Build.SourcesDirectory)\VERSION_NUMBER
@echo ##vso[task.setvariable variable=OnnxRuntimeVersion;]%_OnnxRuntimeVersion%
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse HEAD`) DO (
@echo ##vso[task.setvariable variable=OnnxRuntimeGitCommitHash;]%%F
)
workingDirectory: '$(Build.SourcesDirectory)'
condition: eq(variables['Agent.OS'], 'Windows_NT')

- task: CmdLine@2
displayName: 'Set version number variables for Unix'
inputs:
script: |
_OnnxRuntimeVersion=$(head -1 $(Build.SourcesDirectory)/VERSION_NUMBER)
echo "##vso[task.setvariable variable=OnnxRuntimeVersion;]$_OnnxRuntimeVersion"
_OnnxRuntimeGitCommitHash=$(git rev-parse HEAD)
echo "##vso[task.setvariable variable=OnnxRuntimeGitCommitHash;]$_OnnxRuntimeGitCommitHash"
workingDirectory: '$(Build.SourcesDirectory)'
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))

0 comments on commit 5751f1b

Please sign in to comment.