Skip to content
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

Enable aarch64 Linux wheel builds, use cibuildwheel action directly #1472

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

nicholasjng
Copy link
Contributor

This commit enables arm64 Linux wheel builds for Python. It also changes the build procedure on Linux using
cibuildwheel in GitHub Actions. Instead of the more granular, verbose approach that was used until now, we opt for the GitHub Action released by cibuildwheel directly.

We also change the Bazel install procedure in the manylinux Docker container image. Previously, Bazel was installed from an added RHEL repo, since that is the recommended official way of installing Bazel on CentOS platforms.
However, the last successful build available for manylinux2014 has been Bazel 4, which is showing its age with the release of Bazel 6 coming up as of this commit.

After this change, prebuilt Bazel binaries are downloaded using wget directly from the Bazel GitHub release page. Since Bazel is built for both x86 and arm64 on Linux, we immediately gain wheel build support for these architectures. However, since the architecture of the manylinux image is aarch64 instead of arm64, a shell script was added that normalizes aarch64 to arm64, and installs the correct arm64 Bazel binary if necessary.

This commit enables arm64 Linux wheel builds for Python.
It also changes the build procedure on Linux using
cibuildwheel in GitHub Actions. Instead of the more granular, verbose
approach that was used until now, we opt for the GitHub Action released
by cibuildwheel directly.

We also change the Bazel install procedure in the manylinux Docker
container image. Previously, Bazel was installed from an added RHEL repo, since that is
the recommended official way of installing Bazel on CentOS platforms.
However, the last successful build available for manylinux2014 has been Bazel 4,
which is showing its age with the release of Bazel 6 coming up as of this commit.

After this change, prebuilt Bazel binaries are downloaded using
wget directly from the Bazel GitHub release page. Since Bazel is built
for both x86 and arm64 on Linux, we immediately gain wheel build
support for these architectures. However, since the architecture
of the manylinux image is aarch64 instead of arm64,
a shell script was added that normalizes aarch64 to arm64,
and installs the correct arm64 Bazel binary if necessary.
@nicholasjng
Copy link
Contributor Author

nicholasjng commented Aug 20, 2022

As always in PRs like this, a successful wheel building run with this change can be found here:

https://github.com/nicholasjng/benchmark/actions/runs/2895922501

One noticeable downside is that builds using QEMU emulation are much slower, which is why the job ends up in the 30 minute range now. But to me, the added support for ARM Linux is worth it, and wheels are not built that often, anyway.

@dmah42 dmah42 merged commit ff629d8 into google:main Aug 30, 2022
@nicholasjng nicholasjng deleted the inplace-wheels branch September 13, 2022 14:07
dmah42 pushed a commit that referenced this pull request Sep 14, 2022
…1472)

This commit enables arm64 Linux wheel builds for Python.
It also changes the build procedure on Linux using
cibuildwheel in GitHub Actions. Instead of the more granular, verbose
approach that was used until now, we opt for the GitHub Action released
by cibuildwheel directly.

We also change the Bazel install procedure in the manylinux Docker
container image. Previously, Bazel was installed from an added RHEL repo, since that is
the recommended official way of installing Bazel on CentOS platforms.
However, the last successful build available for manylinux2014 has been Bazel 4,
which is showing its age with the release of Bazel 6 coming up as of this commit.

After this change, prebuilt Bazel binaries are downloaded using
wget directly from the Bazel GitHub release page. Since Bazel is built
for both x86 and arm64 on Linux, we immediately gain wheel build
support for these architectures. However, since the architecture
of the manylinux image is aarch64 instead of arm64,
a shell script was added that normalizes aarch64 to arm64,
and installs the correct arm64 Bazel binary if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants