forked from onnx/onnx
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (95 loc) · 4.21 KB
/
release_linux_aarch64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
name: LinuxRelease_aarch64
on:
workflow_call: # Indicates that this is a reusable workflow
inputs:
os:
required: true
type: string
permissions: # set top-level default permissions as security best practice
contents: read
jobs:
build:
if: github.event_name != 'pull_request' || startsWith( github.base_ref, 'rel-') || contains( github.event.pull_request.labels.*.name, 'run release CIs')
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312, cp313-cp313]
env:
# setting up python and docker image
py: /opt/python/${{ matrix.python-version }}/bin/python
img: quay.io/pypa/manylinux2014_aarch64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
# setting up qemu for enabling aarch64 binary execution on x86 machine
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
# Creating a virtual environment on machine with the help of docker container \
# and installing the dependencies inside that \
# so that we can use installed dependencies.
- name: Install dependencies
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc '${{ env.py }} -m pip install -q virtualenv && ${{ env.py }} -m venv .env && \
source .env/bin/activate && \
${{ env.py }} -m pip install -q --only-binary google-re2 -r requirements-release.txt && \
yum install -y protobuf-compiler protobuf-devel
deactivate'
# using created virtual environment in new container and executing the script
- name: Build manylinux2014_aarch64
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc '\
source .env/bin/activate && \
yum install -y sudo && \
sudo chmod +x .github/workflows/manylinux/entrypoint.sh && \
sudo .github/workflows/manylinux/entrypoint.sh ${{ env.py }} manylinux2014_aarch64 ${{ github.event_name }}
deactivate'
# using created virtual environment in new container and testing the wheel
- name: Test wheel with Python ${{ matrix.python-version }}
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc '\
source .env/bin/activate && \
python -m pip install -q --upgrade pip && \
python -m pip install -q --only-binary google-re2 -r requirements-release.txt && \
pip install dist/*manylinux2014_aarch64.whl && \
pytest && \
deactivate'
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
with:
name: wheels-${{ inputs.os }}-${{ matrix.python-version }}
path: |
./dist/*.whl
- name: Verify ONNX with the latest numpy and protobuf
if: ${{ always() }}
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc '\
source .env/bin/activate && \
python -m pip uninstall -y numpy onnx protobuf && python -m pip install numpy protobuf && \
python -m pip install dist/*manylinux2014_aarch64.whl && \
pytest && \
deactivate'
- name: Verify ONNX with the minimumly supported packages
if: ${{ always() }}
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc '\
source .env/bin/activate && \
python -m pip uninstall -y onnx && python -m pip install -r requirements-min.txt && \
python -m pip install dist/*manylinux2014_aarch64.whl && \
pytest && \
deactivate'