Skip to content

Commit

Permalink
[CI] Add CI pipeline to build libxgboost4j.so targeting Linux ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jun 25, 2024
1 parent bd253b2 commit fbd9a34
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
28 changes: 28 additions & 0 deletions tests/buildkite/build-jvm-linux-arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -euo pipefail

source tests/buildkite/conftest.sh

command_wrapper="tests/ci_build/ci_build.sh aarch64"

# Build XGBoost4J binary
echo "--- Build libxgboost4j.so"
set -x
mkdir build
$command_wrapper bash -c \
"cd build && cmake .. -GNinja -DJVM_BINDINGS=ON -DUSE_OPENMP=ON && ninja -v"
ldd lib/libxgboost4j.so

echo "--- Upload libxgboost4j.dylib"
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
7 changes: 4 additions & 3 deletions tests/buildkite/build-jvm-macos-m1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ set +x
echo "--- Upload libxgboost4j.dylib"
set -x
pushd lib
mv -v libxgboost4j.dylib libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib
buildkite-agent artifact upload libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib
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 libxgboost4j_m1_${BUILDKITE_COMMIT}.dylib \
aws s3 cp ${libname} \
s3://xgboost-nightly-builds/${BRANCH_NAME}/libxgboost4j/ \
--acl public-read --no-progress
#fi
Expand Down
2 changes: 1 addition & 1 deletion tests/buildkite/pipeline-mac-m1.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- block: ":rocket: Run this test job"
if: build.pull_request.id != null || build.branch =~ /^dependabot\//
- label: ":macos: Build XGBoost4J for MacOS M1"
- label: ":macos: Build libxgboost4j.dylib for MacOS M1"
command: "tests/buildkite/build-jvm-macos-m1.sh"
key: mac-m1-jvm
agents:
Expand Down
5 changes: 5 additions & 0 deletions tests/buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ steps:
key: build-jvm-packages
agents:
queue: linux-amd64-cpu
- label: ":console: Build libxgboost4j.so for Linux ARM64"
command: "tests/buildkite/build-jvm-linux-arm64.sh"
key: build-jvm-linux-arm64
agents:
queue: linux-arm64-cpu
- label: ":console: Build JVM package doc"
command: "tests/buildkite/build-jvm-doc.sh"
key: build-jvm-doc
Expand Down
2 changes: 1 addition & 1 deletion tests/ci_build/Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN \
dnf -y update && \
dnf -y install dnf-plugins-core && \
dnf config-manager --set-enabled powertools && \
dnf install -y tar unzip wget xz git which ninja-build gcc-toolset-10-gcc gcc-toolset-10-binutils gcc-toolset-10-gcc-c++ && \
dnf install -y tar unzip wget xz git which ninja-build gcc-toolset-10-gcc gcc-toolset-10-binutils gcc-toolset-10-gcc-c++ java-1.8.0-openjdk-devel && \
# Python
wget -nv -O conda.sh https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh && \
bash conda.sh -b -p /opt/miniforge
Expand Down

0 comments on commit fbd9a34

Please sign in to comment.