1
# Copyright (c) ONNX Project Contributors
3
# SPDX-License-Identifier: Apache-2.0
5
name: LinuxRelease_aarch64
7
on: # Specifies the event triggering the workflow
8
workflow_call: # Indicates that this is a reusable workflow
14
permissions: # set top-level default permissions as security best practice
19
if: github.event_name != 'pull_request' || startsWith( github.base_ref, 'rel-') || contains( github.event.pull_request.labels.*.name, 'run release CIs')
20
runs-on: ubuntu-latest
23
python-version: [cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
25
# setting up python and docker image
26
py: /opt/python/${{ matrix.python-version }}/bin/python
27
img: quay.io/pypa/manylinux2014_aarch64
30
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31
- name: Checkout submodules
34
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
35
git submodule sync --recursive
36
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
38
# setting up qemu for enabling aarch64 binary execution on x86 machine
39
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
41
# Creating a virtual environment on machine with the help of docker container \
42
# and installing the dependencies inside that \
43
# so that we can use installed dependencies.
44
- name: Install dependencies
46
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
48
bash -exc '${{ env.py }} -m pip install -q virtualenv && ${{ env.py }} -m venv .env && \
49
source .env/bin/activate && \
50
${{ env.py }} -m pip install -q --only-binary google-re2 -r requirements-release.txt && \
51
yum install -y protobuf-compiler protobuf-devel
54
# using created virtual environment in new container and executing the script
55
- name: Build manylinux2014_aarch64
57
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
60
source .env/bin/activate && \
61
yum install -y sudo && \
62
sudo chmod +x .github/workflows/manylinux/entrypoint.sh && \
63
sudo .github/workflows/manylinux/entrypoint.sh ${{ env.py }} manylinux2014_aarch64 ${{ github.event_name }}
66
# using created virtual environment in new container and testing the wheel
67
- name: Test wheel with Python ${{ matrix.python-version }}
69
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
72
source .env/bin/activate && \
73
python -m pip install -q --upgrade pip && \
74
python -m pip install -q --only-binary google-re2 -r requirements-release.txt && \
75
pip install dist/*manylinux2014_aarch64.whl && \
79
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
81
name: wheels-${{ inputs.os }}-${{ matrix.python-version }}
85
- name: Upload wheel to PyPI weekly
86
if: (github.event_name == 'schedule') # Only triggered by weekly event
88
python -m pip install -q twine
89
twine upload --verbose dist/*.whl --repository-url https://upload.pypi.org/legacy/ -u ${{ secrets.ONNXWEEKLY_USERNAME }} -p ${{ secrets.ONNXWEEKLY_TOKEN }}
91
- name: Verify ONNX with the latest numpy and protobuf
94
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
97
source .env/bin/activate && \
98
python -m pip uninstall -y numpy onnx protobuf && python -m pip install numpy protobuf && \
99
python -m pip install dist/*manylinux2014_aarch64.whl && \
103
- name: Verify ONNX with the minimumly supported packages
106
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
109
source .env/bin/activate && \
110
python -m pip uninstall -y onnx && python -m pip install -r requirements-min.txt && \
111
python -m pip install dist/*manylinux2014_aarch64.whl && \
115
- name: Verify ONNX with ONNX Runtime PyPI package
116
if: matrix.python-version != 'cp312-cp312'
118
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
121
source .env/bin/activate && \
122
python -m pip uninstall -y protobuf numpy && python -m pip install -q -r requirements-release.txt && \
123
python -m pip install -q onnxruntime==1.16.3 && \
124
export ORT_MAX_IR_SUPPORTED_VERSION=9 \
125
export ORT_MAX_ML_OPSET_SUPPORTED_VERSION=3 \
126
export ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=20 \