Skip to content

Commit

Permalink
Add onnxruntime nightly build to CI (#284)
Browse files Browse the repository at this point in the history
* update svm converter test case failures to account for versioning on nightly ort builds

* 2 new nightly linux and win32 pipelines with onnxruntime nightly builds
  • Loading branch information
vinitra authored Apr 17, 2019
1 parent bca4746 commit 4a61fae
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 2 deletions.
66 changes: 66 additions & 0 deletions .azure-pipelines/linux-CI-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

jobs:

- job: 'Test'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python36-nightly:
python.version: '3.6'
ONNX_PATH: onnx==1.4.1
ORT_PATH: -i https://test.pypi.org/simple/ ort-nightly
maxParallel: 3

steps:
- task: CondaEnvironment@1
inputs:
createCustomEnvironment: true
environmentName: 'py$(python.version)'
packageSpecs: 'python=$(python.version)'

- script: |
python -m pip install --upgrade pip
conda config --set always_yes yes --set changeps1 no
conda install -c conda-forge protobuf
conda install -c conda-forge numpy
conda install -c conda-forge cmake
pip install $(ONNX_PATH)
pip install -r requirements.txt
cd onnxutils
pip install -e .
cd ..
pip install -r requirements-dev.txt
pip install $(ORT_PATH)
pip install pytest
git clone --recursive https://github.com/cjlin1/libsvm libsvm
cd libsvm
make lib
displayName: 'Install dependencies'
- script: |
export PYTHONPATH=$PYTHONPATH:libsvm/python
python -c "import svmutil"
python -c "import onnxconverter_common"
test '$(python.version)' != '2.7' && python -c "import onnxruntime"
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest - onnxmltools'
- script: |
export PYTHONPATH=$PYTHONPATH:libsvm/python
python -c "import onnxconverter_common"
pytest onnxutils/tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
displayName: 'pytest - onnxutils'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
72 changes: 72 additions & 0 deletions .azure-pipelines/win32-CI-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

jobs:

- job: 'Test'
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python36-nightly:
python.version: '3.6'
ONNX_PATH: onnx==1.4.1
ONNXRT_PATH: -i https://test.pypi.org/simple/ ort-nightly
COREML_PATH: git+https://github.com/apple/coremltools
maxParallel: 3

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

- script: conda create --yes --quiet --name py$(python.version) -c conda-forge python=$(python.version) numpy protobuf
displayName: Create Anaconda environment

- script: |
call activate py$(python.version)
python -m pip install --upgrade pip numpy
echo Test numpy installation... && python -c "import numpy"
pip install %COREML_PATH% %ONNX_PATH%
cd onnxutils
pip install -e .
echo Test onnxconverter-common installation... && python -c "import onnxconverter_common"
cd ..
pip install -r requirements-dev.txt
pip install %ONNXRT_PATH%
echo Test onnxruntime installation... && python -c "import onnxruntime"
REM install libsvm from github
git clone --recursive https://github.com/cjlin1/libsvm libsvm
copy libsvm\windows\*.dll libsvm\python
set PYTHONPATH=libsvm\python;%PYTHONPATH%
dir libsvm\python
echo Test libsvm installation... && python -c "import svmutil"
displayName: 'Install dependencies'
- script: |
call activate py$(python.version)
set PYTHONPATH=libsvm\python;%PYTHONPATH%
pip install -e .
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest - onnxmltools'
- script: |
call activate py$(python.version)
set PYTHONPATH=libsvm\python;%PYTHONPATH%
pytest onnxutils/tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
displayName: 'pytest - onnxutils'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
4 changes: 2 additions & 2 deletions tests/svmlib/test_SVMConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_convert_svmc_linear_raw(self):
# known svm runtime dimension error in ONNX Runtime 0.3.0
dump_data_and_model(X[:5].astype(numpy.float32), SkAPICl(libsvm_model), node,
basename="LibSvmSvmcLinearRaw-Dec3", verbose=False,
allow_failure="StrictVersion(onnxruntime.__version__) <= StrictVersion('0.3.0')")
allow_failure="StrictVersion(onnxruntime.__version__) < StrictVersion('0.4.0')")

def test_convert_svmc_raw(self):
iris = load_iris()
Expand All @@ -287,7 +287,7 @@ def test_convert_svmc_raw(self):
self.assertTrue(node is not None)
dump_data_and_model(X[:5].astype(numpy.float32), SkAPICl(libsvm_model), node,
basename="LibSvmSvmcRaw",
allow_failure="StrictVersion(onnxruntime.__version__) <= StrictVersion('0.3.0')")
allow_failure="StrictVersion(onnxruntime.__version__) < StrictVersion('0.4.0')")

@unittest.skip(reason="libsvm crashes.")
def test_convert_nusvmc_linear_raw(self):
Expand Down

0 comments on commit 4a61fae

Please sign in to comment.