onnx

Форк
0
/
release_linux_aarch64.yml 
128 строк · 5.3 Кб
1
# Copyright (c) ONNX Project Contributors
2
#
3
# SPDX-License-Identifier: Apache-2.0
4

5
name: LinuxRelease_aarch64
6

7
on:  # Specifies the event triggering the workflow
8
  workflow_call:  # Indicates that this is a reusable workflow
9
    inputs:      
10
      os:
11
        required: true
12
        type: string
13

14
permissions:  # set top-level default permissions as security best practice
15
  contents: read
16

17
jobs:
18
  build:
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
21
    strategy:
22
      matrix:
23
        python-version: [cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
24
    env:
25
      # setting up python and docker image
26
      py: /opt/python/${{ matrix.python-version }}/bin/python
27
      img: quay.io/pypa/manylinux2014_aarch64
28

29
    steps:
30
    - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31
    - name: Checkout submodules
32
      shell: bash
33
      run: |
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
37

38
      # setting up qemu for enabling aarch64 binary execution on x86 machine
39
    - uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
40

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
45
      run: |
46
        docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
47
          ${{ env.img }} \
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
52
          deactivate'
53

54
      # using created virtual environment in new container and executing the script
55
    - name: Build manylinux2014_aarch64
56
      run: |
57
        docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
58
          ${{ env.img }} \
59
          bash -exc '\
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 }}
64
          deactivate'
65

66
      # using created virtual environment in new container and testing the wheel
67
    - name: Test wheel with Python ${{ matrix.python-version }}
68
      run: |
69
        docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
70
          ${{ env.img }} \
71
          bash -exc '\
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 && \
76
          pytest && \
77
          deactivate'
78

79
    - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
80
      with:
81
        name: wheels-${{ inputs.os }}-${{ matrix.python-version }}
82
        path: |
83
            ./dist/*.whl
84
            
85
    - name: Upload wheel to PyPI weekly
86
      if: (github.event_name == 'schedule') # Only triggered by weekly event
87
      run: |
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 }}
90

91
    - name: Verify ONNX with the latest numpy and protobuf
92
      if: ${{ always() }}
93
      run: |
94
         docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
95
          ${{ env.img }} \
96
          bash -exc '\
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 && \
100
          pytest && \
101
          deactivate'
102

103
    - name: Verify ONNX with the minimumly supported packages
104
      if: ${{ always() }}
105
      run: |
106
         docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
107
          ${{ env.img }} \
108
          bash -exc '\
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 && \
112
          pytest && \
113
          deactivate'
114

115
    - name: Verify ONNX with ONNX Runtime PyPI package
116
      if: matrix.python-version != 'cp312-cp312'
117
      run: |
118
         docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
119
          ${{ env.img }} \
120
          bash -exc '\
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 \
127
          pytest && \
128
          deactivate'
129

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.