Skip to content

Commit

Permalink
use arm64 linux runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Congyuwang committed Nov 2, 2024
1 parent 1b86eb2 commit ddc50ae
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 82 deletions.
102 changes: 61 additions & 41 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
py_version:
[3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -64,7 +65,8 @@ jobs:
fail-fast: false
matrix:
target: [x64]
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
py_version:
[3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -192,8 +194,8 @@ jobs:
name: wheels-manylinux2014-${{ matrix.target }}
path: dist

linux-cross:
runs-on: ubuntu-latest
manylinux_2_28_arm64:
runs-on: linux-arm64
strategy:
fail-fast: false
matrix:
Expand All @@ -205,57 +207,75 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: arm64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: 1.82.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2_28
manylinux: 2014
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
container: congyuwang/manylinux_2_28_aarch64:llvm-19.1.3
docker-options: "-e BINDGEN_EXTRA_CLANG_ARGS"
before-script-linux: |
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/7.5.0/crtbeginS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtbeginS.o
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/7.5.0/crtendS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtendS.o
env:
LIBCLANG_PATH: /usr/local/lib
CC_aarch64_unknown_linux_gnu: /usr/local/bin/clang
CXX_aarch64_unknown_linux_gnu: /usr/local/bin/clang++
AR_aarch64_unknown_linux_gnu: /usr/local/bin/llvm-ar
CFLAGS_aarch64_unknown_linux_gnu: >
-flto=thin -O3 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
CXXFLAGS_aarch64_unknown_linux_gnu: >
-flto=thin -O3 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
-I /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/include/c++/7.5.0/
-I /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/include/c++/7.5.0/aarch64-unknown-linux-gnu/
BINDGEN_EXTRA_CLANG_ARGS: >
--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: >
/usr/local/bin/clang
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: >
-Clinker-plugin-lto
-Clinker=/usr/local/bin/clang
-Clink-arg=-fuse-ld=/usr/local/bin/ld.lld
-Clink-arg=--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
- uses: uraimo/run-on-arch-action@v2
name: Install built wheel and test
CC: /usr/local/bin/clang
CXX: /usr/local/bin/clang++
AR: /usr/local/bin/llvm-ar
CFLAGS: "-flto=thin -O3"
CXXFLAGS: "-flto=thin -O3"
RUSTFLAGS: "-Clinker-plugin-lto -Clinker=/usr/local/bin/clang -Clink-arg=-fuse-ld=/usr/local/bin/ld.lld"
- name: Install built wheel and test
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
pip install speedict --no-index --find-links dist --force-reinstall || true
python -m unittest discover -v test
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-manylinux_2_28-${{ matrix.target }}
path: dist

manylinux2014_arm64:
runs-on: linux-arm64
strategy:
fail-fast: false
matrix:
target: [aarch64]
steps:
- uses: actions/checkout@v2
with:
arch: ${{ matrix.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
run: |
pip3 install rocksdict --no-index --find-links dist --force-reinstall || true
pip3 install speedict --no-index --find-links dist --force-reinstall || true
python3 -m unittest discover -v test
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: arm64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: 1.82.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2014
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
container: congyuwang/manylinux2014_aarch64:llvm-19.1.3
env:
LIBCLANG_PATH: /usr/local/lib
CC: /usr/local/bin/clang
CXX: /usr/local/bin/clang++
AR: /usr/local/bin/llvm-ar
CFLAGS: "-flto=thin -O3"
CXXFLAGS: "-flto=thin -O3"
RUSTFLAGS: "-Clinker-plugin-lto -Clinker=/usr/local/bin/clang -Clink-arg=-fuse-ld=/usr/local/bin/ld.lld"
- name: Install built wheel and test
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
pip install speedict --no-index --find-links dist --force-reinstall || true
python -m unittest discover -v test
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-cross-${{ matrix.target }}
name: wheels-manylinux_2014-${{ matrix.target }}
path: dist

release:
Expand Down
102 changes: 61 additions & 41 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
py_version:
[3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -64,7 +65,8 @@ jobs:
fail-fast: false
matrix:
target: [x64]
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
py_version:
[3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -192,8 +194,8 @@ jobs:
name: wheels-manylinux2014-${{ matrix.target }}
path: dist

linux-cross:
runs-on: ubuntu-latest
manylinux_2_28_arm64:
runs-on: linux-arm64
strategy:
fail-fast: false
matrix:
Expand All @@ -205,55 +207,73 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: arm64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: 1.82.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2_28
manylinux: 2014
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
container: congyuwang/manylinux_2_28_aarch64:llvm-19.1.3
docker-options: "-e BINDGEN_EXTRA_CLANG_ARGS"
before-script-linux: |
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/7.5.0/crtbeginS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtbeginS.o
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/7.5.0/crtendS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtendS.o
env:
LIBCLANG_PATH: /usr/local/lib
CC_aarch64_unknown_linux_gnu: /usr/local/bin/clang
CXX_aarch64_unknown_linux_gnu: /usr/local/bin/clang++
AR_aarch64_unknown_linux_gnu: /usr/local/bin/llvm-ar
CFLAGS_aarch64_unknown_linux_gnu: >
-flto=thin -O3 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
CXXFLAGS_aarch64_unknown_linux_gnu: >
-flto=thin -O3 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
-I /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/include/c++/7.5.0/
-I /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/include/c++/7.5.0/aarch64-unknown-linux-gnu/
BINDGEN_EXTRA_CLANG_ARGS: >
--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: >
/usr/local/bin/clang
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: >
-Clinker-plugin-lto
-Clinker=/usr/local/bin/clang
-Clink-arg=-fuse-ld=/usr/local/bin/ld.lld
-Clink-arg=--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/
- uses: uraimo/run-on-arch-action@v2
name: Install built wheel and test
CC: /usr/local/bin/clang
CXX: /usr/local/bin/clang++
AR: /usr/local/bin/llvm-ar
CFLAGS: "-flto=thin -O3"
CXXFLAGS: "-flto=thin -O3"
RUSTFLAGS: "-Clinker-plugin-lto -Clinker=/usr/local/bin/clang -Clink-arg=-fuse-ld=/usr/local/bin/ld.lld"
- name: Install built wheel and test
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
pip install speedict --no-index --find-links dist --force-reinstall || true
python -m unittest discover -v test
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-manylinux_2_28-${{ matrix.target }}
path: dist

manylinux2014_arm64:
runs-on: linux-arm64
strategy:
fail-fast: false
matrix:
target: [aarch64]
steps:
- uses: actions/checkout@v2
with:
arch: ${{ matrix.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
run: |
pip3 install rocksdict --no-index --find-links dist --force-reinstall || true
pip3 install speedict --no-index --find-links dist --force-reinstall || true
python3 -m unittest discover -v test
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: arm64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: 1.82.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2014
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10'
container: congyuwang/manylinux2014_aarch64:llvm-19.1.3
env:
LIBCLANG_PATH: /usr/local/lib
CC: /usr/local/bin/clang
CXX: /usr/local/bin/clang++
AR: /usr/local/bin/llvm-ar
CFLAGS: "-flto=thin -O3"
CXXFLAGS: "-flto=thin -O3"
RUSTFLAGS: "-Clinker-plugin-lto -Clinker=/usr/local/bin/clang -Clink-arg=-fuse-ld=/usr/local/bin/ld.lld"
- name: Install built wheel and test
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
pip install speedict --no-index --find-links dist --force-reinstall || true
python -m unittest discover -v test
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-cross-${{ matrix.target }}
name: wheels-manylinux_2014-${{ matrix.target }}
path: dist

0 comments on commit ddc50ae

Please sign in to comment.