Skip to content

Feature/aarch wheels #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 77 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d90d786
Update Maturin to 1.2.3
Adoni5 Aug 29, 2023
7c53bc9
Remove emscriptem job
Adoni5 Aug 29, 2023
4f8f126
Clippy said no to casting a pointer to a pointer
Adoni5 Aug 29, 2023
19802b7
Drop support for 32 bit architecture
Adoni5 Aug 29, 2023
292300c
Drop minimap2-sys dependency, as it comes with minimap2?
Adoni5 Aug 29, 2023
00c3156
i was wrong, update minimap2-sys to 0.1.15
Adoni5 Aug 29, 2023
a5140e4
Don't build aarch64 linux wheels (for the mo)
Adoni5 Aug 29, 2023
d20f80c
Drop armv7 for now as well
Adoni5 Aug 29, 2023
eaa3519
Down goes windows
Adoni5 Aug 29, 2023
d844a8d
Add tests and build wheels for py3.8..11
Adoni5 Aug 29, 2023
dcd593e
Merge branch 'main' into feature/aarch-wheels
Adoni5 Aug 29, 2023
c9755e4
Remove --find-interpreter flag for macOS
Adoni5 Aug 29, 2023
954e2f3
End my life ( pip install mappy-rs NOT dissimilar)
Adoni5 Aug 29, 2023
65fc02e
Only run tests on x86_64 MACOS and LInux
Adoni5 Aug 29, 2023
cf6c1c6
Deployment target for MACOS is now 12.0
Adoni5 Aug 29, 2023
22645a0
No deployment target is a good deployment target
Adoni5 Aug 29, 2023
f99b5f8
Remote local versions to debug compialtion on arrch
Adoni5 Aug 29, 2023
d95b23f
wat
Adoni5 Aug 29, 2023
512d4e4
playing with remotes
Adoni5 Aug 29, 2023
909e417
Add simde feature
Adoni5 Aug 29, 2023
991ca9f
Add development submodule for minimap2-rs
Adoni5 Aug 30, 2023
2cddfc8
submodules init in actions
Adoni5 Aug 30, 2023
018856e
Also checkout check tests
Adoni5 Aug 30, 2023
d7db793
Sdist chckout submodules
Adoni5 Aug 30, 2023
d31feee
Add aarch64 back into linux
Adoni5 Aug 30, 2023
6f01a4b
Update git submodule commit - this might fix aarch comp by adding check
Adoni5 Aug 30, 2023
07c831f
Bump submodule for minimap2-rs
Adoni5 Aug 30, 2023
178b526
Bump minimap2-rs submodule commit to use c99
Adoni5 Aug 30, 2023
c21a71b
Bump minimap2-rs submodule for aarch target cfg in lib for mm_idx_str
Adoni5 Aug 30, 2023
a831bd8
Bump submodule to use u8 ptrs for aarch
Adoni5 Aug 30, 2023
de27073
Bump u8 submodule ptrs
Adoni5 Aug 30, 2023
2a3ba75
Bump version submodule minimap2-rs
Adoni5 Aug 30, 2023
dabe98a
Conditional compilation of architecture
Adoni5 Aug 30, 2023
caaf0e0
Test aarch target using pytest
Adoni5 Aug 30, 2023
33e06d2
Write permissions
Adoni5 Aug 30, 2023
b25f319
Update submodule commit - include not arm
Adoni5 Aug 30, 2023
c5a19a7
Arm using u8 ptrs
Adoni5 Aug 30, 2023
c3f0e14
Ci ARCH tests as seperate step
Adoni5 Aug 30, 2023
42f6a6e
remove needs requirement
Adoni5 Aug 30, 2023
eb17856
Minimap2-rs changes one more time
Adoni5 Aug 30, 2023
d1626bf
Change to map batch backoff 60000
Adoni5 Aug 30, 2023
165204b
Throw maturin into alpine (to be continued)
Adoni5 Aug 30, 2023
bc1ac77
Push WorkQueue::Done with back off
Adoni5 Aug 30, 2023
43e7feb
Drop testing on alpine 👋 and build musl wheels
Adoni5 Aug 31, 2023
2aeaa9d
Bump submodule version final time
Adoni5 Aug 31, 2023
68f8dba
Add musl_linux, exclude armv7 from musl build
Adoni5 Aug 31, 2023
7198be1
Fix manylinux being silly
Adoni5 Aug 31, 2023
bfff05e
Musl support for da boize
Adoni5 Aug 31, 2023
f717f64
Add max attempts to back off addition
Adoni5 Sep 4, 2023
b87738f
Move to checkout v4
Adoni5 Sep 4, 2023
b8306b2
Move to checkout action v4
Adoni5 Sep 4, 2023
a3b5aa0
Update version of rust check as nix is now 1.65.0
Adoni5 Sep 4, 2023
8a297cf
Update README.md
Adoni5 Sep 5, 2023
b8b1237
Set max attempts to default of 6
Adoni5 Sep 5, 2023
6e7f9a8
Whoopsie on setting the default in the deprecated way
Adoni5 Sep 5, 2023
98fe9de
Trim whitespace
Adoni5 Sep 5, 2023
4e8b260
Add test script for memory issue
Adoni5 Nov 21, 2023
9d338cf
Lint :(
Adoni5 Nov 21, 2023
4fd1355
Use `*mut mm_idx_t` for keeping index reference
Adoni5 Nov 21, 2023
e82c85b
Better parameterisation of Benchmark test
Adoni5 Nov 21, 2023
e206656
change to main branch
Adoni5 Nov 21, 2023
beb292a
update submodule commit
Adoni5 Nov 21, 2023
6aa83a3
Remove dodgy tests, add 16 cores to benchmarking script
Adoni5 Nov 21, 2023
ed2e7c6
Remove print for dropping
Adoni5 Nov 21, 2023
e3cc1cf
Add benchmark histogram svgs
Adoni5 Nov 21, 2023
d9b544a
Stop orphaning threads whoops
Adoni5 Nov 21, 2023
1fe0b6f
Just 5 rounds and 5 iterations for more accurate results
Adoni5 Nov 21, 2023
d85d745
Add py3.12
Adoni5 Nov 21, 2023
3584ead
Bump gitmodule commit ref for minimap2-rs
Adoni5 Nov 21, 2023
a2b1c9e
I'm literally going to jump off the roof
Adoni5 Nov 21, 2023
b7afafe
Who even knows what this branch is about anymore
Adoni5 Jun 20, 2024
6442a8b
Drop support for musl - will debug later
Adoni5 Jun 20, 2024
2b64301
Drop support for aarch64 alpine, bump rust MSRV, add feature/* branch…
Adoni5 Jun 20, 2024
e701789
Allow dead code
Adoni5 Jun 20, 2024
7b1bb8d
remove test drop and recreate
Adoni5 Jun 20, 2024
67c5f0e
mark 0.0.8 as alpha
Adoni5 Jun 20, 2024
f9b8a4c
Update pyproject.toml alpha 0.0.8a1
Adoni5 Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 109 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,139 @@ on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
target: [x86_64, "aarch64", "armv7"]
manylinux: [auto]
# include:
# # musllinux
# - os: ubuntu
# target: x86_64-unknown-linux-musl
# manylinux: musllinux_1_2
# - os: ubuntu
# target: aarch64-unknown-linux-musl
# manylinux: musllinux_1_2
# - os: ubuntu
# target: armv7-unknown-linux-musleabihf
# manylinux: musllinux_1_2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
sccache: 'true'
manylinux: auto
manylinux: ${{ matrix.manylinux || 'auto' }}
- name: Install and test built x86_64 wheel
if: matrix.target == 'x86_64'
run: |
pip install mappy-rs --no-index --find-links dist --force-reinstall
pip install pytest
pytest -sv
# Test musl wheels fro x86
- name: Install and test build x86_64 musl wheel
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
options: -v ${{ github.workspace }}:/io -w /io
run: |
apk add py3-pip
pip3 install -U pip pytest
pip3 install mappy-rs --no-index --find-links /io/dist/ --force-reinstall
python3 -m pytest -sv
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

test-builds-aarch:
name: run test of build on ${{ matrix.target }}-${{ matrix.distro }}
needs: [linux]
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
target: [aarch64, armv7]
distro: ['ubuntu22.04']

steps:
- uses: actions/checkout@v4

- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: dist

- uses: uraimo/[email protected]
name: install & test
with:
arch: ${{ matrix.target }}
distro: ${{ matrix.distro }}
githubToken: ${{ github.token }}
install: |
set -x
if command -v apt-get &> /dev/null; then
echo "installing python & pip with apt-get..."
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip python3-venv
pip install -U pip pytest
else
echo "installing python & pip with apk..."
apk update
apk add py3-pip
pip3 install -U pip pytest

fi
run: |
python3 -m pip install mappy-rs --no-index --find-links dist --force-reinstall
python3 -m pytest -sv

macos:
runs-on: macos-latest
runs-on: macos-13
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
sccache: 'true'
- name: Test built wheels
if: matrix.target == 'x86_64'
run: |
pip install mappy-rs --no-index --find-links dist --force-reinstall
pip install pytest
pytest -sv
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -67,7 +157,13 @@ jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand All @@ -83,7 +179,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, macos, sdist]
needs: [linux, test-builds-aarch, macos, sdist]
permissions:
# Used to upload release artifacts
contents: write
Expand Down
49 changes: 40 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@ name: check

on:
push:
branches: [main]
branches: [main, feature/*]
tags:
- '*'
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * SUN'

env:
PYTHON_LATEST: "3.11"
PYTHON_LATEST: "3.12"

jobs:
pre-commit:
name: "pre-commit"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
with:
submodules: 'recursive' # Fetch Git submodules recursively
# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: "actions/setup-python@v4"
with:
python-version: ${{env.PYTHON_LATEST}}
Expand All @@ -33,7 +40,13 @@ jobs:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: "dtolnay/rust-toolchain@master"
with:
toolchain: ${{ matrix.toolchain }}
Expand All @@ -46,7 +59,13 @@ jobs:
runs-on: ubuntu-latest
needs: clippy
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --no-default-features

Expand All @@ -56,10 +75,16 @@ jobs:
needs: clippy
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
Expand All @@ -79,10 +104,16 @@ jobs:
needs: ["cargo-test", "python-test"]
strategy:
matrix:
msrv: ["1.63.0", "1.64.0"]
msrv: ["1.76.0", "1.77.0"]
name: "ubuntu / ${{ matrix.msrv }}"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
with:
submodules: 'recursive' # Fetch Git submodules recursively

# Initialize and update submodules (optional, if submodules were not initialized during checkout)
- name: Update submodules
run: git submodule update --init --recursive
- uses: "dtolnay/rust-toolchain@master"
with:
toolchain: "${{ matrix.msrv }}"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# pytest Benchmark histogram output
*.svg
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "minimap2-rs"]
path = minimap2-rs
url = https://github.com/Adoni5/minimap2-rs.git
branch = main
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mappy-rs"
version = "0.0.7"
version = "0.0.8-alpha.1"
edition = "2021"
authors = ["Rory Munro <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -21,13 +21,12 @@ name = "mappy_rs"
[dependencies]
libc = "0.2"
pyo3 = { version = "0.19" }
minimap2-sys = { version = "0.1.15+minimap2.2.26", features = ["simde"] }
crossbeam = "0.8.2"
fnv = "1.0.7"
ctrlc = {version = "3.4.0", features = ["termination"] }
itertools = "0.10.5"
minimap2 = {version = "0.1.15+minimap2.2.26" }

minimap2-sys = { path = "./minimap2-rs/minimap2-sys", features = ["simde"] }
minimap2 = { path = "./minimap2-rs", features = ["simde"] }
[features]
extension-module = ["pyo3/extension-module"]
default = ["extension-module"]
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ test_benchmark_multi[1] | 84.8418 (3.16)| 94.0907 (3.13) | 86.7404 (3.09)|


# Changelog
## 0.0.8
- Updated `map_batch` - now has a max attempts parameter, which defaults to 6. If set to `None`, there is no limit to the number of attempts to add a fastq to the mapping batch.

## 0.0.7
- Added wheel builds for aarch64 linux and MacOS, and armv7 in the CI/yml.

## 0.0.6
- Lowered backoff time for `map_batch` to 50 milliseconds, with 6 attempts. Each attempt will double the previous back off time.
Expand Down
9 changes: 9 additions & 0 deletions help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Test the memory issue, not dropping Aligner on rust
# side after del without manual gc.collect()
from mappy_rs import Aligner
import gc

al = Aligner("/home/adoni5/Documents/Bioinformatics/refs/hg38_no_alts_22.mmi")
al.enable_threading(8)
del al
gc.collect()
1 change: 1 addition & 0 deletions minimap2-rs
Submodule minimap2-rs added at 5f0a94
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
version = "0.0.7a"
version = "0.0.8a1"
license = {text = "BSD 3-Clause License"}
description = "A multithreaded python wrapper for rust bindings of minimap2."
authors = [
Expand Down
Loading
Loading