Skip to content

Commit 358b519

Browse files
authored
Azure pipeline task CondaEnvironment@1 has been deprecated. (#2309)
* Replace CondaEnvironment@1 azure task with UsePythonVersion@0. * Remove unnecessary steps. --------- Signed-off-by: Jay Zhang <jiz@microsoft.com>
1 parent 9538da8 commit 358b519

File tree

4 files changed

+12
-41
lines changed

4 files changed

+12
-41
lines changed

ci_build/azure_pipelines/templates/combine_test_coverage.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ stages:
2020
artifactName: '${{ parameters.artifact_name }}'
2121
downloadPath: $(System.DefaultWorkingDirectory)
2222

23-
- task: CondaEnvironment@1
23+
- task: UsePythonVersion@0
2424
inputs:
25-
createCustomEnvironment: 'true'
26-
environmentName: 'tf2onnx'
27-
packageSpecs: 'python=3.7'
28-
updateConda: 'false'
25+
versionSpec: '3.7'
26+
architecture: 'x64'
2927

3028
- bash: |
3129
pip install -U coverage

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,10 @@ jobs:
7878
- bash: env
7979
displayName: 'Display Environment Variables'
8080

81-
# TODO: ordinary python is preferred but built-in python3.6 does not have libpython3.6m.so, onnxruntime will fail with
82-
# Error: 'libpython3.6m.so.1.0: cannot open shared object file: No such file or directory'
83-
# so have to use conda here, may switch back to UsePythonVersion when the issue is fixed.
84-
# - task: UsePythonVersion@0
85-
# inputs:
86-
# versionSpec: '$(CI_PYTHON_VERSION)'
87-
# architecture: 'x64'
88-
89-
# TODO: Conda Environment task is deprecating, move to raw python after issue above is fixed.
90-
# https://github.com/Microsoft/azure-pipelines-tasks/pull/9573
91-
- task: CondaEnvironment@1
81+
- task: UsePythonVersion@0
9282
inputs:
93-
createCustomEnvironment: 'true'
94-
environmentName: 'tf2onnx'
95-
packageSpecs: 'python=$(CI_PYTHON_VERSION)'
96-
updateConda: 'false'
83+
versionSpec: '$(CI_PYTHON_VERSION)'
84+
architecture: 'x64'
9785

9886
- ${{ if eq(parameters.run_setup, 'True') }}:
9987
- template: 'setup.yml'

ci_build/azure_pipelines/templates/keras2onnx_application_tests.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ steps:
99
- script: sudo install -d -m 0777 /home/vsts/.conda/envs
1010
displayName: Fix Conda permissions
1111

12-
- task: CondaEnvironment@1
12+
- task: UsePythonVersion@0
1313
inputs:
14-
createCustomEnvironment: true
15-
environmentName: 'py$(python.version)'
16-
packageSpecs: 'python=$(python.version)'
14+
versionSpec: '$(python.version)'
15+
architecture: 'x64'
1716

1817
- script: |
1918
python -m pip install --upgrade pip
@@ -80,11 +79,7 @@ steps:
8079
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
8180
displayName: Add conda to PATH
8281

83-
- script: conda create --yes --quiet --name py$(python.version) -c conda-forge python=$(python.version) numpy protobuf~=3.20
84-
displayName: Create Anaconda environment
85-
8682
- script: |
87-
call activate py$(python.version)
8883
python -m pip install --upgrade pip numpy
8984
echo Test numpy installation... && python -c "import numpy"
9085
pip install onnxconverter-common
@@ -119,7 +114,6 @@ steps:
119114
displayName: 'Install dependencies'
120115
121116
- script: |
122-
call activate py$(python.version)
123117
pip install -e .
124118
echo Test onnxruntime installation... && python -c "import onnxruntime"
125119
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml

ci_build/azure_pipelines/templates/keras2onnx_unit_test.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ steps:
99
- script: sudo install -d -m 0777 /home/vsts/.conda/envs
1010
displayName: Fix Conda permissions
1111

12-
- task: CondaEnvironment@1
12+
- task: UsePythonVersion@0
1313
inputs:
14-
createCustomEnvironment: true
15-
environmentName: 'py$(python.version)'
16-
packageSpecs: 'python=$(python.version)'
14+
versionSpec: '$(python.version)'
15+
architecture: 'x64'
1716

1817
- script: |
1918
python -m pip install --upgrade pip
@@ -63,14 +62,7 @@ steps:
6362
versionSpec: '$(python.version)'
6463
architecture: 'x64'
6564

66-
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
67-
displayName: Add conda to PATH
68-
69-
- script: conda create --yes --quiet --name py$(python.version) -c conda-forge python=$(python.version) numpy protobuf~=3.20
70-
displayName: Create Anaconda environment
71-
7265
- script: |
73-
call activate py$(python.version)
7466
python -m pip install --upgrade pip numpy
7567
echo Test numpy installation... && python -c "import numpy"
7668
pip install onnxconverter-common
@@ -91,7 +83,6 @@ steps:
9183
displayName: 'Install dependencies'
9284
9385
- script: |
94-
call activate py$(python.version)
9586
pip install -e .
9687
echo Test onnxruntime installation... && python -c "import onnxruntime"
9788
python -c "import onnxconverter_common"

0 commit comments

Comments
 (0)