Skip to content

CI Add Pyodide wheel build #26374

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

Merged
merged 8 commits into from
May 22, 2023
Merged

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented May 15, 2023

What does this implement/fix? Explain your changes.

This adds a CI build that build a Pyodide wheel:

  • in [pyodide] is in the commit message
  • in the scheduled nightly build

I am not planning to run the scikit-learn tests in this PR. This is already useful to make sure the Pyodide wheel builds fine. There was at least one issue in the past where some changes broke the Pyodide build, see #25831.

Right now the scikit-learn test suite pass on the Pyodide development version (but not on the latest released version namely 0.23.2 at the time of writing) so probably I will wait for the next Pyodide release before running tests. I could also add something simple like making sure that import sklearn works or run the test suite for some submodules that are known to work, let me know!

For more details about scikit-learn test suite status in Pyodide see https://github.com/lesteve/scikit-learn-tests-pyodide.

Edit: the Pyodide build seems to work fine.

@lesteve lesteve marked this pull request as ready for review May 15, 2023 14:48
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Are you planning to use the conda-lock infrastructure or the Azure build scripts for testing Pyodide?

(I'm considering using GitHub Actions for the Pyodide build & tests)

@lesteve
Copy link
Member Author

lesteve commented May 16, 2023

Are you planning to use the conda-lock infrastructure or the Azure build scripts for testing Pyodide?

Not really, when you fix the Pyodide version (as already done), you get a fixed version of the packages (e.g. numpy, scipy, etc ...).

The main reason I used Azure is that I thought Pyodide was similar to PyPy and nogil, an exotic platform that we want to test during the the nightly build and on a explicit commit message. I was also planning to use the python script to create an issue when the Pyodide nightly build fails.

(I'm considering using GitHub Actions for the Pyodide build & tests)

Can you explain a bit why? I guess the [cd build] is on Github Actions and we are indeed creating a Pyodide wheel. Edit: there seems to be some work on adding Pyodide to cibuildwheel pypa/cibuildwheel#1456

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain a bit why?

Two reasons:

  • Purely logistical. We currently have 60 runners on GitHub Actions and 30 runners on Azure.
  • We are going to need a new yaml file to configure Pyodide anyways, so maybe move to GitHub Actions.

In any case, I am okay with including this in the Azure CI.

@ogrisel
Copy link
Member

ogrisel commented May 16, 2023

I could also add something simple like making sure that import sklearn works or run the test suite for some submodules that are known to work, let me know!

+1 for at least checking that the import works + a note that explains that running the full test suite will come once a stable release of pyodide makes it possible.

@ogrisel
Copy link
Member

ogrisel commented May 16, 2023

No opinion on Azure vs GitHub Actions. I don't think worker usage is a problem because it is not trigger on the PR, only on scheduled builds + manual trigger.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me once https://github.com/scikit-learn/scikit-learn/pull/26374/files#r1195164229 is agreed upon. We can later refactor and move to github actions shall the need arise.

Note: there is a warning in the build log:

WARNING: Location 'file:/home/vsts/work/1/s/.pyodide-xbuildenv/xbuildenv/pyodide-root/pypa_index/pip/' is ignored: it is neither a file nor a directory.

https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=55137&view=logs&j=6fac3219-cc32-5595-eb73-7f086a643b12&t=6856d197-9931-5ad8-f897-5714e4bdfa31

not sure if this is a real problem or not.

@lesteve
Copy link
Member Author

lesteve commented May 22, 2023

Note: there is a warning in the build log:

WARNING: Location 'file:/home/vsts/work/1/s/.pyodide-xbuildenv/xbuildenv/pyodide-root/pypa_index/pip/' is ignored: it is neither a file nor a directory.

dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=55137&view=logs&j=6fac3219-cc32-5595-eb73-7f086a643b12&t=6856d197-9931-5ad8-f897-5714e4bdfa31

not sure if this is a real problem or not.

Not sure either, I tried to reproduce locally and I didn't manage to get the warning somehow ... I would say everything seems to work fine so probably good enough?

Copy link
Member

@betatim betatim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasjpfan what do you think?

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get do the .pyodide-xbuildenv warning in Docker, but I think it is safe to ignore. I'm okay with merging now and iterate from there.

@thomasjpfan thomasjpfan merged commit 51bd562 into scikit-learn:main May 22, 2023
@lesteve lesteve deleted the pyodide-build branch May 23, 2023 06:41
@lesteve
Copy link
Member Author

lesteve commented May 23, 2023

REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants