Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
82c85e40
"src/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "429148309a7912754b89dfda78f01f39df17be3f"
Unverified
Commit
82c85e40
authored
Mar 30, 2025
by
James Lamb
Committed by
GitHub
Mar 30, 2025
Browse files
[ci] build aarch64 wheel builds on a real aarch64 machine (#6843)
parent
6437645c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
89 deletions
+55
-89
.ci/setup.sh
.ci/setup.sh
+0
-1
.github/workflows/python_package.yml
.github/workflows/python_package.yml
+55
-8
.vsts-ci.yml
.vsts-ci.yml
+0
-76
tests/python_package_test/test_dask.py
tests/python_package_test/test_dask.py
+0
-4
No files found.
.ci/setup.sh
View file @
82c85e40
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
set
-e
-E
-u
-o
pipefail
set
-e
-E
-u
-o
pipefail
# defaults
# defaults
AZURE
=
${
AZURE
:-
"false"
}
IN_UBUNTU_BASE_CONTAINER
=
${
IN_UBUNTU_BASE_CONTAINER
:-
"false"
}
IN_UBUNTU_BASE_CONTAINER
=
${
IN_UBUNTU_BASE_CONTAINER
:-
"false"
}
SETUP_CONDA
=
${
SETUP_CONDA
:-
"true"
}
SETUP_CONDA
=
${
SETUP_CONDA
:-
"true"
}
...
...
.github/workflows/python_package.yml
View file @
82c85e40
...
@@ -18,7 +18,54 @@ env:
...
@@ -18,7 +18,54 @@ env:
SKBUILD_STRICT_CONFIG
:
true
SKBUILD_STRICT_CONFIG
:
true
jobs
:
jobs
:
test
:
test-linux-aarch64
:
name
:
bdist wheel (ubuntu-24.04-arm)
runs-on
:
ubuntu-24.04-arm
timeout-minutes
:
60
steps
:
-
name
:
Checkout repository
uses
:
actions/checkout@v4
with
:
fetch-depth
:
5
submodules
:
true
-
name
:
Setup and run tests
shell
:
bash
# this uses 'docker run' instead of just setting 'container:'
# because actions/checkout requires GLIBC 2.28 and that is too
# new for manylinux2014
env
:
BUILD_DIRECTORY
:
/LightGBM
run
:
|
cat > ./docker-script.sh <<EOF
mkdir -p \$BUILD_ARTIFACTSTAGINGDIRECTORY
export CONDA=\$HOME/miniforge
export PATH=\$CONDA/bin:\$PATH
${{ env.BUILD_DIRECTORY }}/.ci/setup.sh || exit 1
${{ env.BUILD_DIRECTORY }}/.ci/test.sh || exit 1
EOF
IMAGE_URI="lightgbm/vsts-agent:manylinux2014_aarch64"
docker pull "${IMAGE_URI}" || exit 1
docker run \
--platform "${PLATFORM}" \
--rm \
--env BUILD_DIRECTORY=${{ env.BUILD_DIRECTORY }} \
--env BUILD_ARTIFACTSTAGINGDIRECTORY=${{ env.BUILD_DIRECTORY }}/artifacts/ \
--env COMPILER=gcc \
--env METHOD=wheel \
--env OS_NAME=linux \
--env PRODUCES_ARTIFACTS=true \
--env PYTHON_VERSION="3.13" \
--env TASK=bdist \
-v "${PWD}":"${{ env.BUILD_DIRECTORY }}" \
-w ${{ env.BUILD_DIRECTORY }} \
"${IMAGE_URI}" \
/bin/bash ./docker-script.sh
-
name
:
upload wheels
uses
:
actions/upload-artifact@v4
with
:
name
:
linux-aarch64-wheel
path
:
artifacts/*.whl
test-macos
:
name
:
${{ matrix.task }} ${{ matrix.method }} (${{ matrix.os }}, Python ${{ matrix.python_version }})
name
:
${{ matrix.task }} ${{ matrix.method }} (${{ matrix.os }}, Python ${{ matrix.python_version }})
runs-on
:
${{ matrix.os }}
runs-on
:
${{ matrix.os }}
timeout-minutes
:
60
timeout-minutes
:
60
...
@@ -65,17 +112,13 @@ jobs:
...
@@ -65,17 +112,13 @@ jobs:
run
:
|
run
:
|
export TASK="${{ matrix.task }}"
export TASK="${{ matrix.task }}"
export METHOD="${{ matrix.method }}"
export METHOD="${{ matrix.method }}"
export OS_NAME="macos"
export PYTHON_VERSION="${{ matrix.python_version }}"
export PYTHON_VERSION="${{ matrix.python_version }}"
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
# use clang when creating macOS release artifacts
# use clang when creating macOS release artifacts
export COMPILER="clang"
export COMPILER="clang"
export OS_NAME="macos"
else
elif [[ "${{ matrix.os }}" == "macos-13" ]]; then
export COMPILER="gcc"
export COMPILER="gcc"
export OS_NAME="macos"
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
export COMPILER="clang"
export OS_NAME="linux"
fi
fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export CONDA=${HOME}/miniforge
export CONDA=${HOME}/miniforge
...
@@ -152,7 +195,11 @@ jobs:
...
@@ -152,7 +195,11 @@ jobs:
all-python-package-jobs-successful
:
all-python-package-jobs-successful
:
if
:
always()
if
:
always()
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
needs
:
[
test
,
test-latest-versions
,
test-old-versions
]
needs
:
-
test-latest-versions
-
test-macos
-
test-linux-aarch64
-
test-old-versions
steps
:
steps
:
-
name
:
Note that all tests succeeded
-
name
:
Note that all tests succeeded
uses
:
re-actors/alls-green@v1.2.2
uses
:
re-actors/alls-green@v1.2.2
...
...
.vsts-ci.yml
View file @
82c85e40
...
@@ -223,81 +223,6 @@ jobs:
...
@@ -223,81 +223,6 @@ jobs:
inputs
:
inputs
:
filePath
:
$(Build.SourcesDirectory)/.ci/test.sh
filePath
:
$(Build.SourcesDirectory)/.ci/test.sh
targetType
:
'
filePath'
targetType
:
'
filePath'
##################
# QEMU_multiarch #
##################
-
job
:
QEMU_multiarch
variables
:
BUILD_DIRECTORY
:
/LightGBM
COMPILER
:
gcc
PRODUCES_ARTIFACTS
:
'
true'
pool
:
vmImage
:
ubuntu-22.04
timeoutInMinutes
:
180
strategy
:
matrix
:
bdist
:
TASK
:
bdist
ARCH
:
aarch64
steps
:
-
script
:
|
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
binfmt-support \
qemu \
qemu-user \
qemu-user-static
displayName
:
'
Install
QEMU'
-
script
:
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
displayName
:
'
Enable
Docker
multi-architecture
support'
-
script
:
|
git clean -d -f -x
displayName
:
'
Clean
source
directory'
# LGBM_SKIP_DASK_TESTS=true is set below only because running the tests under emulation is so slow...
# in theory, 'lightgbm.dask' should work without issue on aarch64 Linux systems.
# That could probably be removed as part of https://github.com/microsoft/LightGBM/issues/6788
-
script
:
|
cat > docker-script.sh <<EOF
export CONDA=\$HOME/miniforge
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
\$BUILD_DIRECTORY/.ci/setup.sh || exit 1
\$BUILD_DIRECTORY/.ci/test.sh || exit 1
EOF
IMAGE_URI="lightgbm/vsts-agent:manylinux2014_aarch64"
docker pull "${IMAGE_URI}" || exit 1
PLATFORM=$(docker inspect --format='{{.Os}}/{{.Architecture}}' "${IMAGE_URI}") || exit 1
echo "detected image platform: ${PLATFORM}"
docker run \
--platform "${PLATFORM}" \
--rm \
--env AZURE=true \
--env BUILD_ARTIFACTSTAGINGDIRECTORY=$BUILD_ARTIFACTSTAGINGDIRECTORY \
--env BUILD_DIRECTORY=$BUILD_DIRECTORY \
--env COMPILER=$COMPILER \
--env LGBM_SKIP_DASK_TESTS=true \
--env METHOD=$METHOD \
--env OS_NAME=linux \
--env PRODUCES_ARTIFACTS=$PRODUCES_ARTIFACTS \
--env PYTHON_VERSION=$PYTHON_VERSION \
--env TASK=$TASK \
-v "$(Build.SourcesDirectory)":"$BUILD_DIRECTORY" \
-v "$(Build.ArtifactStagingDirectory)":"$(Build.ArtifactStagingDirectory)" \
"${IMAGE_URI}" \
/bin/bash $BUILD_DIRECTORY/docker-script.sh
displayName
:
'
Setup
and
run
tests'
-
task
:
PublishBuildArtifacts@1
condition
:
>
and(
succeeded(),
in(variables['TASK'], 'bdist'),
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
)
inputs
:
pathtoPublish
:
'
$(Build.ArtifactStagingDirectory)'
artifactName
:
PackageAssets
artifactType
:
container
#########
#########
# macOS #
# macOS #
#########
#########
...
@@ -441,7 +366,6 @@ jobs:
...
@@ -441,7 +366,6 @@ jobs:
dependsOn
:
dependsOn
:
-
Linux
-
Linux
-
Linux_latest
-
Linux_latest
-
QEMU_multiarch
-
macOS
-
macOS
-
Windows
-
Windows
-
R_artifact
-
R_artifact
...
...
tests/python_package_test/test_dask.py
View file @
82c85e40
...
@@ -55,10 +55,6 @@ pytestmark = [
...
@@ -55,10 +55,6 @@ pytestmark = [
pytest
.
mark
.
skipif
(
getenv
(
"TASK"
,
""
)
==
"mpi"
,
reason
=
"Fails to run with MPI interface"
),
pytest
.
mark
.
skipif
(
getenv
(
"TASK"
,
""
)
==
"mpi"
,
reason
=
"Fails to run with MPI interface"
),
pytest
.
mark
.
skipif
(
getenv
(
"TASK"
,
""
)
==
"gpu"
,
reason
=
"Fails to run with GPU interface"
),
pytest
.
mark
.
skipif
(
getenv
(
"TASK"
,
""
)
==
"gpu"
,
reason
=
"Fails to run with GPU interface"
),
pytest
.
mark
.
skipif
(
getenv
(
"TASK"
,
""
)
==
"cuda"
,
reason
=
"Fails to run with CUDA interface"
),
pytest
.
mark
.
skipif
(
getenv
(
"TASK"
,
""
)
==
"cuda"
,
reason
=
"Fails to run with CUDA interface"
),
pytest
.
mark
.
skipif
(
getenv
(
"LGBM_SKIP_DASK_TESTS"
,
""
)
==
"true"
,
reason
=
"Skipping lightgbm.dask tests (found env variable LGBM_SKIP_DASK_TESTS=true)"
,
),
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment