Skip to content

Commit 80b2195

Browse files
authored
build linux-aarch64 wheel on self-hosted runner (#2851)
..., which should be much faster than using QEMU on x86. The runner is a free Oracle ARM Ampere A1 Compute instance. --------- Signed-off-by: Jinzhe Zeng <[email protected]>
1 parent 955df79 commit 80b2195

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/build_wheel.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,24 @@ on:
55
pull_request:
66

77
jobs:
8+
determine-arm64-runner:
9+
runs-on: ubuntu-latest
10+
permissions: read-all
11+
outputs:
12+
runner: ${{ steps.set-runner.outputs.runner }}
13+
steps:
14+
- name: Determine which runner to use for ARM64 build
15+
id: set-runner
16+
run: |
17+
if [ "${{ github.repository_owner }}" == "deepmodeling" ]; then
18+
echo "runner=[\"Linux\",\"ARM64\"]" >> $GITHUB_OUTPUT
19+
else
20+
echo "runner=\"ubuntu-latest\"" >> $GITHUB_OUTPUT
21+
fi
22+
823
build_wheels:
924
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
25+
needs: determine-arm64-runner
1026
runs-on: ${{ matrix.os }}
1127
strategy:
1228
fail-fast: false
@@ -33,7 +49,7 @@ jobs:
3349
platform_id: win_amd64
3450
dp_variant: cpu
3551
# linux-aarch64
36-
- os: ubuntu-latest
52+
- os: ${{ fromJson(needs.determine-arm64-runner.outputs.runner) }}
3753
python: 310
3854
platform_id: manylinux_aarch64
3955
dp_variant: cpu
@@ -45,7 +61,7 @@ jobs:
4561
fetch-depth: 0
4662
- uses: docker/setup-qemu-action@v3
4763
name: Setup QEMU
48-
if: matrix.platform_id == 'manylinux_aarch64'
64+
if: matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest'
4965
- name: Build wheels
5066
uses: pypa/[email protected]
5167
env:

0 commit comments

Comments
 (0)