-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
CI Move Pyodide CI from Azure to GitHub Actions #29791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI Move Pyodide CI from Azure to GitHub Actions #29791
Conversation
Note UPDATE, 07/09/2024: this works now, this comment is not relevant. This currently doesn't work and raises an obscure error (workflow logs) from within the Pyodide xbuildenv: However, at the same time, creating a Pyodide virtual environment in a freshly spun-up Pyodide Docker container (and after removing a few conflicting, irrelevant Tap to expand logs.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_get_visual_block_voting PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_get_visual_block_column_transformer PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_estimator_html_repr_pipeline PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_stacking_classifier[None] PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_stacking_classifier[final_estimator1] PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_stacking_regressor[None] PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_stacking_regressor[final_estimator1] PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_birch_duck_typing_meta PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_ovo_classifier_duck_typing_meta PASSED
.venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_estimator_html_repr.py::test_duck_typing_nested_estimator PASSED
# ...
# [...] (truncated output)
# ...
('logisticregression',LogisticRegression())]),param_grid={'logisticregression__C':[0.1,1.0]})-check_supervised_y_2d] - DataConversionWarning not caught
XPASS .venv-pyodide/lib/python3.12/site-packages/sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),min_resources='smallest',param_grid={'logisticregression__C':[0.1,1.0]},random_state=0)-check_supervised_y_2d] - DataConversionWarning not caught
XPASS .venv-pyodide/lib/python3.12/site-packages/sklearn/tests/test_common.py::test_search_cv[RandomizedSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),param_distributions={'logisticregression__C':[0.1,1.0]},random_state=0)-check_supervised_y_2d] - DataConversionWarning not caught
XPASS .venv-pyodide/lib/python3.12/site-packages/sklearn/tests/test_common.py::test_search_cv[HalvingRandomSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),param_distributions={'logisticregression__C':[0.1,1.0]},random_state=0)-check_supervised_y_2d] - DataConversionWarning not caught
XPASS .venv-pyodide/lib/python3.12/site-packages/sklearn/utils/tests/test_testing.py::test_create_memmap_backed_data - memmap not fully supported
FAILED .venv-pyodide/lib/python3.12/site-packages/sklearn/tests/test_build.py::test_openmp_parallelism_enabled - AssertionError:
==================================== 1 failed, 28699 passed, 4846 skipped, 761 xfailed, 52 xpassed, 3541 warnings in 787.87s (0:13:07) =====================================
(.venv-pyodide) agriyakhetarpal@c1f89ae6ff12:/src$ and all tests pass (the failing one can be ignored by enabling the However, I don't see why |
I figured out the error 😅
For circumstances unexplained to me, I found that it was trying to import a JavaScript file/module from I think we should fix this in Pyodide upstream – The build now fails with a |
3b30e89
to
7efd95d
Compare
So, we will have |
Just four errors are left to fix: ../.venv-pyodide/lib/python3.12/site-packages/sklearn/datasets/tests/test_openml.py::test_fetch_openml_verify_checksum[True-liac-arff] ERROR
../.venv-pyodide/lib/python3.12/site-packages/sklearn/datasets/tests/test_openml.py::test_fetch_openml_verify_checksum[False-liac-arff] ERROR
../.venv-pyodide/lib/python3.12/site-packages/sklearn/datasets/tests/test_openml.py::test_fetch_openml_verify_checksum[True-pandas] ERROR
../.venv-pyodide/lib/python3.12/site-packages/sklearn/datasets/tests/test_openml.py::test_fetch_openml_verify_checksum[False-pandas] ERROR which are most likely coming from the difference between the Node.js runner and the Pyodide virtual environment, because the latter uses the |
I have triggered both the Pyodide venv and the Azure tests, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are now ready for an initial review; thanks! I won't perform any further force-pushes here.
@@ -1459,7 +1459,7 @@ def _mock_urlopen_raise(request, *args, **kwargs): | |||
(False, "pandas"), | |||
], | |||
) | |||
def test_fetch_openml_verify_checksum(monkeypatch, as_frame, cache, tmpdir, parser): | |||
def test_fetch_openml_verify_checksum(monkeypatch, as_frame, tmpdir, parser): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, cache
was a spurious argument that was unused throughout the file. It broke the Pyodide tests and returned an error upon collection because the interpreter assumed that this was a fixture.
It looks good to me, thank you, Loïc!
While I'm not on the scikit-learn board, the general advice I will have from my NumFOCUS Security Committee member hat is that all actions should be pinned, even if it makes updating them troublesome. Dependabot or Renovate usually help with it, and current limitations will be overcome when github/roadmap#592 lands. I would agree with your assessment – this is another point of attack. If there's something that came out of the PyTorch nightly build dependency compromise, it is that there are definitely a bunch of end users of the nightly wheels, outside of CI. |
I remember this was discussed in the context of SPEC 8 for example #29203 (comment) and the picture was not so clear-cut at the time. SPEC 8 is saying "Pin GitHub Actions release workflows to their full release commit SHAs" which is why we are pinning the Now the question is whether the publishing of the Pyodide dev wheel to anaconda.org can be considered a "release workflow", maybe it is to be honest and we should at least pin |
I think we said in the past that we should pin by commit hash for package generating workflows only. EDIT: "release critical" -> "package generating" workflows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I would like a final pyodide build (except the upload step) working before giving the final approval to this PR.
Edit: indeed it's not possible to test the upload step as part of this PR.
Co-Authored-By: Olivier Grisel <olivier.grisel@ensta.org>
Thanks, @ogrisel for the review – I've addressed your comments in 4831d6d Edit: I won't be able to get a working Anaconda.org upload of the wheels, though; I'm contributing through a fork. It should kick in once the change is pushed to Edit two: the workslow is passing here: https://github.com/scikit-learn/scikit-learn/actions/runs/14068121558 |
.github/workflows/emscripten.yml
Outdated
build: ${{ steps.check_build_trigger.outputs.build }} | ||
steps: | ||
- name: Checkout scikit-learn | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to go back on forth on this but I personally would rather not pin official GitHub actions i.e. actions/...
, for example see some reasons in #29203 (comment).
In other words, I would only pin third-party actions in package generating workflows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to only pin third-party actions, we probably need to write down our policy somewhere then.
Sorry for the back and forth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides #29791 (review), LGTM.
I have pushed the following changes:
|
Let's merge this one, thanks @agriyakhetarpal! |
I have triggered manually a Pyodide wheel build, let's see what happens: https://github.com/scikit-learn/scikit-learn/actions/runs/14079229690 |
It failed because the token is empty? I'm not sure why that happened. |
Yeah me neither, I need to look into it closer ... |
Maybe #31078 would fix it by using the right Github environment to be able to access the secret. |
Co-authored-by: Loïc Estève <loic.esteve@ymail.com> Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Reference Issues/PRs
Discussed in pypa/cibuildwheel#1878, and on top of #31058.
What does this implement/fix? Explain your changes.
This PR reinstates the creation of the Pyodide virtual environment through the
pyodide venv <dir>
command as a conventional means of running thescikit-learn
test suite withpytest
in favour of the Node.js-based wrapper scriptbuild_tools/azure/pytest-pyodide.js
. Previously, unresolved symbol errors were coming from symbol visibility issues post OpenBLAS's linkage (pyodide/pyodide#3331) in the in-tree recipe for SciPy, which seem to have more or less subsided with our updates to it in recent months (see pyodide/pyodide#4719, pyodide/pyodide#5012, pyodide/pyodide#5031, and so on). These issues did not affect the Node.js-based runner, which explains the case for its usage.As a simplification,
cibuildwheel
performs the necessary changes inemscripten.yml
through theCIBW_PLATFORM: pyodide
environment variable that was released as a part ofcibuildwheel
2.19. Helper scripts that were used to install Pyodide and the Emscripten toolchain are no longer needed.Also, this PR drops the
[pyodide]
commit marker as a by-product of switching from Azure Pipelines to GitHub Actions, which means that Pyodide/WASM as a platform is now tested on every commit.Any other comments?
CIBW_TEST_COMMAND
pypa/cibuildwheel#1878 and @lesteve suggested upstreaming the change here.[pyodide]
commit marker after Run scipy tests as part of the Github Action CI pyodide/pyodide#4935 was merged recently, similar toscikit-learn
's CI activities.