-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: upload musllinux wheels to PyPI #20089
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
Comments
I guess we could use a manylinux image for this. If we do this, we should start with x86_64 and add other architectures on demand. I would like to support aarch64, but as it is the travis-ci.com support for ARM is flaky. |
Mailing list thread on this topic here. |
Any updates on this? |
Migration to |
@rgommers it seems like with #20102, #21128 and others being closed, it seems like cibuildwheel is pretty well baked into numpy at this point - is that accurate? If so, this might be ready to go sometime soon. I hope it's as simple as just adding musl to the cibuildwheel config but even if it's not super straightforward, I'd advocate for putting some effort into getting them working (I'd be willing to help out if I can / if needed). Minimal docker containers are about the perfect use case for wheels, every webdev numpy user would love shaving 10+ minutes off of their image builds with no effort. Just to get an idea of how much tweaking might be needed, I tried building a wheel on Alpine and running the tests. Results:
The failures are in test_umath (divide by 0 issues) and the errors are all in test_cython (issues with subprocess calls to run Anyway, if anyone wants to quickly recreate: # On host
docker run -it --rm python:3.10-alpine sh
# In container
apk add git build-base
pip install build virtualenv
git clone https://github.com/numpy/numpy.git && cd numpy
git submodule update --init
python -m build
python -m virtualenv /venv
source /venv/bin/activate
pip install -r test_requirements.txt
pip install dist/numpy*.whl
apk del git build-base # make sure we aren't reliant on any headers
python runtests.py -v -n |
The first step in this would be for someone to submit a PR to add the musl build. We use the pyproject.toml, which currently skips the |
Or start trying to fix the 19 failures.
It's indeed getting close. We should probably do a full test run of that machinery. Or maybe you have already done that @charris? |
cibuildwheel is running on a cron job. Here is the latest run, the wheels generated have the |
Alright, I did the basic changes on #21200. No guarantee that the same issues will show up so we'll see what happens when the pipeline goes through. I have a couple questions but I'll follow up with them on the PR. |
numpy dependency does not yet supply musllinux wheels and they take too long to build on aarch64. Can be re-enabled when numpy wheels are available via numpy/numpy#20089
* Add support for building on aarch64 on Linux * wheels run * Splic jobs * wheels * wheels : remove extra archs * wheels : missing x * wheels : remove ppc, s390 (take too long) * Do not attempt to build musllinux on aarch64 numpy dependency does not yet supply musllinux wheels and they take too long to build on aarch64. Can be re-enabled when numpy wheels are available via numpy/numpy#20089 * wheels run Co-authored-by: Martin Durant <[email protected]> Co-authored-by: martindurant <[email protected]>
Just a note here: calling people who want this to work to take a look at the failing tests in #21200. There are apparently some glitches to get NumPy working with musllinux. Since this is only a "nice to have if it doesn't cause a maintenance burden" feature for most core NumPy devs, others who feel this is important will have to help out to get the tests to pass. |
Yes, for sure there is such a thing. Since all wheels have to be uploaded before an sdist can be uploaded, any single wheel failing to build can block a release. So 25-30 seems fine, but there's a lot more that could be built which we should avoid. See https://pypackaging-native.github.io/meta-topics/user_expectations_wheels/ for more details. I'll answer your other questions later. |
I'd say yes. Musl is used by Alpine Linux, which is quite popular for use in Docker containers, because of the small-sized images it produces (thanks to Musl being so much smaller than Glibc). We get regular requests, probably more than for any other platform. And several Pandas and SciPy devs seem to want this.
Yes, there is a separate
Only insofar as a separate build of OpenBLAS must be done for this. Which is available - hopefully maintenance of that will be smooth sailing.
Yes - but a separate wheel tag and Linux distro takes care of that. However, what you may be getting at is that one needs a complete collection of
No worries there, all good on the licensing front.
That's actually a common reason for using Musl too. It's not useful for NumPy I'd say, but in general static linking with Musl is a great way to produce binaries that run on any distro (because no dependency on the distro-shipped libc).
That's always a worry, but more so for nonstandard hardware than for something that runs on plain Linux x86-64 and aarch64 instances. So for Musl it should be pretty good compared to our other candidates for inclusion in our zoo of wheels. |
That is what I was thinking, and the license is good for that. Sounds worth a shot, and we will see how downstream develops. Was the intent to have this in the 1.24.x series? I'd rather wait for the 1.25 series, not least because Python 3.8 is dropped and we will have moved to meson. |
I think 1.25 sounds better, it gives time for everything to bed down a little - deal with difficulties being experienced downstream, easing into Meson, etc. |
(I'm ambivalent on releasing musllinux wheels. People were asking for scipy musllinux wheels reasonably regularly, so I implemented because I knew how. Having a numpy musllinux wheel makes downstream CI a bit easier because we don't have to build numpy every single time) |
Marking this for the 1.25.0 release and changing the title to reflect the current state: we have wheels and need to decide whether to upload them to PyPI which would mean committing to continuing to support this platform in the future. |
Let's go for it. Closing. |
Agreed, thanks for finalizing this @mattip. And sorry for not having written the platform support NEP yet (too many NEPs to write!). |
Thanks for this. |
It looks like we have x86-64 wheels only right now, so that should be it for 1.25.0. The demand for aarch64 musllinux support seems smaller, so we'd need to separately assess later. Can you elaborate on how/why you'd use aarch64 wheels? |
Docker/Kubernetes in the Apple m-series processor mac's & Amazon Graviton backed EKS. |
As well as Raspberry Pi clusters. |
@rgommers I don't see |
Raspberry Pi wheels are available from piwheels.org. It's not simple to compile them on CI infrastructure, coz it's not a native platform, and there are several cpu architectures, e.g. armv6, armv7, armv8. It's always a tradeoff between demand and the work required to support a target. |
https://pypi.org/project/numpy/1.25.0rc1/, it is a pre-release. |
@andyfaff I see. But I was asking about |
@charris But then again, this PR was merged. The issue tracker's state suggest the work is finished, but it isn't, is it? The consequence is that in many traplike scenarios, Alpine Linux users will end up compiling NumPy. This greatly lengthens e.g., container build times, which is a substantial cost in time and money. This is why I'm inquiring. |
For the nightly builds https://pypi.anaconda.org/scientific-python-nightly-wheels |
Thanks. Is there a reason why they're not up on PyPI? |
The rc releases are on PyPI. I wouldn't use the staging repo, I delete stuff there on a regular basis once it is put on PyPI. |
Proposed new feature or change:
CI request: build PEP 656-compliant "musllinux" wheels. This will allow easy installation in Alpine Docker images. Mailing list message
The text was updated successfully, but these errors were encountered: