Skip to content

Commit db3d098

Browse files
committed
[CI] Use native runner to build CPack for arm64
1 parent d5d0cde commit db3d098

File tree

4 files changed

+67
-40
lines changed

4 files changed

+67
-40
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: cpack-builder
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: "0 7 * * *" # Run once daily
8+
9+
permissions:
10+
contents: read
11+
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: true
19+
20+
env:
21+
COMMIT_ID: ${{ github.sha }}
22+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }}
23+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }}
24+
25+
jobs:
26+
cpack-builder:
27+
name: Build CPack
28+
runs-on: ${{ matrix.runner }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
- arch: aarch64
34+
runner: ubuntu-24.04-arm
35+
- arch: amd64
36+
runner: ubuntu-24.04
37+
steps:
38+
- uses: actions/checkout@v2
39+
with:
40+
submodules: 'true'
41+
- uses: conda-incubator/setup-miniconda@v3
42+
with:
43+
miniforge-variant: Miniforge3
44+
miniforge-version: latest
45+
activate-environment: dev
46+
environment-file: ops/conda_env/dev.yml
47+
use-mamba: true
48+
- name: Build CPack
49+
run: |
50+
bash ops/build-cpack.sh ${{ matrix.arch }}

.github/workflows/linux-wheel-builder.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,3 @@ jobs:
5959
- name: Test wheel
6060
run: |
6161
bash ops/test-linux-python-wheel.sh
62-
63-
cpack-builder:
64-
name: Build CPack
65-
runs-on: ubuntu-latest
66-
steps:
67-
- uses: actions/checkout@v2
68-
with:
69-
submodules: 'true'
70-
- uses: conda-incubator/setup-miniconda@v3
71-
with:
72-
miniforge-variant: Miniforge3
73-
miniforge-version: latest
74-
activate-environment: dev
75-
environment-file: ops/conda_env/dev.yml
76-
use-mamba: true
77-
- uses: dbhi/qus/action@main
78-
with:
79-
targets: aarch64
80-
- name: Build CPack
81-
run: |
82-
bash ops/build-cpack.sh

ops/build-cpack.sh

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,29 @@
22

33
set -euo pipefail
44

5-
echo "##[section] Building Treelite for amd64..."
6-
tests/ci_build/ci_build.sh ubuntu20 tests/ci_build/build_via_cmake.sh
5+
if [[ -z "${COMMIT_ID:-}" ]]
6+
then
7+
echo "Make sure to set environment variable COMMIT_ID"
8+
exit 1
9+
fi
710

8-
echo "##[section] Packing CPack for amd64..."
9-
tests/ci_build/ci_build.sh ubuntu20 bash -c "cd build/ && cpack -G TGZ"
10-
for tgz in build/treelite-*-Linux.tar.gz
11-
do
12-
mv -v "${tgz}" "${tgz%-Linux.tar.gz}+${COMMIT_ID}-Linux-amd64.tar.gz"
13-
done
14-
15-
echo "##[section]Uploading CPack for amd64..."
16-
python -m awscli s3 cp build/*.tar.gz s3://treelite-cpack/ --acl public-read --region us-west-2 || true
11+
if [[ "$#" -lt 1 ]]
12+
then
13+
echo "Usage: $0 {amd64,aarch64}"
14+
exit 2
15+
fi
1716

18-
rm -rf build/
17+
arch="$1"
1918

20-
echo "##[section] Building Treelite for aarch64..."
21-
export DOCKER_DEFAULT_PLATFORM=linux/arm64/v8
22-
tests/ci_build/ci_build.sh ubuntu20_aarch64 tests/ci_build/build_via_cmake.sh
19+
echo "##[section] Building Treelite for ${arch}..."
20+
tests/ci_build/ci_build.sh ubuntu20_${arch} tests/ci_build/build_via_cmake.sh
2321

24-
echo "##[section] Packing CPack for aarch64..."
25-
tests/ci_build/ci_build.sh ubuntu20_aarch64 bash -c "cd build/ && cpack -G TGZ"
22+
echo "##[section] Packing CPack for ${arch}..."
23+
tests/ci_build/ci_build.sh ubuntu20_${arch} bash -c "cd build/ && cpack -G TGZ"
2624
for tgz in build/treelite-*-Linux.tar.gz
2725
do
28-
mv -v "${tgz}" "${tgz%-Linux.tar.gz}+${COMMIT_ID}-Linux-aarch64.tar.gz"
26+
mv -v "${tgz}" "${tgz%-Linux.tar.gz}+${COMMIT_ID}-Linux-${arch}.tar.gz"
2927
done
3028

31-
echo "##[section]Uploading CPack for aarch64..."
29+
echo "##[section]Uploading CPack for ${arch}..."
3230
python -m awscli s3 cp build/*.tar.gz s3://treelite-cpack/ --acl public-read --region us-west-2 || true

0 commit comments

Comments
 (0)