[CI] Add CI pipeline to build libxgboost4j.so targeting Linux ARM64 (#10487)

This commit is contained in:
Philip Hyunsu Cho
2024-06-26 01:43:15 -07:00
committed by GitHub
parent 4abf24aa4f
commit 08658b124d
9 changed files with 158 additions and 43 deletions

View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -euo pipefail
source tests/buildkite/conftest.sh
command_wrapper="tests/ci_build/ci_build.sh jvm_manylinux2014_aarch64"
# Build XGBoost4J binary
echo "--- Build libxgboost4j.so (targeting glibc 2.17)"
set -x
mkdir build
$command_wrapper bash -c \
"cd build && cmake .. -DJVM_BINDINGS=ON -DUSE_OPENMP=ON && make -j$(nproc)"
ldd lib/libxgboost4j.so
objdump -T lib/libxgboost4j.so | grep GLIBC_ | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
echo "--- Upload libxgboost4j.so"
pushd lib
libname=libxgboost4j_linux_arm64_${BUILDKITE_COMMIT}.so
mv -v libxgboost4j.so ${libname}
buildkite-agent artifact upload ${libname}
#if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
#then
aws s3 cp ${libname} \
s3://xgboost-nightly-builds/${BRANCH_NAME}/libxgboost4j/ \
--acl public-read --no-progress
#fi
popd

View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -euo pipefail
source tests/buildkite/conftest.sh
command_wrapper="tests/ci_build/ci_build.sh jvm_manylinux2014_x86_64"
# Build XGBoost4J binary
echo "--- Build libxgboost4j.so (targeting glibc 2.17)"
set -x
mkdir build
$command_wrapper bash -c \
"cd build && cmake .. -GNinja -DJVM_BINDINGS=ON -DUSE_OPENMP=ON && ninja -v"
ldd lib/libxgboost4j.so
objdump -T lib/libxgboost4j.so | grep GLIBC_ | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu
echo "--- Upload libxgboost4j.so"
pushd lib
libname=libxgboost4j_linux_x86_64_${BUILDKITE_COMMIT}.so
mv -v libxgboost4j.so ${libname}
buildkite-agent artifact upload ${libname}
#if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
#then
aws s3 cp ${libname} \
s3://xgboost-nightly-builds/${BRANCH_NAME}/libxgboost4j/ \
--acl public-read --no-progress
#fi
popd

View File

@@ -0,0 +1,41 @@
#!/bin/bash
set -euo pipefail
source tests/buildkite/conftest.sh
# Display system info
echo "--- Display system information"
set -x
system_profiler SPSoftwareDataType
sysctl -n machdep.cpu.brand_string
uname -m
set +x
# Build XGBoost4J binary
echo "--- Build libxgboost4j.dylib"
set -x
mkdir build
pushd build
export JAVA_HOME=$(/usr/libexec/java_home)
cmake .. -GNinja -DJVM_BINDINGS=ON -DUSE_OPENMP=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
ninja -v
popd
rm -rf build
otool -L lib/libxgboost.dylib
set +x
echo "--- Upload libxgboost4j.dylib"
set -x
pushd lib
libname=libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib
mv -v libxgboost4j.dylib ${libname}
buildkite-agent artifact upload ${libname}
#if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
#then
aws s3 cp ${libname} \
s3://xgboost-nightly-builds/${BRANCH_NAME}/libxgboost4j/ \
--acl public-read --no-progress
#fi
popd
set +x

View File

@@ -1,6 +1,11 @@
steps:
- block: ":rocket: Run this test job"
if: build.pull_request.id != null || build.branch =~ /^dependabot\//
- label: ":macos: Build libxgboost4j.dylib for MacOS M1"
command: "tests/buildkite/build-jvm-macos-m1.sh"
key: mac-m1-jvm
agents:
queue: mac-mini-m1
- label: ":macos: Build and Test XGBoost for MacOS M1 with Clang 11"
command: "tests/buildkite/test-macos-m1-clang11.sh"
key: mac-m1-appleclang11

View File

@@ -56,6 +56,16 @@ steps:
key: build-jvm-packages
agents:
queue: linux-amd64-cpu
- label: ":console: Build libxgboost4j.so for Linux ARM64 (targeting glibc 2.17)"
command: "tests/buildkite/build-jvm-linux-arm64-manylinux2014.sh"
key: build-jvm-linux-arm64-manylinux2014
agents:
queue: linux-arm64-cpu
- label: ":console: Build libxgboost4j.so for Linux x86_64 (targeting glibc 2.17)"
command: "tests/buildkite/build-jvm-linux-x86_64-manylinux2014.sh"
key: build-jvm-linux-x86_64-manylinux2014
agents:
queue: linux-amd64-cpu
- label: ":console: Build JVM package doc"
command: "tests/buildkite/build-jvm-doc.sh"
key: build-jvm-doc

View File

@@ -12,33 +12,6 @@ sysctl -n machdep.cpu.brand_string
uname -m
set +x
# Build XGBoost4J binary
echo "--- Build libxgboost4j.dylib"
set -x
mkdir build
pushd build
export JAVA_HOME=$(/usr/libexec/java_home)
cmake .. -GNinja -DJVM_BINDINGS=ON -DUSE_OPENMP=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
ninja -v
popd
rm -rf build
otool -L lib/libxgboost.dylib
set +x
echo "--- Upload Python wheel"
set -x
pushd lib
mv -v libxgboost4j.dylib libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib
buildkite-agent artifact upload libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib
if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
then
aws s3 cp libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib \
s3://xgboost-nightly-builds/${BRANCH_NAME}/libxgboost4j/ \
--acl public-read --no-progress
fi
popd
set +x
# Ensure that XGBoost can be built with Clang 11
echo "--- Build and Test XGBoost with MacOS M1, Clang 11"
set -x
@@ -49,3 +22,4 @@ cmake .. -GNinja -DCMAKE_C_COMPILER=${LLVM11_PATH}/bin/clang \
-DCMAKE_CXX_COMPILER=${LLVM11_PATH}/bin/clang++ -DGOOGLE_TEST=ON \
-DUSE_DMLC_GTEST=ON
ninja -v
./testxgboost