Skip to content

Commit 4a61fae

Browse files
authored
Add onnxruntime nightly build to CI (#284)
* 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
1 parent bca4746 commit 4a61fae

File tree

3 files changed

+140
-2
lines changed

3 files changed

+140
-2
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Python package
2+
# Create and test a Python package on multiple Python versions.
3+
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
5+
6+
trigger:
7+
- master
8+
9+
jobs:
10+
11+
- job: 'Test'
12+
pool:
13+
vmImage: 'Ubuntu-16.04'
14+
strategy:
15+
matrix:
16+
Python36-nightly:
17+
python.version: '3.6'
18+
ONNX_PATH: onnx==1.4.1
19+
ORT_PATH: -i https://test.pypi.org/simple/ ort-nightly
20+
maxParallel: 3
21+
22+
steps:
23+
- task: CondaEnvironment@1
24+
inputs:
25+
createCustomEnvironment: true
26+
environmentName: 'py$(python.version)'
27+
packageSpecs: 'python=$(python.version)'
28+
29+
- script: |
30+
python -m pip install --upgrade pip
31+
conda config --set always_yes yes --set changeps1 no
32+
conda install -c conda-forge protobuf
33+
conda install -c conda-forge numpy
34+
conda install -c conda-forge cmake
35+
pip install $(ONNX_PATH)
36+
pip install -r requirements.txt
37+
cd onnxutils
38+
pip install -e .
39+
cd ..
40+
pip install -r requirements-dev.txt
41+
pip install $(ORT_PATH)
42+
pip install pytest
43+
git clone --recursive https://github.com/cjlin1/libsvm libsvm
44+
cd libsvm
45+
make lib
46+
displayName: 'Install dependencies'
47+
48+
- script: |
49+
export PYTHONPATH=$PYTHONPATH:libsvm/python
50+
python -c "import svmutil"
51+
python -c "import onnxconverter_common"
52+
test '$(python.version)' != '2.7' && python -c "import onnxruntime"
53+
pytest tests --doctest-modules --junitxml=junit/test-results.xml
54+
displayName: 'pytest - onnxmltools'
55+
56+
- script: |
57+
export PYTHONPATH=$PYTHONPATH:libsvm/python
58+
python -c "import onnxconverter_common"
59+
pytest onnxutils/tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
60+
displayName: 'pytest - onnxutils'
61+
62+
- task: PublishTestResults@2
63+
inputs:
64+
testResultsFiles: '**/test-results.xml'
65+
testRunTitle: 'Python $(python.version)'
66+
condition: succeededOrFailed()
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Python package
2+
# Create and test a Python package on multiple Python versions.
3+
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
5+
6+
trigger:
7+
- master
8+
9+
jobs:
10+
11+
- job: 'Test'
12+
pool:
13+
vmImage: 'vs2017-win2016'
14+
strategy:
15+
matrix:
16+
Python36-nightly:
17+
python.version: '3.6'
18+
ONNX_PATH: onnx==1.4.1
19+
ONNXRT_PATH: -i https://test.pypi.org/simple/ ort-nightly
20+
COREML_PATH: git+https://github.com/apple/coremltools
21+
maxParallel: 3
22+
23+
steps:
24+
- task: UsePythonVersion@0
25+
inputs:
26+
versionSpec: '$(python.version)'
27+
architecture: 'x64'
28+
29+
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
30+
displayName: Add conda to PATH
31+
32+
- script: conda create --yes --quiet --name py$(python.version) -c conda-forge python=$(python.version) numpy protobuf
33+
displayName: Create Anaconda environment
34+
35+
- script: |
36+
call activate py$(python.version)
37+
python -m pip install --upgrade pip numpy
38+
echo Test numpy installation... && python -c "import numpy"
39+
pip install %COREML_PATH% %ONNX_PATH%
40+
cd onnxutils
41+
pip install -e .
42+
echo Test onnxconverter-common installation... && python -c "import onnxconverter_common"
43+
cd ..
44+
pip install -r requirements-dev.txt
45+
pip install %ONNXRT_PATH%
46+
echo Test onnxruntime installation... && python -c "import onnxruntime"
47+
REM install libsvm from github
48+
git clone --recursive https://github.com/cjlin1/libsvm libsvm
49+
copy libsvm\windows\*.dll libsvm\python
50+
set PYTHONPATH=libsvm\python;%PYTHONPATH%
51+
dir libsvm\python
52+
echo Test libsvm installation... && python -c "import svmutil"
53+
displayName: 'Install dependencies'
54+
55+
- script: |
56+
call activate py$(python.version)
57+
set PYTHONPATH=libsvm\python;%PYTHONPATH%
58+
pip install -e .
59+
pytest tests --doctest-modules --junitxml=junit/test-results.xml
60+
displayName: 'pytest - onnxmltools'
61+
62+
- script: |
63+
call activate py$(python.version)
64+
set PYTHONPATH=libsvm\python;%PYTHONPATH%
65+
pytest onnxutils/tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
66+
displayName: 'pytest - onnxutils'
67+
68+
- task: PublishTestResults@2
69+
inputs:
70+
testResultsFiles: '**/test-results.xml'
71+
testRunTitle: 'Python $(python.version)'
72+
condition: succeededOrFailed()

tests/svmlib/test_SVMConverters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def test_convert_svmc_linear_raw(self):
261261
# known svm runtime dimension error in ONNX Runtime 0.3.0
262262
dump_data_and_model(X[:5].astype(numpy.float32), SkAPICl(libsvm_model), node,
263263
basename="LibSvmSvmcLinearRaw-Dec3", verbose=False,
264-
allow_failure="StrictVersion(onnxruntime.__version__) <= StrictVersion('0.3.0')")
264+
allow_failure="StrictVersion(onnxruntime.__version__) < StrictVersion('0.4.0')")
265265

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

292292
@unittest.skip(reason="libsvm crashes.")
293293
def test_convert_nusvmc_linear_raw(self):

0 commit comments

Comments
 (0)