forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
321 lines (304 loc) · 11.7 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# Adapted from https://github.com/pandas-dev/pandas/blob/master/azure-pipelines.yml
schedules:
- cron: "30 2 * * *"
displayName: Run nightly build
branches:
include:
- main
always: true
jobs:
- job: git_commit
displayName: Get Git Commit
pool:
vmImage: ubuntu-20.04
steps:
- bash: python build_tools/azure/get_commit_message.py
name: commit
displayName: Get source version message
- job: linting
dependsOn: [git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[lint skip]')),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
displayName: Linting
pool:
vmImage: ubuntu-20.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
- bash: |
source build_tools/shared.sh
# Include pytest compatibility with mypy
pip install pytest ruff $(get_dep mypy min) $(get_dep black min) cython-lint
displayName: Install linters
- bash: |
./build_tools/linting.sh
displayName: Run linters
- template: build_tools/azure/posix.yml
parameters:
name: Linux_Nightly
vmImage: ubuntu-20.04
dependsOn: [git_commit, linting]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[scipy-dev]'
)
)
)
matrix:
pylatest_pip_scipy_dev:
DISTRIB: 'conda-pip-scipy-dev'
LOCK_FILE: './build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock'
CHECK_WARNINGS: 'true'
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
# Tests that require large downloads over the networks are skipped in CI.
# Here we make sure, that they are still run on a regular basis.
SKLEARN_SKIP_NETWORK_TESTS: '0'
- template: build_tools/azure/posix-docker.yml
# Experimental CPython branch without the Global Interpreter Lock:
# https://github.com/colesbury/nogil/
#
# The nogil build relies on a dedicated PyPI-style index to install patched
# versions of NumPy, SciPy and Cython maintained by @colesbury and that
# include specific fixes to make them run correctly without relying on the GIL.
#
# The goal of this CI entry is to make sure that we do not introduce any
# dependency on the GIL in scikit-learn itself. An auxiliary goal is to early
# detect any regression in the patched build dependencies to report them
# upstream. The long-term goal is to be able to stop having to maintain
# multiprocessing based workaround / hacks in joblib / loky to make multi-CPU
# computing in scikit-learn efficient by default using regular threads.
#
# If this experimental entry becomes too unstable, feel free to disable it.
parameters:
name: Linux_nogil
vmImage: ubuntu-20.04
dependsOn: [git_commit, linting]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[nogil]'
)
)
)
matrix:
pylatest_pip_nogil:
DOCKER_CONTAINER: 'nogil/python'
DISTRIB: 'pip-nogil'
LOCK_FILE: './build_tools/azure/python_nogil_lock.txt'
COVERAGE: 'false'
- template: build_tools/azure/posix-docker.yml
parameters:
name: Linux_Nightly_PyPy
vmImage: ubuntu-20.04
dependsOn: [linting, git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(
eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[pypy]')
)
)
matrix:
pypy3:
DOCKER_CONTAINER: 'condaforge/miniforge3:4.10.3-5'
DISTRIB: 'conda-pypy3'
LOCK_FILE: './build_tools/azure/pypy3_linux-64_conda.lock'
- job: Linux_Nightly_Pyodide
pool:
vmImage: ubuntu-22.04
variables:
# Need to match Python version and Emscripten version for the correct
# Pyodide version. For Pyodide version 0.23.2, see
# https://github.com/pyodide/pyodide/blob/0.23.2/Makefile.envs
PYODIDE_VERSION: '0.23.2'
EMSCRIPTEN_VERSION: '3.1.32'
PYTHON_VERSION: '3.11.2'
dependsOn: [git_commit, linting]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[pyodide]'
)
)
)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
addToPath: true
- bash: bash build_tools/azure/install_pyodide.sh
displayName: Build Pyodide wheel and install it in a Pyodide venv
- bash: bash build_tools/azure/test_script_pyodide.sh
displayName: Test Pyodide wheel
# Will run all the time regardless of linting outcome.
- template: build_tools/azure/posix.yml
parameters:
name: Linux_Runs
vmImage: ubuntu-20.04
dependsOn: [git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
pylatest_conda_forge_mkl:
DISTRIB: 'conda'
LOCK_FILE: './build_tools/azure/pylatest_conda_forge_mkl_linux-64_conda.lock'
COVERAGE: 'true'
SHOW_SHORT_SUMMARY: 'true'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '42' # default global random seed
# Check compilation with Ubuntu 22.04 LTS (Jammy Jellyfish) and scipy from conda-forge
# By default the CI is sequential, where `Ubuntu_Jammy_Jellyfish` runs first and
# the others jobs are run only if `Ubuntu_Jammy_Jellyfish` succeeds.
# When "[azure parallel]" is in the commit message, `Ubuntu_Jammy_Jellyfish` will
# run in parallel with the rest of the jobs. On Azure, the job's name will be
# `Ubuntu_Jammy_Jellyfish_Parallel`.
- template: build_tools/azure/posix-all-parallel.yml
parameters:
name: Ubuntu_Jammy_Jellyfish
vmImage: ubuntu-22.04
dependsOn: [git_commit, linting]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
commitMessage: dependencies['git_commit']['outputs']['commit.message']
matrix:
py38_conda_forge_openblas_ubuntu_2204:
DISTRIB: 'conda'
LOCK_FILE: './build_tools/azure/py38_conda_forge_openblas_ubuntu_2204_linux-64_conda.lock'
COVERAGE: 'false'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '0' # non-default seed
- template: build_tools/azure/posix.yml
parameters:
name: Ubuntu_Atlas
vmImage: ubuntu-22.04
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
# Runs when dependencies succeeded or skipped
condition: |
and(
not(or(failed(), canceled())),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
# Linux environment to test that scikit-learn can be built against
# versions of numpy, scipy with ATLAS that comes with Ubuntu Jammy Jellyfish 22.04
# i.e. numpy 1.21.5 and scipy 1.8.0
ubuntu_atlas:
DISTRIB: 'ubuntu'
LOCK_FILE: './build_tools/azure/ubuntu_atlas_lock.txt'
COVERAGE: 'false'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '1' # non-default seed
- template: build_tools/azure/posix.yml
parameters:
name: Linux
vmImage: ubuntu-20.04
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
# Runs when dependencies succeeded or skipped
condition: |
and(
not(or(failed(), canceled())),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
# Linux + Python 3.8 build with OpenBLAS
py38_conda_defaults_openblas:
DISTRIB: 'conda'
LOCK_FILE: './build_tools/azure/py38_conda_defaults_openblas_linux-64_conda.lock'
SKLEARN_ENABLE_DEBUG_CYTHON_DIRECTIVES: '1'
SKLEARN_RUN_FLOAT32_TESTS: '1'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '2' # non-default seed
# Linux environment to test the latest available dependencies.
# It runs tests requiring lightgbm, pandas and PyAMG.
pylatest_pip_openblas_pandas:
DISTRIB: 'conda-pip-latest'
LOCK_FILE: './build_tools/azure/pylatest_pip_openblas_pandas_linux-64_conda.lock'
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
CHECK_WARNINGS: 'true'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '3' # non-default seed
# disable pytest-xdist to have 1 job where OpenMP and BLAS are not single
# threaded because by default the tests configuration (sklearn/conftest.py)
# makes sure that they are single threaded in each xdist subprocess.
PYTEST_XDIST_VERSION: 'none'
- template: build_tools/azure/posix-docker.yml
parameters:
name: Linux_Docker
vmImage: ubuntu-20.04
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
# Runs when dependencies succeeded or skipped
condition: |
and(
not(or(failed(), canceled())),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
debian_atlas_32bit:
DOCKER_CONTAINER: 'i386/debian:11.2'
DISTRIB: 'debian-32'
COVERAGE: "true"
LOCK_FILE: './build_tools/azure/debian_atlas_32bit_lock.txt'
# disable pytest xdist due to unknown bug with 32-bit container
PYTEST_XDIST_VERSION: 'none'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '4' # non-default seed
- template: build_tools/azure/posix.yml
parameters:
name: macOS
vmImage: macOS-11
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
# Runs when dependencies succeeded or skipped
condition: |
and(
not(or(failed(), canceled())),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
pylatest_conda_forge_mkl:
DISTRIB: 'conda'
LOCK_FILE: './build_tools/azure/pylatest_conda_forge_mkl_osx-64_conda.lock'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '5' # non-default seed
pylatest_conda_mkl_no_openmp:
DISTRIB: 'conda'
LOCK_FILE: './build_tools/azure/pylatest_conda_mkl_no_openmp_osx-64_conda.lock'
SKLEARN_TEST_NO_OPENMP: 'true'
SKLEARN_SKIP_OPENMP_TEST: 'true'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '6' # non-default seed
- template: build_tools/azure/windows.yml
parameters:
name: Windows
vmImage: windows-latest
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
# Runs when dependencies succeeded or skipped
condition: |
and(
not(or(failed(), canceled())),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
py38_conda_forge_mkl:
DISTRIB: 'conda'
LOCK_FILE: ./build_tools/azure/py38_conda_forge_mkl_win-64_conda.lock
CHECK_WARNINGS: 'true'
# The Azure Windows runner is typically much slower than other CI
# runners due to the lack of compiler cache. Running the tests with
# coverage enabled make them run extra slower. Since very few parts of
# code should have windows-specific code branches, it should be enable
# to restrict the code coverage collection to the non-windows runners.
COVERAGE: 'false'
SKLEARN_ENABLE_DEBUG_CYTHON_DIRECTIVES: '1'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '7' # non-default seed