Fangjun Kuang
Committed by GitHub

Use self-compiled onnxruntime shared lib. (#635)

@@ -17,13 +17,14 @@ concurrency: @@ -17,13 +17,14 @@ concurrency:
17 17
18 jobs: 18 jobs:
19 build_wheels_aarch64: 19 build_wheels_aarch64:
20 - name: ${{ matrix.python-version }} 20 + name: ${{ matrix.manylinux }} ${{ matrix.python-version }}
21 runs-on: ${{ matrix.os }} 21 runs-on: ${{ matrix.os }}
22 strategy: 22 strategy:
23 fail-fast: false 23 fail-fast: false
24 matrix: 24 matrix:
25 os: [ubuntu-latest] 25 os: [ubuntu-latest]
26 python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"] 26 python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
  27 + manylinux: [manylinux2014, manylinux_2_28]
27 28
28 steps: 29 steps:
29 - uses: actions/checkout@v4 30 - uses: actions/checkout@v4
@@ -51,7 +52,7 @@ jobs: @@ -51,7 +52,7 @@ jobs:
51 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" 52 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
52 CIBW_BUILD_VERBOSITY: 3 53 CIBW_BUILD_VERBOSITY: 3
53 CIBW_ARCHS_LINUX: aarch64 54 CIBW_ARCHS_LINUX: aarch64
54 - CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64 55 + CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/${{ matrix.manylinux }}_aarch64
55 # From onnxruntime >= 1.17.0, it drops support for CentOS 7.0 and it supports only manylinux_2_28. 56 # From onnxruntime >= 1.17.0, it drops support for CentOS 7.0 and it supports only manylinux_2_28.
56 # manylinux_2_24 is no longer supported 57 # manylinux_2_24 is no longer supported
57 58
@@ -63,7 +64,7 @@ jobs: @@ -63,7 +64,7 @@ jobs:
63 ls -lh ./wheelhouse/*.whl 64 ls -lh ./wheelhouse/*.whl
64 65
65 - name: Publish to huggingface 66 - name: Publish to huggingface
66 - if: matrix.python-version == 'cp38' 67 + if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
67 env: 68 env:
68 HF_TOKEN: ${{ secrets.HF_TOKEN }} 69 HF_TOKEN: ${{ secrets.HF_TOKEN }}
69 uses: nick-fields/retry@v3 70 uses: nick-fields/retry@v3
@@ -93,7 +94,7 @@ jobs: @@ -93,7 +94,7 @@ jobs:
93 94
94 - uses: actions/upload-artifact@v4 95 - uses: actions/upload-artifact@v4
95 with: 96 with:
96 - name: wheel-${{ matrix.python-version }} 97 + name: wheel-${{ matrix.python-version }}-${{ matrix.manylinux }}
97 path: ./wheelhouse/*.whl 98 path: ./wheelhouse/*.whl
98 99
99 - name: Publish wheels to PyPI 100 - name: Publish wheels to PyPI
@@ -17,13 +17,15 @@ concurrency: @@ -17,13 +17,15 @@ concurrency:
17 17
18 jobs: 18 jobs:
19 build_wheels_linux: 19 build_wheels_linux:
20 - name: ${{ matrix.python-version }} 20 + name: ${{ matrix.manylinux }} ${{ matrix.python-version }}
21 runs-on: ${{ matrix.os }} 21 runs-on: ${{ matrix.os }}
22 strategy: 22 strategy:
23 fail-fast: false 23 fail-fast: false
24 matrix: 24 matrix:
25 os: [ubuntu-latest] 25 os: [ubuntu-latest]
26 python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"] 26 python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
  27 + manylinux: [manylinux2014, manylinux_2_28]
  28 +
27 29
28 steps: 30 steps:
29 - uses: actions/checkout@v4 31 - uses: actions/checkout@v4
@@ -46,9 +48,7 @@ jobs: @@ -46,9 +48,7 @@ jobs:
46 CIBW_BUILD: "${{ matrix.python-version}}-* " 48 CIBW_BUILD: "${{ matrix.python-version}}-* "
47 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" 49 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
48 CIBW_BUILD_VERBOSITY: 3 50 CIBW_BUILD_VERBOSITY: 3
49 - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64  
50 - # From onnxruntime >= 1.17.0, it drops support for CentOS 7.0 and it supports only manylinux_2_28.  
51 - # manylinux_2_24 is no longer supported 51 + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.manylinux }}_x86_64
52 52
53 - name: Display wheels 53 - name: Display wheels
54 shell: bash 54 shell: bash
@@ -76,7 +76,7 @@ jobs: @@ -76,7 +76,7 @@ jobs:
76 76
77 - uses: actions/upload-artifact@v4 77 - uses: actions/upload-artifact@v4
78 with: 78 with:
79 - name: wheel-${{ matrix.python-version }} 79 + name: wheel-${{ matrix.python-version }}-${{ matrix.manylinux }}
80 path: ./wheelhouse/*.whl 80 path: ./wheelhouse/*.whl
81 81
82 - name: Publish to huggingface 82 - name: Publish to huggingface
@@ -119,14 +119,14 @@ jobs: @@ -119,14 +119,14 @@ jobs:
119 twine upload ./wheelhouse/*.whl 119 twine upload ./wheelhouse/*.whl
120 120
121 - name: Build sdist 121 - name: Build sdist
122 - if: matrix.python-version == 'cp38' 122 + if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
123 shell: bash 123 shell: bash
124 run: | 124 run: |
125 python3 setup.py sdist 125 python3 setup.py sdist
126 ls -l dist/* 126 ls -l dist/*
127 127
128 - name: Publish sdist to PyPI 128 - name: Publish sdist to PyPI
129 - if: matrix.python-version == 'cp38' 129 + if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
130 env: 130 env:
131 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 131 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
132 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 132 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
@@ -227,7 +227,7 @@ jobs: @@ -227,7 +227,7 @@ jobs:
227 tar cjvf ${dst}.tar.bz2 $dst 227 tar cjvf ${dst}.tar.bz2 $dst
228 228
229 - name: Release pre-compiled binaries and libs for linux x64 229 - name: Release pre-compiled binaries and libs for linux x64
230 - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') 230 + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' && matrix.gcc_version == '7'
231 uses: svenstaro/upload-release-action@v2 231 uses: svenstaro/upload-release-action@v2
232 with: 232 with:
233 file_glob: true 233 file_glob: true
@@ -14,19 +14,19 @@ if(NOT BUILD_SHARED_LIBS) @@ -14,19 +14,19 @@ if(NOT BUILD_SHARED_LIBS)
14 message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") 14 message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
15 endif() 15 endif()
16 16
17 -set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-linux-aarch64-1.17.1.tgz")  
18 -set(onnxruntime_URL2 "https://hub.nuaa.cf/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-linux-aarch64-1.17.1.tgz")  
19 -set(onnxruntime_HASH "SHA256=70b6f536bb7ab5961d128e9dbd192368ac1513bffb74fe92f97aac342fbd0ac1") 17 +set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.1/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip")
  18 +set(onnxruntime_URL2 "https://hub.nuaa.cf/csukuangfj/onnxruntime-libs/releases/download/v1.17.1/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip")
  19 +set(onnxruntime_HASH "SHA256=2ed01996da79d11ea486f738010bd411096ab91e744306fbd30d09f37e6d43a0")
20 20
21 # If you don't have access to the Internet, 21 # If you don't have access to the Internet,
22 # please download onnxruntime to one of the following locations. 22 # please download onnxruntime to one of the following locations.
23 # You can add more if you want. 23 # You can add more if you want.
24 set(possible_file_locations 24 set(possible_file_locations
25 - $ENV{HOME}/Downloads/onnxruntime-linux-aarch64-1.17.1.tgz  
26 - ${CMAKE_SOURCE_DIR}/onnxruntime-linux-aarch64-1.17.1.tgz  
27 - ${CMAKE_BINARY_DIR}/onnxruntime-linux-aarch64-1.17.1.tgz  
28 - /tmp/onnxruntime-linux-aarch64-1.17.1.tgz  
29 - /star-fj/fangjun/download/github/onnxruntime-linux-aarch64-1.17.1.tgz 25 + $ENV{HOME}/Downloads/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip
  26 + ${CMAKE_SOURCE_DIR}/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip
  27 + ${CMAKE_BINARY_DIR}/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip
  28 + /tmp/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip
  29 + /star-fj/fangjun/download/github/onnxruntime-linux-aarch64-glibc2_17-Release-1.17.1.zip
30 ) 30 )
31 31
32 foreach(f IN LISTS possible_file_locations) 32 foreach(f IN LISTS possible_file_locations)
@@ -14,19 +14,19 @@ if(NOT BUILD_SHARED_LIBS) @@ -14,19 +14,19 @@ if(NOT BUILD_SHARED_LIBS)
14 message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") 14 message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
15 endif() 15 endif()
16 16
17 -set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-linux-x64-1.17.1.tgz")  
18 -set(onnxruntime_URL2 "https://hub.nuaa.cf/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-linux-x64-1.17.1.tgz")  
19 -set(onnxruntime_HASH "SHA256=89b153af88746665909c758a06797175ae366280cbf25502c41eb5955f9a555e") 17 +set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.1/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip")
  18 +set(onnxruntime_URL2 "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.1/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip")
  19 +set(onnxruntime_HASH "SHA256=3cfa5c2c5c21a9401572af5a4cd9d15ed8f6524f10d3b80e5a38676b3a31efe0")
20 20
21 # If you don't have access to the Internet, 21 # If you don't have access to the Internet,
22 # please download onnxruntime to one of the following locations. 22 # please download onnxruntime to one of the following locations.
23 # You can add more if you want. 23 # You can add more if you want.
24 set(possible_file_locations 24 set(possible_file_locations
25 - $ENV{HOME}/Downloads/onnxruntime-linux-x64-1.17.1.tgz  
26 - ${CMAKE_SOURCE_DIR}/onnxruntime-linux-x64-1.17.1.tgz  
27 - ${CMAKE_BINARY_DIR}/onnxruntime-linux-x64-1.17.1.tgz  
28 - /tmp/onnxruntime-linux-x64-1.17.1.tgz  
29 - /star-fj/fangjun/download/github/onnxruntime-linux-x64-1.17.1.tgz 25 + $ENV{HOME}/Downloads/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip
  26 + ${CMAKE_SOURCE_DIR}/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip
  27 + ${CMAKE_BINARY_DIR}/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip
  28 + /tmp/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip
  29 + /star-fj/fangjun/download/github/onnxruntime-linux-x64-glibc2_17-Release-1.17.1.zip
30 ) 30 )
31 31
32 foreach(f IN LISTS possible_file_locations) 32 foreach(f IN LISTS possible_file_locations)