Skip to content

[ci] build aarch64 wheel builds on a real aarch64 machine #6843

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 17 commits into from
Mar 30, 2025

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Feb 28, 2025

fixes #6788

Proposes building manylinux aarch64 wheels on a real aarch64 machine, taking advantage of the new GitHub-hosted Arm runners.

Those wheels are currently built using emulation, on an x86_64 machine. That process, and especially testing in that environment, is super slow... that job takes around 60-90 minutes per run.

Making this change should speed up and simplify LightGBM's CI.... the new job introduced here builds the same wheel, runs MORE tests, and only takes about 15 minutes 😁

Other small changes in this PR:

  • update pydistcheck floor to the latest version (0.9.0)
  • removes unused AZURE local variable in .ci/setup.sh

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🙃 first challenge... actions/checkout@v4 requires GLIBC 2.28, which is too new for manylinux2014.

/__e/node20/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.[21](https://github.com/microsoft/LightGBM/actions/runs/13579891865/job/37963851509#step:3:22)' not found (required by /__e/node20/bin/node)

(build link)

Trying the older version to preserve manylinux_2014 support a bit longer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got around this by using docker run in a run: step, instead of passing the image URI to container:.

That way, actions/checkout runs on the runner which is Ubuntu 24.04, with new-enough GLIBC.

Comment on lines -260 to -264
export PATH=\$CONDA/bin:/opt/rh/llvm-toolset-7.0/root/usr/bin:\$PATH
export LD_LIBRARY_PATH=/opt/rh/llvm-toolset-7.0/root/usr/lib64:\$LD_LIBRARY_PATH
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I intentionally did not preserve this in the workflow. It shouldn't be necessary.

docker run \
  --rm \
  -it lightgbm/vsts-agent:manylinux2014_aarch64 \
  bash

echo $PATH
# /opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bi

echo $LD_LIBRARY_PATH
# /opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/usr/local/lib64

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can see that the correct compiler (gcc) is being used:

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rh/devtoolset-10/root/usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/devtoolset-10/root/usr/bin/g++ - skipped

(build link)

@jameslamb jameslamb changed the title WIP: [ci] build aarch64 wheel builds on a real aarch64 machine [ci] build aarch64 wheel builds on a real aarch64 machine Feb 28, 2025
@jameslamb jameslamb marked this pull request as ready for review February 28, 2025 05:34
pytest.mark.skipif(
getenv("LGBM_SKIP_DASK_TESTS", "") == "true",
reason="Skipping lightgbm.dask tests (found env variable LGBM_SKIP_DASK_TESTS=true)",
),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jameslamb
Copy link
Collaborator Author

@StrikerRUS the next time you have a bit of time to work on LightGBM, could you please review this PR?

I've been seeing failures in the QEMU job (#6874) and would love to just merge this and not have to investigate them 😅

@jameslamb
Copy link
Collaborator Author

Does anyone have time to review this this week? I think it's valuable on its own, and more importantly this + #6872 would help unblock CI and get development flowing here again.

cc @StrikerRUS @jmoralez @borchero @shiyu1994 @guolinke

@jameslamb
Copy link
Collaborator Author

Thank you! I'm going to merge this to help unblock CI. I'd be happy to make any changes in a follow-up if others find time to review later and have concerns.

@jameslamb jameslamb merged commit 82c85e4 into master Mar 30, 2025
51 checks passed
@jameslamb jameslamb deleted the ci/native-aarch64-builds branch March 30, 2025 16:13
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

I'm so sorry for the late review! Everything looks good to me! Great job, @jameslamb !

I just added the following line to the v4.6.0 release to not forget this in the future release

[ ] Manually attach aarch64 Linux wheel to the release

@jameslamb
Copy link
Collaborator Author

Thank you so much! Good idea adding that to the release checklist.

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.

[ci] use real aarch64 runners instead of emulation with QEMU
3 participants