-
Notifications
You must be signed in to change notification settings - Fork 29
Add ONNX Runtime CI pipeline for 5.x #296
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
abhishek-gola
wants to merge
9
commits into
opencv:main
Choose a base branch
from
abhishek-gola:added-ort-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a98add5
Add ONNX Runtime test for 5.x
abhishek-gola e56dedb
removed 22 and 20 matrix images
abhishek-gola 24ad945
removed unused file
abhishek-gola 7d0ef9a
Code refactoring
abhishek-gola 03b63e5
warnings fix
abhishek-gola 23204ac
fixed cmake flags
abhishek-gola 637eef0
remove 3rdparty options and moved warnings suppression to CMakelists.txt
varun-jaiswal17 31e7816
removed matrix
abhishek-gola a0ea529
skipped conformance tests
abhishek-gola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| name: OCV PR Linux ORT | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/workflows/OCV-PR-Linux-ORT.yaml' | ||
| # TODO: are following paths necessary? | ||
| # - 'checkout-and-merge/*' | ||
| # - 'configure-and-build/*' | ||
| # - 'run-tests/*' | ||
| # - 'scripts/runner.py' | ||
| # - 'scripts/test-plan.json' | ||
| workflow_call: | ||
| inputs: | ||
| workflow_branch: | ||
| description: "Branch for ci-gha-workflow repository" | ||
| default: "main" | ||
| required: false | ||
| type: string | ||
|
|
||
| concurrency: | ||
| group: OCV-PR-Linux-ORT-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
|
|
||
| branch_eval: | ||
| runs-on: ubuntu-24.04 | ||
| outputs: | ||
| branches: ${{ steps.determine-branches.outputs.branches }} | ||
| steps: | ||
| - id: determine-branches | ||
| shell: bash | ||
| run: | | ||
| # Industry Standard: Explicitly allow 5.x only. | ||
| # Logic: If repo is ci-gha-workflow OR the target PR branch is 5.x | ||
| if [[ "${{ github.event.repository.name }}" == "ci-gha-workflow" || "${{ github.base_ref }}" == "5.x" ]]; then | ||
| echo "branches=['5.x']" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "branches=[]" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| Ubuntu: | ||
| # runs-on: opencv-ru-lin-riscv | ||
| runs-on: opencv-cn-lin-x86-64 | ||
| needs: | ||
| - branch_eval | ||
| if: ${{ needs.branch_eval.outputs.branches != '[]' }} | ||
| strategy: | ||
| # NOTE: Debugging | ||
| # fail-fast: true | ||
| # max-parallel: 3 | ||
| fail-fast: false | ||
| max-parallel: 3 | ||
| matrix: | ||
| version: | ||
| - '24.04' | ||
| - '22.04' | ||
| - '20.04' | ||
| # TODO: enable later | ||
| # - '24.04_asan' | ||
| branch: ${{ fromJSON(needs.branch_eval.outputs.branches )}} | ||
| include: | ||
| - version: '24.04' | ||
| image: '24.04:20251127' | ||
| jpegxl: true | ||
| avif: true | ||
| avx2: true | ||
| gphoto2: true | ||
| aravis: true | ||
| # TODO: enable later | ||
| # - version: '24.04_asan' | ||
| # image: '24.04:20250505' | ||
| # asan: true | ||
| # jpegxl: true | ||
| # avif: true | ||
| - version: '22.04' | ||
| image: '22.04:20251015' | ||
| avif: true | ||
| plugins: true | ||
| - version: '20.04' | ||
| image: '20.04:20251015' | ||
| limited_api: true | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| container: | ||
| image: 'quay.io/opencv-ci/opencv-ubuntu-${{ matrix.image }}' | ||
| volumes: | ||
| # NOTE: RU config | ||
| # - /mnt/cache/git_cache:/opt/git_cache | ||
| # - /mnt/cache/ci_cache/opencv:/opt/.ccache | ||
| # - /mnt/cache/binaries_cache:/opt/binaries_cache | ||
| # - vol_dnn_models:/opt/dnn-models | ||
| # NOTE: CN config | ||
| - /home/opencv-cn/git_cache:/opt/git_cache | ||
| - /home/opencv-cn/ci_cache/opencv/${{ matrix.version }}:/opt/.ccache | ||
| - /home/opencv-cn/binaries_cache/${{ matrix.version }}:/opt/binaries_cache | ||
| - /home/opencv-cn/dnn-models:/opt/dnn-models | ||
| # NOTE: RU config | ||
| # options: '--user root:root' | ||
| env: | ||
| ANT_HOME: '/usr/share/ant' | ||
| DNN_MODELS: '/opt/dnn-models' | ||
| CCACHE_DIR: '/opt/.ccache' | ||
| CCACHE_MAXSIZE: '8G' | ||
| OPENCV_DOWNLOAD_PATH: '/opt/binaries_cache' | ||
| CMAKE_OPT: >- | ||
| -DBUILD_DOCS=ON | ||
| -DBUILD_EXAMPLES=ON | ||
|
asmorkalov marked this conversation as resolved.
Outdated
|
||
| -DOPENCV_ENABLE_NONFREE=ON | ||
|
asmorkalov marked this conversation as resolved.
Outdated
|
||
| -DWITH_IMGCODEC_GIF=ON | ||
|
asmorkalov marked this conversation as resolved.
Outdated
|
||
| -DWITH_ONNXRUNTIME=ON | ||
| ${{ matrix.jpegxl && '-DWITH_JPEGXL=ON' }} | ||
| ${{ matrix.avif && '-DWITH_AVIF=ON' }} | ||
| ${{ matrix.gphoto2 && '-DWITH_GPHOTO2=ON' }} | ||
| ${{ matrix.aravis && '-DWITH_ARAVIS=ON' }} | ||
| ${{ matrix.avx2 && '-DCPU_BASELINE=AVX2'}} | ||
| ${{ matrix.plugins && '-DVIDEOIO_PLUGIN_LIST=all -DHIGHGUI_PLUGIN_LIST=all' }} | ||
| ${{ matrix.limited_api && '-DPYTHON3_LIMITED_API=ON' }} | ||
|
asmorkalov marked this conversation as resolved.
Outdated
|
||
| ${{ matrix.asan && '-DENABLE_OMIT_FRAME_POINTER=OFF -DCMAKE_CXX_FLAGS="-fsanitize=address"' }} | ||
| HOME: ${{ contains(matrix.image, '24.04') && '/home/ubuntu' || '/home/ci' }} | ||
| MAIN_BUILD_DIR: "${{ (github.event.repository.name != 'opencv_contrib') && 'build' || 'build-contrib' }}" | ||
| # NOTE: CN config | ||
| OPENCV_FOR_THREADS_NUM: 8 | ||
| CMAKE_BUILD_PARALLEL_LEVEL: 8 | ||
| # NOTE: RU config | ||
| # OPENCV_FOR_THREADS_NUM: 10 | ||
| # CMAKE_BUILD_PARALLEL_LEVEL: 20 | ||
|
|
||
| # ========== | ||
|
|
||
| steps: | ||
|
|
||
| - name: Checkout workflow repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: opencv/ci-gha-workflow | ||
| ref: "${{ github.repository == 'opencv/ci-gha-workflow' && github.ref || inputs.workflow_branch }}" | ||
|
|
||
| - name: Checkout and merge OpenCV | ||
| uses: ./checkout-and-merge | ||
| with: | ||
| target_branch: "${{ matrix.branch }}" | ||
| author: "${{ github.event.pull_request.user.login }}" | ||
| source_branch: "${{ github.event.repository.name == 'ci-gha-workflow' && '' || github.head_ref }}" | ||
| gitcache: '/opt/git_cache' | ||
| home: '${{ env.HOME }}' | ||
| workdir: '${{ env.HOME }}' | ||
|
|
||
| - name: Update extra dnn models | ||
| timeout-minutes: 60 | ||
| working-directory: '${{ env.HOME }}' | ||
| run: | | ||
| ls -lR ${{ env.DNN_MODELS }} | ||
| python3 opencv_extra/testdata/dnn/download_models.py \ | ||
| --cleanup \ | ||
| --dst '${{ env.DNN_MODELS }}/dnn' | ||
| echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV | ||
|
|
||
| - if: ${{ github.event.repository.name != 'opencv_contrib' }} | ||
| name: Configure and build OpenCV | ||
| uses: ./configure-and-build | ||
| with: | ||
| workdir: '${{ env.HOME }}' | ||
| builddir: 'build' | ||
| generator: 'Ninja' | ||
| options: '${{ env.CMAKE_OPT }}' | ||
|
|
||
| - name: Configure and build OpenCV with contrib | ||
| uses: ./configure-and-build | ||
| with: | ||
| workdir: '${{ env.HOME }}' | ||
| builddir: 'build-contrib' | ||
| generator: 'Ninja' | ||
| options: '-DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules ${{ env.CMAKE_OPT }}' | ||
|
abhishek-gola marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Run OpenCV tests | ||
| uses: ./run-tests | ||
| env: | ||
| OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' | ||
| OPENCV_TEST_REQUIRE_DATA: 1 | ||
| OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 | ||
| PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH' | ||
| # TODO: enable later | ||
| # ASAN_OPTIONS: 'detect_leaks=0' | ||
| with: | ||
| workdir: '${{ env.HOME }}' | ||
| builddir: '${{ env.MAIN_BUILD_DIR }}' | ||
| logdir: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}' | ||
| plan: "test-plan-${{ matrix.branch }}-ort.json" | ||
| # NOTE: Just keeping this construction here for possible future use: | ||
| # ${{ (github.event.repository.name == 'opencv_contrib') && format('''linux-contrib-{0}''', matrix.branch) || '' }} | ||
| suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && '''linux-contrib''' || '''linux''' }} ]" | ||
| filter: "[ 'ubuntu-common', ${{ matrix.avx2 && '''ubuntu-avx2''' }} ]" | ||
| enable_python: "true" | ||
| enable_java: "true" | ||
| suffix: '${{ matrix.version }}_${{ matrix.branch }}' | ||
|
|
||
| - if: ${{ always() && env.WARNINGS == '1' }} | ||
| name: Warnings check | ||
| run: | | ||
| echo "::error Warnings have been found!" | ||
| exit 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "suites": { | ||
| "linux": [ | ||
| "opencv_test_dnn" | ||
| ], | ||
| "linux-contrib": [] | ||
| }, | ||
| "filters": { | ||
| "ubuntu-common": {}, | ||
| "ubuntu-avx2": {} | ||
| }, | ||
| "options": { | ||
| "default": { | ||
| "args": { | ||
| "test": "--skip_unstable=1 --gtest_filter=*ORT*" | ||
|
abhishek-gola marked this conversation as resolved.
Outdated
|
||
| }, | ||
| "env": { | ||
| "opencv_test_dnn": { | ||
| "OPENCV_FORCE_DNN_ENGINE": "4" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.