@@ -242,6 +242,57 @@ PR: Don't change unrelated
242
242
243
243
Please do not change unrelated lines. It makes your contribution harder to review and may introduce merge conflicts to other pull requests.
244
244
245
+ .. _debugging_ci_issues :
246
+
247
+ Debugging CI issues
248
+ -------------------
249
+
250
+ CI issues may arise for a variety of reasons, so this is by no means a
251
+ comprehensive guide, but rather a list of useful tips and tricks.
252
+
253
+ Using a lock-file to get an environment close to the CI
254
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++
255
+
256
+ `conda-lock ` can be used to create a conda environment with the exact same
257
+ conda and pip packages as on the CI. For example, the following command will
258
+ create a conda environment named `scikit-learn-doc ` that is similar to the CI:
259
+
260
+ .. prompt :: bash $
261
+
262
+ conda-lock install -n scikit-learn-doc build_tools/circle/doc_linux-64_conda.lock
263
+
264
+ .. note ::
265
+
266
+ It only works if you have the same OS as the CI build (check `platform: ` in
267
+ the lock-file). For example, the previous command will only work if you are
268
+ on a Linux machine. Also this may not allow you to reproduce some of the
269
+ issues that are more tied to the particularities of the CI environment, for
270
+ example CPU architecture reported by OpenBLAS in `sklearn.show_versions() `.
271
+
272
+ If you don't have the same OS as the CI build you can still create a conda
273
+ environment from the right environment yaml file, although it won't be as close
274
+ as the CI environment as using the associated lock-file. For example for the
275
+ doc build:
276
+
277
+ .. prompt :: bash $
278
+
279
+ conda env create -n scikit-learn-doc -f build_tools/circle/doc_environment.yml -y
280
+
281
+ This may not give you exactly the same package versions as in the CI for a
282
+ variety of reasons, for example:
283
+
284
+ - some packages may have had new releases between the time the lock files were
285
+ last updated in the `main ` branch and the time you run the `conda create `
286
+ command. You can always try to look at the version in the lock-file and
287
+ specify the versions by hand for some specific packages that you think would
288
+ help reproducing the issue.
289
+ - different packages may be installed by default depending on the OS. For
290
+ example, the default BLAS library when installing numpy is OpenBLAS on Linux
291
+ and MKL on Windows.
292
+
293
+ Also the problem may be OS specific so the only way to be able to reproduce
294
+ would be to have the same OS as the CI build.
295
+
245
296
.. highlight :: default
246
297
247
298
Debugging memory errors in Cython with valgrind
0 commit comments