Skip to content

Commit

Permalink
WIP: ENH: Add performance benchmark CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Apr 24, 2019
1 parent 6afa542 commit 1e53cfb
Showing 1 changed file with 93 additions and 2 deletions.
95 changes: 93 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesMacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ trigger:
include:
- master
- release*

variables:
ExternalDataVersion: 5.0rc01

jobs:
- job: macOS
timeoutInMinutes: 0
cancelTimeoutInMinutes: 300
pool:
vmImage: 'macOS 10.13'
vmImage: 'macOS-10.13'
steps:
- checkout: self
clean: true
Expand All @@ -27,7 +29,7 @@ jobs:
sudo python3 -m pip install ninja
sudo python3 -m pip install --upgrade setuptools
sudo python3 -m pip install scikit-ci-addons
displayName: Install dependencies
displayName: 'Install dependencies'
- bash: |
set -x
Expand Down Expand Up @@ -76,3 +78,92 @@ jobs:
testRunTitle: 'CTest $(Agent.OS)'
condition: succeededOrFailed()
displayName: 'Publish test results'


- job: PerformanceMacOS
displayName: 'macOS Performance Benchmarks'
timeoutInMinutes: 0
cancelTimeoutInMinutes: 300
pool:
vmImage: 'macOS-10.13'
steps:
- checkout: self
clean: true
fetchDepth: 5
- bash: |
set -x
if [ -n "$(System.PullRequest.SourceCommitId)" ]; then
git checkout $(System.PullRequest.SourceCommitId)
fi
displayName: Checkout pull request HEAD
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'

- bash: |
set -x
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install scikit-ci-addons
python -m pip install ninja
displayName: 'Install dependencies'
- script: |
mkdir ITK-build
cd ITK-build
cmake -DCMAKE_C_COMPILER:FILEPATH="clang" -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=OFF -GNinja $(Build.SourcesDirectory)
ninja
workingDirectory: $(Agent.BuildDirectory)
displayName: 'Build ITK'
- bash: |
set -x
git clone --single-branch https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking.git
workingDirectory: $(Agent.BuildDirectory)
displayName: 'Download performance benchmarks'
- script: |
set -x
c++ --version
cmake --version
mkdir ITKPerformanceBenchmarking-build
cd ITKPerformanceBenchmarking-build
cmake -DCMAKE_C_COMPILER:FILEPATH="clang" -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=OFF -GNinja -DITK_DIR:PATH=$(Agent.BuildDirectory)/ITK-build $(Agent.BuildDirectory)/ITKPerformanceBenchmarking
ninja
workingDirectory: $(Agent.BuildDirectory)
displayName: 'Build performance benchmarks module'
- bash: |
set -x
c++ --version
cmake --version
python ./ITKPerformanceBenchmarking/evaluate-itk-performance.py run --rev-list HEAD~1.. $(Build.SourcesDirectory) $(Agent.BuildDirectory)/ITK-build $(Agent.BuildDirectory)/ITKPerformanceBenchmarking-build
cd $(Build.SourcesDirectory)
git fetch
merge_base=`git merge-base --fork-point origin/master $(System.PullRequest.SourceCommitId)`
git show-ref
if [[ -z "${merge_base}" ]]; then
echo "Could not determine the merge base. Was this topic branched from upstream/master?"
exit 1
fi
cd -
python ./ITKPerformanceBenchmarking/evaluate-itk-performance.py run --rev-list ${merge_base}~1..${merge_base} $(Build.SourcesDirectory) $(Agent.BuildDirectory)/ITK-build $(Agent.BuildDirectory)/ITKPerformanceBenchmarking-build
cd $(Agent.BuildDirectory)/ITKPerformanceBenchmarking-build
tar cvzf BenchmarkResults.macOS.tar.gz BenchmarkResults
mv BenchmarkResults.macOS.tar.gz $(Agent.BuildDirectory)
workingDirectory: $(Agent.BuildDirectory)
displayName: 'Evaluate performance benchmarks'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'MacOSBenchmarkResults'
targetPath: './BenchmarkResults.macOS.tar.gz'

0 comments on commit 1e53cfb

Please sign in to comment.