From fb5874376bd65a5fe0a4ea300f8933b7cfc8c8b5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 16 Dec 2024 09:49:50 +0100 Subject: [PATCH 01/68] Enabled integration tests --- integration_test/app_test.dart | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index e3df09e0..4cec7f6b 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -5,28 +5,28 @@ import 'package:integration_test/integration_test.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - //testWidgets('Download model from HF', (tester) async { - // const app = App(); - // await tester.pumpWidget(app); + testWidgets('Download model from HF', (tester) async { + const app = App(); + await tester.pumpWidget(app); - // await tester.tap(find.text('Import model')); - // await tester.pumpAndSettle(); + await tester.tap(find.text('Import model')); + await tester.pumpAndSettle(); - // await tester.tap(find.text('Hugging Face')); - // await tester.pumpAndSettle(); + await tester.tap(find.text('Hugging Face')); + await tester.pumpAndSettle(); - // final searchBarFinder = find.bySemanticsLabel('Find a model').first; - // await tester.tap(searchBarFinder, warnIfMissed: false); - // await tester.pumpAndSettle(); - // await tester.enterText(searchBarFinder, 'tiny'); - // await tester.pumpAndSettle(); + final searchBarFinder = find.bySemanticsLabel('Find a model').first; + await tester.tap(searchBarFinder, warnIfMissed: false); + await tester.pumpAndSettle(); + await tester.enterText(searchBarFinder, 'tiny'); + await tester.pumpAndSettle(); - // await tester.tap(find.text('TinyLlama 1.1B Chat V1.0').first); - // await tester.pumpAndSettle(); - // await tester.tap(find.text('Import selected model')); - // await tester.pumpFrames(app, const Duration(seconds: 1)); - // expect(find.textContaining(RegExp(r'^[1-9][\d,]* MB$')), findsNWidgets(2)); + await tester.tap(find.text('TinyLlama 1.1B Chat V1.0').first); + await tester.pumpAndSettle(); + await tester.tap(find.text('Import selected model')); + await tester.pumpFrames(app, const Duration(seconds: 1)); + expect(find.textContaining(RegExp(r'^[1-9][\d,]* MB$')), findsNWidgets(2)); - // await tester.pumpAndSettle(); - //}); + await tester.pumpAndSettle(); + }); } From ded2621ac3bb45d1773de6aaed5a2c8cbf8aa455 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 16 Dec 2024 17:52:30 +0100 Subject: [PATCH 02/68] Added multi-os build pipeline --- .github/workflows/build-and-test.yml | 15 ++++++++ .github/workflows/build-ui.yml | 51 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/build-ui.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 00000000..844d3ec9 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,15 @@ +name: Build and test + +on: + push: + branches: + - dkalinin/integration-tests + +jobs: + build-ui: + strategy: + matrix: + os: [ubuntu-22.04, windows-latest, macos-latest] + uses: ./.github/workflows/build-ui.yml + with: + os: ${{ matrix.os }} \ No newline at end of file diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml new file mode 100644 index 00000000..f070f585 --- /dev/null +++ b/.github/workflows/build-ui.yml @@ -0,0 +1,51 @@ +name: Build UI + +on: + workflow_call: + inputs: + os: + required: true + description: 'The operating system to build for' + type: string + +jobs: + build-ui: + name: Build UI + runs-on: ${{ github.event.inputs.os }} + permissions: + contents: write + + steps: + - name: Determine comon OS vars + run: | + if [[ "${{ startsWith(github.event.inputs.os, 'ubuntu') }}" == "true" ]]; then + echo "OS_NAME=linux" >> $GITHUB_ENV + echo "RELEASE_PATH=build/linux/x64/release/bundle" >> $GITHUB_ENV + elif [[ "${{ startsWith(github.event.inputs.os, 'windows') }}" == "true" ]]; then + echo "OS_NAME=windows" >> $GITHUB_ENV + echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV + elif [[ "${{ startsWith(github.event.inputs.os, 'macos') }}" == "true" ]]; then + echo "OS_NAME=macos" >> $GITHUB_ENV + echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV + fi + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version-file: pubspec.yaml + - name: Install linux dependencies + if: ${{ env.OS_NAME == 'linux' }} + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev + - name: Install project dependencies + run: flutter pub get + - name: Generate intermediates + run: flutter pub run build_runner build --delete-conflicting-outputs + - name: Enable build + run: flutter config --enable-${{ env.OS_NAME }}-desktop + - name: Build artifacts + run: flutter build ${{ env.OS_NAME }} --release + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: "OpenVINO-TestDrive-no-bindings-${{ env.OS_NAME }}.zip" + path: ${{ env.RELEASE_PATH }} From ac63f8b1009f7bd4c51a59d93a2d9abfac0f0971 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 16 Dec 2024 18:04:02 +0100 Subject: [PATCH 03/68] Added permissions --- .github/workflows/build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 844d3ec9..527486bb 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -7,6 +7,8 @@ on: jobs: build-ui: + permissions: + contents: write strategy: matrix: os: [ubuntu-22.04, windows-latest, macos-latest] From 4ee7629b1399cbc911bb91f7c9f3f8382b9b371e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 16 Dec 2024 18:06:57 +0100 Subject: [PATCH 04/68] Fixed workflow --- .github/workflows/build-ui.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index f070f585..94b59d20 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -11,20 +11,20 @@ on: jobs: build-ui: name: Build UI - runs-on: ${{ github.event.inputs.os }} + runs-on: ${{ inputs.os }} permissions: contents: write steps: - name: Determine comon OS vars run: | - if [[ "${{ startsWith(github.event.inputs.os, 'ubuntu') }}" == "true" ]]; then + if [[ "${{ startsWith(inputs.os, 'ubuntu') }}" == "true" ]]; then echo "OS_NAME=linux" >> $GITHUB_ENV echo "RELEASE_PATH=build/linux/x64/release/bundle" >> $GITHUB_ENV - elif [[ "${{ startsWith(github.event.inputs.os, 'windows') }}" == "true" ]]; then + elif [[ "${{ startsWith(inputs.os, 'windows') }}" == "true" ]]; then echo "OS_NAME=windows" >> $GITHUB_ENV echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV - elif [[ "${{ startsWith(github.event.inputs.os, 'macos') }}" == "true" ]]; then + elif [[ "${{ startsWith(inputs.os, 'macos') }}" == "true" ]]; then echo "OS_NAME=macos" >> $GITHUB_ENV echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi From 22daea6cd7ae8e5dcf2f0b5a2f7bf31734ed0ea8 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 16 Dec 2024 18:09:12 +0100 Subject: [PATCH 05/68] Disabled other workflows --- .github/workflows/linux-build.yaml | 4 ++++ .github/workflows/windows-build.yaml | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-build.yaml b/.github/workflows/linux-build.yaml index 99d08449..2098b803 100644 --- a/.github/workflows/linux-build.yaml +++ b/.github/workflows/linux-build.yaml @@ -9,6 +9,7 @@ jobs: permissions: contents: write + if: false steps: # Step 1: Checkout the repository - name: Checkout repository @@ -44,6 +45,8 @@ jobs: permissions: contents: write + if: false + steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 @@ -76,6 +79,7 @@ jobs: name: Package combined Linux release runs-on: ubuntu-22.04 needs: [ build-linux-bindings, build-linux-ui ] # Waits for both jobs to succeed + if: false steps: # Step 1: Check out the repository - name: Checkout repository diff --git a/.github/workflows/windows-build.yaml b/.github/workflows/windows-build.yaml index 5b3465c4..2c5e2ecd 100644 --- a/.github/workflows/windows-build.yaml +++ b/.github/workflows/windows-build.yaml @@ -7,6 +7,8 @@ jobs: name: Build Windows bindings runs-on: windows-2019-16-core + if: false + steps: # Step 1: Checkout the repository - name: Checkout repository @@ -122,6 +124,8 @@ jobs: permissions: contents: write + if: false + steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 @@ -189,10 +193,10 @@ jobs: ls -la ./bindings ls -la ./flutter rm -rf ./flutter/fake.dll - + tar -xvf ./bindings/windows_bindings.tar -C ./bindings rm ./bindings/windows_bindings.tar - + ls -la ./bindings mv ./bindings/* ./flutter/ From c5b62d1eef789b17dd04b776f82e08789fda6d72 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 16 Dec 2024 21:04:24 +0100 Subject: [PATCH 06/68] Changed shell to bash for windows --- .github/workflows/build-ui.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 94b59d20..a06f3a70 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -17,6 +17,7 @@ jobs: steps: - name: Determine comon OS vars + shell: bash run: | if [[ "${{ startsWith(inputs.os, 'ubuntu') }}" == "true" ]]; then echo "OS_NAME=linux" >> $GITHUB_ENV From e25fd79a1b47e2ea8c5c73637d791b16b001d79b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 18 Dec 2024 19:18:28 +0100 Subject: [PATCH 07/68] Fixed minor issues --- .github/workflows/build-ui.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index a06f3a70..93b0f1af 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -19,34 +19,32 @@ jobs: - name: Determine comon OS vars shell: bash run: | - if [[ "${{ startsWith(inputs.os, 'ubuntu') }}" == "true" ]]; then - echo "OS_NAME=linux" >> $GITHUB_ENV + if [[ "${{ runner.os }}" == "Linux" ]]; then echo "RELEASE_PATH=build/linux/x64/release/bundle" >> $GITHUB_ENV - elif [[ "${{ startsWith(inputs.os, 'windows') }}" == "true" ]]; then - echo "OS_NAME=windows" >> $GITHUB_ENV + elif [[ "${{ runner.os }}" == "Windows" ]]; then echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV - elif [[ "${{ startsWith(inputs.os, 'macos') }}" == "true" ]]; then - echo "OS_NAME=macos" >> $GITHUB_ENV + elif [[ "${{ runner.os }}" == "macOS" ]]; then echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@v2.18.0 with: channel: 'stable' flutter-version-file: pubspec.yaml + cache: true - name: Install linux dependencies - if: ${{ env.OS_NAME == 'linux' }} + if: ${{ runner.os == 'Linux' }} run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev - name: Install project dependencies run: flutter pub get - name: Generate intermediates run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build - run: flutter config --enable-${{ env.OS_NAME }}-desktop + run: flutter config --enable-${{ lower(runner.os) }}-desktop - name: Build artifacts - run: flutter build ${{ env.OS_NAME }} --release + run: flutter build ${{ lower(runner.os) }} --release - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-${{ env.OS_NAME }}.zip" + name: "OpenVINO-TestDrive-no-bindings-${{ lower(runner.os) }}.zip" path: ${{ env.RELEASE_PATH }} From 45bd440948bbed0183641ac5dd06c0f3c7dcdff6 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 17:09:49 +0100 Subject: [PATCH 08/68] Fixed workflow --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/build-ui.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 527486bb..0d1a71b9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,4 +14,4 @@ jobs: os: [ubuntu-22.04, windows-latest, macos-latest] uses: ./.github/workflows/build-ui.yml with: - os: ${{ matrix.os }} \ No newline at end of file + os: ${{ matrix.os }} diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 93b0f1af..eac117fb 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -40,11 +40,11 @@ jobs: - name: Generate intermediates run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build - run: flutter config --enable-${{ lower(runner.os) }}-desktop + run: flutter config --enable-${"${{runner.os}}"@L}-desktop - name: Build artifacts - run: flutter build ${{ lower(runner.os) }} --release + run: flutter build ${"${{runner.os}}"@L} --release - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-${{ lower(runner.os) }}.zip" + name: "OpenVINO-TestDrive-no-bindings-${{runner.os}}.zip" path: ${{ env.RELEASE_PATH }} From 96de23163e52dad0379c34c3ddf831f3c6182b58 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 17:47:35 +0100 Subject: [PATCH 09/68] FIxed workflow --- .github/workflows/build-and-test.yml | 1 + .github/workflows/build-ui.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0d1a71b9..bef2ba27 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -10,6 +10,7 @@ jobs: permissions: contents: write strategy: + fail-fast: false matrix: os: [ubuntu-22.04, windows-latest, macos-latest] uses: ./.github/workflows/build-ui.yml diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index eac117fb..c99d9440 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -40,9 +40,11 @@ jobs: - name: Generate intermediates run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build - run: flutter config --enable-${"${{runner.os}}"@L}-desktop + shell: bash + run: flutter config --enable-`echo "${{runner.os}}" | tr '[:upper:]' '[:lower:]'`-desktop - name: Build artifacts - run: flutter build ${"${{runner.os}}"@L} --release + shell: bash + run: flutter build `echo "${{runner.os}}" | tr '[:upper:]' '[:lower:]'` --release - name: Upload artifacts uses: actions/upload-artifact@v4 with: From d1ee04ed3658ce6e8ac06a7939ecefc7ddc080fd Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 18:07:07 +0100 Subject: [PATCH 10/68] Fixed workflow --- .github/workflows/build-ui.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index c99d9440..f5b41163 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -26,6 +26,7 @@ jobs: elif [[ "${{ runner.os }}" == "macOS" ]]; then echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi + echo "OS_NAME=`echo "${{runner.os}}" | tr '[:upper:]' '[:lower:]`" >> $GITHUB_ENV - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2.18.0 with: @@ -40,11 +41,9 @@ jobs: - name: Generate intermediates run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build - shell: bash - run: flutter config --enable-`echo "${{runner.os}}" | tr '[:upper:]' '[:lower:]'`-desktop + run: flutter config --enable-${env.OS_NAME}-desktop - name: Build artifacts - shell: bash - run: flutter build `echo "${{runner.os}}" | tr '[:upper:]' '[:lower:]'` --release + run: flutter build ${env.OS_NAME} --release - name: Upload artifacts uses: actions/upload-artifact@v4 with: From fa6cf332a83739cce54d37ee3392091aa8cd2fa2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 18:10:33 +0100 Subject: [PATCH 11/68] Fixed workflow --- .github/workflows/build-ui.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index f5b41163..c194e9bd 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -41,9 +41,9 @@ jobs: - name: Generate intermediates run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build - run: flutter config --enable-${env.OS_NAME}-desktop + run: flutter config --enable-${OS_NAME}-desktop - name: Build artifacts - run: flutter build ${env.OS_NAME} --release + run: flutter build ${OS_NAME} --release - name: Upload artifacts uses: actions/upload-artifact@v4 with: From 7a3811712f97148c9670b07baa923fa358320d57 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 18:16:22 +0100 Subject: [PATCH 12/68] Fixed workflow --- .github/workflows/build-ui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index c194e9bd..9a553319 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -26,7 +26,7 @@ jobs: elif [[ "${{ runner.os }}" == "macOS" ]]; then echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi - echo "OS_NAME=`echo "${{runner.os}}" | tr '[:upper:]' '[:lower:]`" >> $GITHUB_ENV + echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]`" >> $GITHUB_ENV - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2.18.0 with: From baaa4e034cfb338d8e59b9a59b67c0225b62ea76 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 18:18:59 +0100 Subject: [PATCH 13/68] Fixed workflow --- .github/workflows/build-ui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 9a553319..2c34f43e 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -26,7 +26,7 @@ jobs: elif [[ "${{ runner.os }}" == "macOS" ]]; then echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi - echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]`" >> $GITHUB_ENV + echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2.18.0 with: From b9b25676636871518c20599536692f7d03946e96 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 19 Dec 2024 18:23:48 +0100 Subject: [PATCH 14/68] Fixed workflow --- .github/workflows/build-ui.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 2c34f43e..872386a1 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -41,9 +41,9 @@ jobs: - name: Generate intermediates run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build - run: flutter config --enable-${OS_NAME}-desktop + run: flutter config --enable-${{env.OS_NAME}}-desktop - name: Build artifacts - run: flutter build ${OS_NAME} --release + run: flutter build ${{env.OS_NAME}} --release - name: Upload artifacts uses: actions/upload-artifact@v4 with: From 3cafae54da8ae524ec1daf123561f8db57629744 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 20 Dec 2024 17:00:34 +0100 Subject: [PATCH 15/68] Fixed windows cmake --- windows/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index b86d3639..a8a47f80 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -113,4 +113,6 @@ get_filename_component(BINDINGS_DIRECTORY ../bindings ABSOLUTE) file(GLOB BINDINGS "${BINDINGS_DIRECTORY}/*.dll" ) -install(FILES "${BINDINGS}" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) +if(BINDINGS) + install(FILES "${BINDINGS}" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) +endif() From 925b49e98bc536042eefaf913207cac888cd8646 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 8 Jan 2025 21:31:37 +0100 Subject: [PATCH 16/68] Separated bundling step --- .github/workflows/build-and-test.yml | 29 ++++ .github/workflows/build-ui.yml | 2 + .github/workflows/build-windows-bindings.yml | 120 +++++++++++++++++ macos/Podfile.lock | 30 ++--- macos/Runner.xcodeproj/project.pbxproj | 131 +++++-------------- macos/Runner/Base.lproj/MainMenu.xib | 1 - macos/Scripts/bundle_libraries.sh | 75 +++++++++++ 7 files changed, 273 insertions(+), 115 deletions(-) create mode 100644 .github/workflows/build-windows-bindings.yml create mode 100755 macos/Scripts/bundle_libraries.sh diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bef2ba27..6219cb95 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,3 +16,32 @@ jobs: uses: ./.github/workflows/build-ui.yml with: os: ${{ matrix.os }} + + build-linux-bindings: + name: Build Linux Bindings + runs-on: ubuntu-22.04-16-cores + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Docker image + run: | + cd openvino_bindings + docker build -f Dockerfile.ubuntu -t linux-bindings-ubuntu . + docker create --name bindings_container linux-bindings-ubuntu + docker cp bindings_container:/bindings-out/linux_bindings.tgz ./linux_bindings.tgz + - name: Upload bindings to artifacts + uses: actions/upload-artifact@v4 + with: + name: "linux_bindings.tgz" + path: openvino_bindings/linux_bindings.tgz + if-no-files-found: error + + build-windows-bindings: + permissions: + contents: write + uses: ./.github/workflows/build-windows-bindings.yml diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 872386a1..21ca93eb 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -44,6 +44,8 @@ jobs: run: flutter config --enable-${{env.OS_NAME}}-desktop - name: Build artifacts run: flutter build ${{env.OS_NAME}} --release + env: + FLUTTER_NOT_BUNDLE_LIBRARIES: true - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/build-windows-bindings.yml b/.github/workflows/build-windows-bindings.yml new file mode 100644 index 00000000..352024cc --- /dev/null +++ b/.github/workflows/build-windows-bindings.yml @@ -0,0 +1,120 @@ +name: Build Windows Bindings + +on: + workflow_call: + +jobs: + build-windows-bindings: + name: Build Windows Bindings + runs-on: windows-2019-16-core + permissions: + contents: write + + steps: + # Step 1: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Step 2: Install Visual Studio Build Tools (only needed on windows-latest or runners without VS2019) + # - name: Install Visual Studio Build Tools + # run: | + # choco install visualstudio2019buildtools -y + # choco install visualstudio2019-workload-vctools -y + # shell: cmd + + # Step 3: Install Python 3.13 + - name: Install Python 3.13 + uses: actions/setup-python@v5 + with: + python-version: '3.13.0' + + - name: Add Python to PATH + run: | + setx PATH "%PATH%;C:\hostedtoolcache\windows\Python\3.13.0\x64" + shell: cmd + + # Step 4: Add Python to PATH + - name: Install numpy + run: | + C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe -m pip install numpy + shell: cmd + + # Step 5: Install MSYS2 + - name: Install MSYS2 + run: | + choco install msys2 -y + setx PATH "%PATH%;C:\tools\msys64\usr\bin" + shell: cmd + + - name: Initialize MSYS2 + run: | + C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Syuu --noconfirm" + C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm" + shell: cmd + + # Step 6: Install Bazelisk + - name: Install Bazelisk + run: | + choco install bazelisk -y + shell: cmd + + # Step 7: Set up Bazel environment variables + - name: Set up Bazel environment variables + env: + BAZEL_VC: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC + BAZEL_VS: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools + BAZEL_VC_FULL_VERSION: 14.29.30133 + BAZEL_SH: C:\msys64\usr\bin\bash.exe + run: echo "Bazel environment variables set." + + # Step 8: Download and Install OpenCV + - name: Download OpenCV + run: | + curl -L -o opencv.exe https://github.com/opencv/opencv/releases/download/4.9.0/opencv-4.9.0-windows.exe + start /wait opencv.exe -suppresslaunch -y -gm2 -o"C:\" + shell: cmd + + # Step 9: Install vcpkg and ffmpeg + - name: Install vcpkg and ffmpeg + shell: powershell + run: | + if (!(Test-Path "C:\vcpkg")) { git clone https://github.com/microsoft/vcpkg.git C:\vcpkg } + C:\vcpkg\bootstrap-vcpkg.bat + cd openvino_bindings/third_party + C:\vcpkg\vcpkg install + + # Step 10: Download and Install OpenVINO Runtime + - name: Download and Install OpenVINO Runtime 24.6.0 + shell: powershell + run: | + Invoke-WebRequest -Uri https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/windows/openvino_genai_windows_2024.6.0.0_x86_64.zip -OutFile openvino_runtime.zip + Expand-Archive -Path openvino_runtime.zip -DestinationPath C:/Intel/ + Rename-Item -Path "C:/Intel/openvino_genai_windows_2024.6.0.0_x86_64" -NewName "openvino_2024.6.0" + dir C:/Intel/openvino_2024.6.0/ + + # Step 11: Install Mediapipe Requirements + - name: Install Mediapipe Requirements + run: | + C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm git patch unzip" + shell: bash + + # Step 12: Build with Bazel + - name: Build Windows Bindings with Bazel + env: + PYTHON_BIN_PATH: "C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe" + run: | + cd openvino_bindings + bazel build -c opt :windows_bindings --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe" + shell: bash + + # Step 13: Verify the DLLs + - name: Verify DLLs in Bazel Output + run: | + dir openvino_bindings/bazel-out/x64_windows-opt/bin/windows_bindings.tar + + # Step 14: Upload release artifact + - name: Upload Release Artifact + uses: actions/upload-artifact@v4 + with: + name: windows_bindings.tar + path: openvino_bindings/bazel-out/x64_windows-opt/bin/windows_bindings.tar diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 4cd10224..80e23593 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -86,22 +86,22 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos SPEC CHECKSUMS: - desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 - device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720 + desktop_drop: e0b672a7d84c0a6cbc378595e82cdb15f2970a43 + device_info_plus: a56e6e74dbbd2bb92f2da12c64ddd4f67a749041 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478 - macos_window_utils: 933f91f64805e2eb91a5bd057cf97cd097276663 - package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda - screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161 - super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3 - system_theme: c7b9f6659a5caa26c9bc2284da096781e9a6fcbc - universal_video_controls: 6e055af943bd4e3cba227253ac516f790e8923f2 - url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404 - video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 - wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269 - window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8 + irondash_engine_context: 893c7d96d20ce361d7e996f39d360c4c2f9869ba + macos_window_utils: 3bca8603c2a1cf2257351dfe6bbccc9accf739fd + package_info_plus: f0052d280d17aa382b932f399edf32507174e870 + path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 + screen_brightness_macos: 2a3ee243f8051c340381e8e51bcedced8360f421 + screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f + super_native_extensions: c2795d6d9aedf4a79fae25cb6160b71b50549189 + system_theme: ed74293ad07d3a05e3e2d0059ff342360346f1a0 + universal_video_controls: a89c586ac49c73d6965eabe1908c2e47d0b6a9b9 + url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673 + video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b + wakelock_plus: 21ddc249ac4b8d018838dbdabd65c5976c308497 + window_manager: 1d01fa7ac65a6e6f83b965471b1a7fdd3f06166c PODFILE CHECKSUM: b5ff078e9cf81bae88fdc8e0ce3668e57b68e9b6 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 4a3764c8..b4f1e75b 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -30,34 +30,14 @@ 0C42C7612CE386520079F72B /* libopenvino.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C75A2CE386520079F72B /* libopenvino.2460.dylib */; }; 0C42C7622CE386520079F72B /* libopenvino_ir_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7542CE386520079F72B /* libopenvino_ir_frontend.2460.dylib */; }; 0C42C7632CE386520079F72B /* libopenvino_pytorch_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7572CE386520079F72B /* libopenvino_pytorch_frontend.2460.dylib */; }; - 0C42C7642CE386680079F72B /* libopenvino_genai.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7532CE386520079F72B /* libopenvino_genai.2460.dylib */; }; - 0C42C7652CE386680079F72B /* libopenvino_ir_frontend.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7542CE386520079F72B /* libopenvino_ir_frontend.2460.dylib */; }; - 0C42C7662CE386680079F72B /* libopenvino_onnx_frontend.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7552CE386520079F72B /* libopenvino_onnx_frontend.2460.dylib */; }; - 0C42C7672CE386680079F72B /* libopenvino_paddle_frontend.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7562CE386520079F72B /* libopenvino_paddle_frontend.2460.dylib */; }; - 0C42C7682CE386680079F72B /* libopenvino_pytorch_frontend.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7572CE386520079F72B /* libopenvino_pytorch_frontend.2460.dylib */; }; - 0C42C7692CE386680079F72B /* libopenvino_tensorflow_frontend.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7582CE386520079F72B /* libopenvino_tensorflow_frontend.2460.dylib */; }; - 0C42C76A2CE386680079F72B /* libopenvino_tensorflow_lite_frontend.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7592CE386520079F72B /* libopenvino_tensorflow_lite_frontend.2460.dylib */; }; - 0C42C76B2CE388D90079F72B /* libopenvino_c.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C7522CE386520079F72B /* libopenvino_c.2460.dylib */; }; - 0C42C76C2CE388DC0079F72B /* libopenvino.2460.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C42C75A2CE386520079F72B /* libopenvino.2460.dylib */; }; 0C4E1F6C2CECC22800124339 /* libavformat.60.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F692CECC22800124339 /* libavformat.60.dylib */; }; 0C4E1F6D2CECC22800124339 /* libavutil.58.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F6A2CECC22800124339 /* libavutil.58.dylib */; }; 0C4E1F6E2CECC22800124339 /* libswresample.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F6B2CECC22800124339 /* libswresample.4.dylib */; }; 0C4E1F6F2CECC22800124339 /* libavcodec.60.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F672CECC22800124339 /* libavcodec.60.dylib */; }; 0C4E1F702CECC22800124339 /* libavdevice.60.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F682CECC22800124339 /* libavdevice.60.dylib */; }; - 0C4E1F712CECC24900124339 /* libswresample.4.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C4E1F6B2CECC22800124339 /* libswresample.4.dylib */; }; - 0C4E1F722CECC25400124339 /* libavcodec.60.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C4E1F672CECC22800124339 /* libavcodec.60.dylib */; }; - 0C4E1F732CECC25400124339 /* libavdevice.60.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C4E1F682CECC22800124339 /* libavdevice.60.dylib */; }; - 0C4E1F742CECC25400124339 /* libavformat.60.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C4E1F692CECC22800124339 /* libavformat.60.dylib */; }; - 0C4E1F752CECC25400124339 /* libavutil.58.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C4E1F6A2CECC22800124339 /* libavutil.58.dylib */; }; 0C5D47382C6F2F9500307B37 /* libmacos_bindings.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47372C6F2F9500307B37 /* libmacos_bindings.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47392C6F2FB200307B37 /* libmacos_bindings.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D47372C6F2F9500307B37 /* libmacos_bindings.dylib */; }; - 0C5D473A2C6F308000307B37 /* libmacos_bindings.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47372C6F2F9500307B37 /* libmacos_bindings.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 0C5D473C2C6F357C00307B37 /* libblend2d.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D473B2C6F357C00307B37 /* libblend2d.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D473D2C6F359100307B37 /* libblend2d.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D473B2C6F357C00307B37 /* libblend2d.dylib */; }; - 0C5D473E2C6F35E500307B37 /* libblend2d.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D473B2C6F357C00307B37 /* libblend2d.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 0C5D47612C6F382800307B37 /* libopencv_calib3d.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47602C6F382800307B37 /* libopencv_calib3d.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47622C6F383C00307B37 /* libopencv_calib3d.410.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D47602C6F382800307B37 /* libopencv_calib3d.410.dylib */; }; - 0C5D47632C6F391C00307B37 /* libopencv_calib3d.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47602C6F382800307B37 /* libopencv_calib3d.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 0C5D476E2C6F397A00307B37 /* libopencv_ximgproc.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47642C6F397900307B37 /* libopencv_ximgproc.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 0C5D476F2C6F397A00307B37 /* libopencv_features2d.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47652C6F397900307B37 /* libopencv_features2d.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 0C5D47702C6F397A00307B37 /* libopencv_imgproc.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47662C6F397900307B37 /* libopencv_imgproc.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -68,30 +48,9 @@ 0C5D47752C6F397A00307B37 /* libopencv_videoio.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476B2C6F397A00307B37 /* libopencv_videoio.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 0C5D47762C6F397A00307B37 /* libopencv_highgui.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476C2C6F397A00307B37 /* libopencv_highgui.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 0C5D47772C6F397A00307B37 /* libopencv_video.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476D2C6F397A00307B37 /* libopencv_video.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47782C6F398400307B37 /* libopencv_core.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47682C6F397900307B37 /* libopencv_core.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47792C6F398400307B37 /* libopencv_features2d.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47652C6F397900307B37 /* libopencv_features2d.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D477A2C6F398400307B37 /* libopencv_flann.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47692C6F397900307B37 /* libopencv_flann.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D477B2C6F398400307B37 /* libopencv_highgui.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D476C2C6F397A00307B37 /* libopencv_highgui.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D477C2C6F398400307B37 /* libopencv_imgcodecs.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47672C6F397900307B37 /* libopencv_imgcodecs.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D477D2C6F398400307B37 /* libopencv_imgproc.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47662C6F397900307B37 /* libopencv_imgproc.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D477E2C6F398400307B37 /* libopencv_optflow.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D476A2C6F397A00307B37 /* libopencv_optflow.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D477F2C6F398400307B37 /* libopencv_video.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D476D2C6F397A00307B37 /* libopencv_video.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47802C6F398400307B37 /* libopencv_videoio.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D476B2C6F397A00307B37 /* libopencv_videoio.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47812C6F398400307B37 /* libopencv_ximgproc.410.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47642C6F397900307B37 /* libopencv_ximgproc.410.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 0C5D47912C6F3A9B00307B37 /* libopenvino_tokenizers.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47862C6F3A9B00307B37 /* libopenvino_tokenizers.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 0C5D47962C6F3A9B00307B37 /* libcore_tokenizers.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D478B2C6F3A9B00307B37 /* libcore_tokenizers.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47982C6F3ACE00307B37 /* libcore_tokenizers.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D478B2C6F3A9B00307B37 /* libcore_tokenizers.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47A12C6F3ACE00307B37 /* libopenvino_tokenizers.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47862C6F3A9B00307B37 /* libopenvino_tokenizers.dylib */; }; 0C5D47A42C6F3B7000307B37 /* libtbb.12.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47A32C6F3B7000307B37 /* libtbb.12.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47A52C6F3B7700307B37 /* libtbb.12.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47A32C6F3B7000307B37 /* libtbb.12.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47AC2C6F59A200307B37 /* libopenvino_auto_batch_plugin.so in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D47A82C6F59A200307B37 /* libopenvino_auto_batch_plugin.so */; }; - 0C5D47AD2C6F59A200307B37 /* libopenvino_arm_cpu_plugin.so in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D47A92C6F59A200307B37 /* libopenvino_arm_cpu_plugin.so */; }; - 0C5D47AE2C6F59A200307B37 /* libopenvino_hetero_plugin.so in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D47AA2C6F59A200307B37 /* libopenvino_hetero_plugin.so */; }; - 0C5D47AF2C6F59A200307B37 /* libopenvino_auto_plugin.so in Resources */ = {isa = PBXBuildFile; fileRef = 0C5D47AB2C6F59A200307B37 /* libopenvino_auto_plugin.so */; }; - 0C5D47B02C6F5C0200307B37 /* libopenvino_arm_cpu_plugin.so in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47A92C6F59A200307B37 /* libopenvino_arm_cpu_plugin.so */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47B12C6F5C0A00307B37 /* libopenvino_auto_batch_plugin.so in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47A82C6F59A200307B37 /* libopenvino_auto_batch_plugin.so */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47B22C6F5C0E00307B37 /* libopenvino_auto_plugin.so in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47AB2C6F59A200307B37 /* libopenvino_auto_plugin.so */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 0C5D47B32C6F5C1300307B37 /* libopenvino_hetero_plugin.so in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 0C5D47AA2C6F59A200307B37 /* libopenvino_hetero_plugin.so */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 213B56C50EEAAE6190A0A25B /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB5E7865DB70376BADAAEAE6 /* Pods_RunnerTests.framework */; }; 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; @@ -99,6 +58,10 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 37774C592D2D294400118F12 /* libopenvino_auto_batch_plugin.so in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47A82C6F59A200307B37 /* libopenvino_auto_batch_plugin.so */; }; + 37774C5A2D2D296F00118F12 /* libopenvino_auto_plugin.so in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47AB2C6F59A200307B37 /* libopenvino_auto_plugin.so */; }; + 37774C5B2D2D297D00118F12 /* libopenvino_hetero_plugin.so in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47AA2C6F59A200307B37 /* libopenvino_hetero_plugin.so */; }; + 37774C5C2D2D540500118F12 /* libopenvino_arm_cpu_plugin.so in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47A92C6F59A200307B37 /* libopenvino_arm_cpu_plugin.so */; }; 428B81CFE7DD85E5D6A540E5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11E6C6B7198D7B3B20F4A75C /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -119,53 +82,6 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 0C42C7672CE386680079F72B /* libopenvino_paddle_frontend.2460.dylib in Bundle Framework */, - 0C4E1F712CECC24900124339 /* libswresample.4.dylib in Bundle Framework */, - 0C5D47B32C6F5C1300307B37 /* libopenvino_hetero_plugin.so in Bundle Framework */, - 0C4E1F752CECC25400124339 /* libavutil.58.dylib in Bundle Framework */, - 0C42C76C2CE388DC0079F72B /* libopenvino.2460.dylib in Bundle Framework */, - 0C42C7662CE386680079F72B /* libopenvino_onnx_frontend.2460.dylib in Bundle Framework */, - 0C5D47B12C6F5C0A00307B37 /* libopenvino_auto_batch_plugin.so in Bundle Framework */, - 0C5D47B22C6F5C0E00307B37 /* libopenvino_auto_plugin.so in Bundle Framework */, - 0C5D473E2C6F35E500307B37 /* libblend2d.dylib in Bundle Framework */, - 0C4E1F732CECC25400124339 /* libavdevice.60.dylib in Bundle Framework */, - 0C5D47782C6F398400307B37 /* libopencv_core.410.dylib in Bundle Framework */, - 0C42C7642CE386680079F72B /* libopenvino_genai.2460.dylib in Bundle Framework */, - 0C5D47B02C6F5C0200307B37 /* libopenvino_arm_cpu_plugin.so in Bundle Framework */, - 0C4E1F742CECC25400124339 /* libavformat.60.dylib in Bundle Framework */, - 0C5D47802C6F398400307B37 /* libopencv_videoio.410.dylib in Bundle Framework */, - 0C5D47792C6F398400307B37 /* libopencv_features2d.410.dylib in Bundle Framework */, - 0C42C7682CE386680079F72B /* libopenvino_pytorch_frontend.2460.dylib in Bundle Framework */, - 0C42C76A2CE386680079F72B /* libopenvino_tensorflow_lite_frontend.2460.dylib in Bundle Framework */, - 0C5D47632C6F391C00307B37 /* libopencv_calib3d.410.dylib in Bundle Framework */, - 0C5D477A2C6F398400307B37 /* libopencv_flann.410.dylib in Bundle Framework */, - 0C5D477B2C6F398400307B37 /* libopencv_highgui.410.dylib in Bundle Framework */, - 0C5D47A12C6F3ACE00307B37 /* libopenvino_tokenizers.dylib in Bundle Framework */, - 0C5D477E2C6F398400307B37 /* libopencv_optflow.410.dylib in Bundle Framework */, - 0C5D477D2C6F398400307B37 /* libopencv_imgproc.410.dylib in Bundle Framework */, - 0C5D477F2C6F398400307B37 /* libopencv_video.410.dylib in Bundle Framework */, - 0C5D47812C6F398400307B37 /* libopencv_ximgproc.410.dylib in Bundle Framework */, - 0C5D473A2C6F308000307B37 /* libmacos_bindings.dylib in Bundle Framework */, - 0C4E1F722CECC25400124339 /* libavcodec.60.dylib in Bundle Framework */, - 0C42C7692CE386680079F72B /* libopenvino_tensorflow_frontend.2460.dylib in Bundle Framework */, - 0C5D47A52C6F3B7700307B37 /* libtbb.12.dylib in Bundle Framework */, - 0C5D477C2C6F398400307B37 /* libopencv_imgcodecs.410.dylib in Bundle Framework */, - 0C5D47982C6F3ACE00307B37 /* libcore_tokenizers.dylib in Bundle Framework */, - 0C42C76B2CE388D90079F72B /* libopenvino_c.2460.dylib in Bundle Framework */, - 0C42C7652CE386680079F72B /* libopenvino_ir_frontend.2460.dylib in Bundle Framework */, - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 0C42C7522CE386520079F72B /* libopenvino_c.2460.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopenvino_c.2460.dylib; path = ../bindings/libopenvino_c.2460.dylib; sourceTree = SOURCE_ROOT; }; 0C42C7532CE386520079F72B /* libopenvino_genai.2460.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libopenvino_genai.2460.dylib; path = ../bindings/libopenvino_genai.2460.dylib; sourceTree = SOURCE_ROOT; }; @@ -242,6 +158,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 37774C5C2D2D540500118F12 /* libopenvino_arm_cpu_plugin.so in Frameworks */, + 37774C5B2D2D297D00118F12 /* libopenvino_hetero_plugin.so in Frameworks */, + 37774C5A2D2D296F00118F12 /* libopenvino_auto_plugin.so in Frameworks */, + 37774C592D2D294400118F12 /* libopenvino_auto_batch_plugin.so in Frameworks */, 0C5D47A42C6F3B7000307B37 /* libtbb.12.dylib in Frameworks */, 428B81CFE7DD85E5D6A540E5 /* Pods_Runner.framework in Frameworks */, 0C5D47722C6F397A00307B37 /* libopencv_core.410.dylib in Frameworks */, @@ -440,8 +360,8 @@ 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, + 37774C5D2D2EEF8A00118F12 /* Bundle Libraries */, + 3399D490228B24CF009A79C7 /* Run Script */, 9B80A0F0DE430B7EAD998043 /* [CP] Embed Pods Frameworks */, ); buildRules = ( @@ -519,13 +439,6 @@ files = ( 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - 0C5D47AC2C6F59A200307B37 /* libopenvino_auto_batch_plugin.so in Resources */, - 0C5D47AF2C6F59A200307B37 /* libopenvino_auto_plugin.so in Resources */, - 0C5D47392C6F2FB200307B37 /* libmacos_bindings.dylib in Resources */, - 0C5D47622C6F383C00307B37 /* libopencv_calib3d.410.dylib in Resources */, - 0C5D47AD2C6F59A200307B37 /* libopenvino_arm_cpu_plugin.so in Resources */, - 0C5D47AE2C6F59A200307B37 /* libopenvino_hetero_plugin.so in Resources */, - 0C5D473D2C6F359100307B37 /* libblend2d.dylib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -554,7 +467,7 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 3399D490228B24CF009A79C7 /* ShellScript */ = { + 3399D490228B24CF009A79C7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; @@ -564,6 +477,7 @@ ); inputPaths = ( ); + name = "Run Script"; outputFileListPaths = ( ); outputPaths = ( @@ -590,7 +504,26 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire\n"; + }; + 37774C5D2D2EEF8A00118F12 /* Bundle Libraries */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Bundle Libraries"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PROJECT_DIR}\"/Scripts/bundle_libraries.sh\n"; }; 543C0C5B7DCBDB2F3CBC7E75 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib index 34342f35..e5e999be 100644 --- a/macos/Runner/Base.lproj/MainMenu.xib +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -1,7 +1,6 @@ - diff --git a/macos/Scripts/bundle_libraries.sh b/macos/Scripts/bundle_libraries.sh new file mode 100755 index 00000000..d8632c65 --- /dev/null +++ b/macos/Scripts/bundle_libraries.sh @@ -0,0 +1,75 @@ + +#!/usr/bin/env bash +BUNDLE_FRAMEWORK_LIBS_SOURCE_DIR='../bindings' +BUNDLE_FRAMEWORK_LIBS_TARGET_DIR="${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks" +BUNDLE_FRAMEWORK_LIBS=( + "libopenvino_paddle_frontend.2460.dylib" + "libswresample.4.dylib" + "libopenvino_hetero_plugin.so" + "libavutil.58.dylib" + "libopenvino.2460.dylib" + "libopenvino_onnx_frontend.2460.dylib" + "libopenvino_auto_batch_plugin.so" + "libopenvino_auto_plugin.so" + "libblend2d.dylib" + "libavdevice.60.dylib" + "libopencv_core.410.dylib" + "libopenvino_genai.2460.dylib" + "libopenvino_arm_cpu_plugin.so" + "libavformat.60.dylib" + "libopencv_videoio.410.dylib" + "libopencv_features2d.410.dylib" + "libopenvino_pytorch_frontend.2460.dylib" + "libopenvino_tensorflow_lite_frontend.2460.dylib" + "libopencv_calib3d.410.dylib" + "libopencv_flann.410.dylib" + "libopencv_highgui.410.dylib" + "libopenvino_tokenizers.dylib" + "libopencv_optflow.410.dylib" + "libopencv_imgproc.410.dylib" + "libopencv_video.410.dylib" + "libopencv_ximgproc.410.dylib" + "libmacos_bindings.dylib" + "libavcodec.60.dylib" + "libopenvino_tensorflow_frontend.2460.dylib" + "libtbb.12.dylib" + "libopencv_imgcodecs.410.dylib" + "libcore_tokenizers.dylib" + "libopenvino_c.2460.dylib" + "libopenvino_ir_frontend.2460.dylib" +) +BUNDLE_FRAMEWORK_LIBS_TO_SIGN=( + "libopenvino_hetero_plugin.so" + "libopenvino_auto_batch_plugin.so" + "libopenvino_auto_plugin.so" + "libblend2d.dylib" + "libopencv_core.410.dylib" + "libopenvino_arm_cpu_plugin.so" + "libopencv_videoio.410.dylib" + "libopencv_features2d.410.dylib" + "libopencv_calib3d.410.dylib" + "libopencv_flann.410.dylib" + "libopencv_highgui.410.dylib" + "libopencv_optflow.410.dylib" + "libopencv_imgproc.410.dylib" + "libopencv_video.410.dylib" + "libopencv_ximgproc.410.dylib" + "libmacos_bindings.dylib" + "libtbb.12.dylib" + "libopencv_imgcodecs.410.dylib" + "libcore_tokenizers.dylib" +) + +# Copy the libraries to the app bundle +if [ -z "${FLUTTER_NOT_BUNDLE_LIBRARIES}" ]; then + for lib in "${BUNDLE_FRAMEWORK_LIBS[@]}"; do + rsync -av "${BUNDLE_FRAMEWORK_LIBS_SOURCE_DIR}/${lib}" "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}" + done +fi + +# Sign the libraries +if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then + for lib in "${BUNDLE_FRAMEWORK_LIBS_TO_SIGN[@]}"; do + codesign --force --verbose --sign "${EXPANDED_CODE_SIGN_IDENTITY}" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/${lib}" + done +fi From a3b50315d030c2e28e89bc4e80352b61b62d1474 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 9 Jan 2025 00:49:48 +0100 Subject: [PATCH 17/68] Fixed ui build --- .github/workflows/build-and-test.yml | 4 +++- .github/workflows/build-ui.yml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6219cb95..bc8717b8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,12 +12,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-latest, macos-latest] + os: [macos-latest] uses: ./.github/workflows/build-ui.yml with: os: ${{ matrix.os }} build-linux-bindings: + if: false name: Build Linux Bindings runs-on: ubuntu-22.04-16-cores permissions: @@ -42,6 +43,7 @@ jobs: if-no-files-found: error build-windows-bindings: + if: false permissions: contents: write uses: ./.github/workflows/build-windows-bindings.yml diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 21ca93eb..3285c3ae 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -24,6 +24,7 @@ jobs: elif [[ "${{ runner.os }}" == "Windows" ]]; then echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV elif [[ "${{ runner.os }}" == "macOS" ]]; then + mkdir bindings echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV From 12ec6fa017c2a3b700538ddb91fa16e98f7c2dfd Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 9 Jan 2025 01:02:50 +0100 Subject: [PATCH 18/68] debug --- .github/workflows/build-ui.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 3285c3ae..46a9c337 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -25,6 +25,7 @@ jobs: echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV elif [[ "${{ runner.os }}" == "macOS" ]]; then mkdir bindings + ls -la /Users/runner/work/openvino_testdrive/openvino_testdrive/macos/.. echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV From 2a0f06d91541bd6f48a1730a62882182c490c835 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 9 Jan 2025 01:04:25 +0100 Subject: [PATCH 19/68] debug --- .github/workflows/build-ui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 46a9c337..ac92743c 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -25,7 +25,7 @@ jobs: echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV elif [[ "${{ runner.os }}" == "macOS" ]]; then mkdir bindings - ls -la /Users/runner/work/openvino_testdrive/openvino_testdrive/macos/.. + ls -la /Users/runner/work/openvino_testdrive/openvino_testdrive/ echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV From 88560a3b6fbca055fcd99685cb3d640b1299eceb Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 9 Jan 2025 01:06:18 +0100 Subject: [PATCH 20/68] Debug --- .github/workflows/build-ui.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index ac92743c..2b30eb3f 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -16,6 +16,7 @@ jobs: contents: write steps: + - uses: actions/checkout@v4 - name: Determine comon OS vars shell: bash run: | @@ -29,7 +30,6 @@ jobs: echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV - - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2.18.0 with: channel: 'stable' From 41e8e36cf132e714d73de19025cd5de18bd25739 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 13 Jan 2025 08:35:46 +0100 Subject: [PATCH 21/68] Refactoring macOS library bundling and signing in proccess --- .github/workflows/build-ui.yml | 1 - macos/Runner.xcodeproj/project.pbxproj | 102 +++++++---------- macos/Scripts/bundle_libraries.sh | 75 ------------- macos/Scripts/libraries_tools.sh | 145 +++++++++++++++++++++++++ 4 files changed, 186 insertions(+), 137 deletions(-) delete mode 100755 macos/Scripts/bundle_libraries.sh create mode 100755 macos/Scripts/libraries_tools.sh diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 2b30eb3f..8fa03303 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -26,7 +26,6 @@ jobs: echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV elif [[ "${{ runner.os }}" == "macOS" ]]; then mkdir bindings - ls -la /Users/runner/work/openvino_testdrive/openvino_testdrive/ echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index b4f1e75b..4194d307 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -21,36 +21,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 0C42C75B2CE386520079F72B /* libopenvino_tensorflow_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7582CE386520079F72B /* libopenvino_tensorflow_frontend.2460.dylib */; }; - 0C42C75C2CE386520079F72B /* libopenvino_tensorflow_lite_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7592CE386520079F72B /* libopenvino_tensorflow_lite_frontend.2460.dylib */; }; - 0C42C75D2CE386520079F72B /* libopenvino_paddle_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7562CE386520079F72B /* libopenvino_paddle_frontend.2460.dylib */; }; - 0C42C75E2CE386520079F72B /* libopenvino_onnx_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7552CE386520079F72B /* libopenvino_onnx_frontend.2460.dylib */; }; - 0C42C75F2CE386520079F72B /* libopenvino_c.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7522CE386520079F72B /* libopenvino_c.2460.dylib */; }; - 0C42C7602CE386520079F72B /* libopenvino_genai.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7532CE386520079F72B /* libopenvino_genai.2460.dylib */; }; - 0C42C7612CE386520079F72B /* libopenvino.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C75A2CE386520079F72B /* libopenvino.2460.dylib */; }; - 0C42C7622CE386520079F72B /* libopenvino_ir_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7542CE386520079F72B /* libopenvino_ir_frontend.2460.dylib */; }; - 0C42C7632CE386520079F72B /* libopenvino_pytorch_frontend.2460.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C42C7572CE386520079F72B /* libopenvino_pytorch_frontend.2460.dylib */; }; - 0C4E1F6C2CECC22800124339 /* libavformat.60.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F692CECC22800124339 /* libavformat.60.dylib */; }; - 0C4E1F6D2CECC22800124339 /* libavutil.58.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F6A2CECC22800124339 /* libavutil.58.dylib */; }; - 0C4E1F6E2CECC22800124339 /* libswresample.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F6B2CECC22800124339 /* libswresample.4.dylib */; }; - 0C4E1F6F2CECC22800124339 /* libavcodec.60.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F672CECC22800124339 /* libavcodec.60.dylib */; }; - 0C4E1F702CECC22800124339 /* libavdevice.60.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C4E1F682CECC22800124339 /* libavdevice.60.dylib */; }; - 0C5D47382C6F2F9500307B37 /* libmacos_bindings.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47372C6F2F9500307B37 /* libmacos_bindings.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D473C2C6F357C00307B37 /* libblend2d.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D473B2C6F357C00307B37 /* libblend2d.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47612C6F382800307B37 /* libopencv_calib3d.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47602C6F382800307B37 /* libopencv_calib3d.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D476E2C6F397A00307B37 /* libopencv_ximgproc.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47642C6F397900307B37 /* libopencv_ximgproc.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D476F2C6F397A00307B37 /* libopencv_features2d.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47652C6F397900307B37 /* libopencv_features2d.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47702C6F397A00307B37 /* libopencv_imgproc.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47662C6F397900307B37 /* libopencv_imgproc.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47712C6F397A00307B37 /* libopencv_imgcodecs.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47672C6F397900307B37 /* libopencv_imgcodecs.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47722C6F397A00307B37 /* libopencv_core.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47682C6F397900307B37 /* libopencv_core.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47732C6F397A00307B37 /* libopencv_flann.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47692C6F397900307B37 /* libopencv_flann.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47742C6F397A00307B37 /* libopencv_optflow.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476A2C6F397A00307B37 /* libopencv_optflow.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47752C6F397A00307B37 /* libopencv_videoio.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476B2C6F397A00307B37 /* libopencv_videoio.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47762C6F397A00307B37 /* libopencv_highgui.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476C2C6F397A00307B37 /* libopencv_highgui.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47772C6F397A00307B37 /* libopencv_video.410.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D476D2C6F397A00307B37 /* libopencv_video.410.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47912C6F3A9B00307B37 /* libopenvino_tokenizers.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47862C6F3A9B00307B37 /* libopenvino_tokenizers.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47962C6F3A9B00307B37 /* libcore_tokenizers.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D478B2C6F3A9B00307B37 /* libcore_tokenizers.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 0C5D47A42C6F3B7000307B37 /* libtbb.12.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5D47A32C6F3B7000307B37 /* libtbb.12.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 213B56C50EEAAE6190A0A25B /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB5E7865DB70376BADAAEAE6 /* Pods_RunnerTests.framework */; }; 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; @@ -162,37 +132,7 @@ 37774C5B2D2D297D00118F12 /* libopenvino_hetero_plugin.so in Frameworks */, 37774C5A2D2D296F00118F12 /* libopenvino_auto_plugin.so in Frameworks */, 37774C592D2D294400118F12 /* libopenvino_auto_batch_plugin.so in Frameworks */, - 0C5D47A42C6F3B7000307B37 /* libtbb.12.dylib in Frameworks */, 428B81CFE7DD85E5D6A540E5 /* Pods_Runner.framework in Frameworks */, - 0C5D47722C6F397A00307B37 /* libopencv_core.410.dylib in Frameworks */, - 0C5D47772C6F397A00307B37 /* libopencv_video.410.dylib in Frameworks */, - 0C5D47752C6F397A00307B37 /* libopencv_videoio.410.dylib in Frameworks */, - 0C5D47702C6F397A00307B37 /* libopencv_imgproc.410.dylib in Frameworks */, - 0C5D47612C6F382800307B37 /* libopencv_calib3d.410.dylib in Frameworks */, - 0C5D473C2C6F357C00307B37 /* libblend2d.dylib in Frameworks */, - 0C5D476F2C6F397A00307B37 /* libopencv_features2d.410.dylib in Frameworks */, - 0C5D47732C6F397A00307B37 /* libopencv_flann.410.dylib in Frameworks */, - 0C5D47962C6F3A9B00307B37 /* libcore_tokenizers.dylib in Frameworks */, - 0C5D47742C6F397A00307B37 /* libopencv_optflow.410.dylib in Frameworks */, - 0C5D47762C6F397A00307B37 /* libopencv_highgui.410.dylib in Frameworks */, - 0C5D476E2C6F397A00307B37 /* libopencv_ximgproc.410.dylib in Frameworks */, - 0C42C75B2CE386520079F72B /* libopenvino_tensorflow_frontend.2460.dylib in Frameworks */, - 0C42C75C2CE386520079F72B /* libopenvino_tensorflow_lite_frontend.2460.dylib in Frameworks */, - 0C42C75D2CE386520079F72B /* libopenvino_paddle_frontend.2460.dylib in Frameworks */, - 0C42C75E2CE386520079F72B /* libopenvino_onnx_frontend.2460.dylib in Frameworks */, - 0C42C75F2CE386520079F72B /* libopenvino_c.2460.dylib in Frameworks */, - 0C4E1F6C2CECC22800124339 /* libavformat.60.dylib in Frameworks */, - 0C4E1F6D2CECC22800124339 /* libavutil.58.dylib in Frameworks */, - 0C4E1F6E2CECC22800124339 /* libswresample.4.dylib in Frameworks */, - 0C4E1F6F2CECC22800124339 /* libavcodec.60.dylib in Frameworks */, - 0C4E1F702CECC22800124339 /* libavdevice.60.dylib in Frameworks */, - 0C42C7602CE386520079F72B /* libopenvino_genai.2460.dylib in Frameworks */, - 0C42C7612CE386520079F72B /* libopenvino.2460.dylib in Frameworks */, - 0C42C7622CE386520079F72B /* libopenvino_ir_frontend.2460.dylib in Frameworks */, - 0C42C7632CE386520079F72B /* libopenvino_pytorch_frontend.2460.dylib in Frameworks */, - 0C5D47382C6F2F9500307B37 /* libmacos_bindings.dylib in Frameworks */, - 0C5D47712C6F397A00307B37 /* libopencv_imgcodecs.410.dylib in Frameworks */, - 0C5D47912C6F3A9B00307B37 /* libopenvino_tokenizers.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -361,6 +301,8 @@ 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 37774C5D2D2EEF8A00118F12 /* Bundle Libraries */, + 37774C5E2D2F532900118F12 /* Custom Link With Libraries */, + 37774C5F2D2F542600118F12 /* Sign Libraries */, 3399D490228B24CF009A79C7 /* Run Script */, 9B80A0F0DE430B7EAD998043 /* [CP] Embed Pods Frameworks */, ); @@ -523,7 +465,45 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PROJECT_DIR}\"/Scripts/bundle_libraries.sh\n"; + shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh bundle\n"; + }; + 37774C5E2D2F532900118F12 /* Custom Link With Libraries */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Custom Link With Libraries"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh link\n"; + }; + 37774C5F2D2F542600118F12 /* Sign Libraries */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Sign Libraries"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh link\n"; }; 543C0C5B7DCBDB2F3CBC7E75 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; diff --git a/macos/Scripts/bundle_libraries.sh b/macos/Scripts/bundle_libraries.sh deleted file mode 100755 index d8632c65..00000000 --- a/macos/Scripts/bundle_libraries.sh +++ /dev/null @@ -1,75 +0,0 @@ - -#!/usr/bin/env bash -BUNDLE_FRAMEWORK_LIBS_SOURCE_DIR='../bindings' -BUNDLE_FRAMEWORK_LIBS_TARGET_DIR="${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks" -BUNDLE_FRAMEWORK_LIBS=( - "libopenvino_paddle_frontend.2460.dylib" - "libswresample.4.dylib" - "libopenvino_hetero_plugin.so" - "libavutil.58.dylib" - "libopenvino.2460.dylib" - "libopenvino_onnx_frontend.2460.dylib" - "libopenvino_auto_batch_plugin.so" - "libopenvino_auto_plugin.so" - "libblend2d.dylib" - "libavdevice.60.dylib" - "libopencv_core.410.dylib" - "libopenvino_genai.2460.dylib" - "libopenvino_arm_cpu_plugin.so" - "libavformat.60.dylib" - "libopencv_videoio.410.dylib" - "libopencv_features2d.410.dylib" - "libopenvino_pytorch_frontend.2460.dylib" - "libopenvino_tensorflow_lite_frontend.2460.dylib" - "libopencv_calib3d.410.dylib" - "libopencv_flann.410.dylib" - "libopencv_highgui.410.dylib" - "libopenvino_tokenizers.dylib" - "libopencv_optflow.410.dylib" - "libopencv_imgproc.410.dylib" - "libopencv_video.410.dylib" - "libopencv_ximgproc.410.dylib" - "libmacos_bindings.dylib" - "libavcodec.60.dylib" - "libopenvino_tensorflow_frontend.2460.dylib" - "libtbb.12.dylib" - "libopencv_imgcodecs.410.dylib" - "libcore_tokenizers.dylib" - "libopenvino_c.2460.dylib" - "libopenvino_ir_frontend.2460.dylib" -) -BUNDLE_FRAMEWORK_LIBS_TO_SIGN=( - "libopenvino_hetero_plugin.so" - "libopenvino_auto_batch_plugin.so" - "libopenvino_auto_plugin.so" - "libblend2d.dylib" - "libopencv_core.410.dylib" - "libopenvino_arm_cpu_plugin.so" - "libopencv_videoio.410.dylib" - "libopencv_features2d.410.dylib" - "libopencv_calib3d.410.dylib" - "libopencv_flann.410.dylib" - "libopencv_highgui.410.dylib" - "libopencv_optflow.410.dylib" - "libopencv_imgproc.410.dylib" - "libopencv_video.410.dylib" - "libopencv_ximgproc.410.dylib" - "libmacos_bindings.dylib" - "libtbb.12.dylib" - "libopencv_imgcodecs.410.dylib" - "libcore_tokenizers.dylib" -) - -# Copy the libraries to the app bundle -if [ -z "${FLUTTER_NOT_BUNDLE_LIBRARIES}" ]; then - for lib in "${BUNDLE_FRAMEWORK_LIBS[@]}"; do - rsync -av "${BUNDLE_FRAMEWORK_LIBS_SOURCE_DIR}/${lib}" "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}" - done -fi - -# Sign the libraries -if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then - for lib in "${BUNDLE_FRAMEWORK_LIBS_TO_SIGN[@]}"; do - codesign --force --verbose --sign "${EXPANDED_CODE_SIGN_IDENTITY}" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/${lib}" - done -fi diff --git a/macos/Scripts/libraries_tools.sh b/macos/Scripts/libraries_tools.sh new file mode 100755 index 00000000..a351a535 --- /dev/null +++ b/macos/Scripts/libraries_tools.sh @@ -0,0 +1,145 @@ + +#!/usr/bin/env bash +BUNDLE_FRAMEWORK_LIBS_SOURCE_DIR='../bindings' +BUNDLE_FRAMEWORK_LIBS_TARGET_DIR="${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks" +BUNDLE_FRAMEWORK_LIBS=( + "libswresample.4.dylib" + "libavcodec.60.dylib" + "libavutil.58.dylib" + "libavdevice.60.dylib" + "libavformat.60.dylib" + "libopenvino_paddle_frontend.2460.dylib" + "libopenvino_hetero_plugin.so" + "libopenvino.2460.dylib" + "libopenvino_onnx_frontend.2460.dylib" + "libopenvino_auto_batch_plugin.so" + "libopenvino_auto_plugin.so" + "libblend2d.dylib" + "libopencv_core.410.dylib" + "libopenvino_genai.2460.dylib" + "libopenvino_arm_cpu_plugin.so" + "libopencv_videoio.410.dylib" + "libopencv_features2d.410.dylib" + "libopenvino_pytorch_frontend.2460.dylib" + "libopenvino_tensorflow_lite_frontend.2460.dylib" + "libopencv_calib3d.410.dylib" + "libopencv_flann.410.dylib" + "libopencv_highgui.410.dylib" + "libopenvino_tokenizers.dylib" + "libopencv_optflow.410.dylib" + "libopencv_imgproc.410.dylib" + "libopencv_video.410.dylib" + "libopencv_ximgproc.410.dylib" + "libmacos_bindings.dylib" + "libopenvino_tensorflow_frontend.2460.dylib" + "libtbb.12.dylib" + "libopencv_imgcodecs.410.dylib" + "libcore_tokenizers.dylib" + "libopenvino_c.2460.dylib" + "libopenvino_ir_frontend.2460.dylib" +) +BUNDLE_FRAMEWORK_LIBS_TO_SIGN=( + "libavutil.58.dylib" + "libavformat.60.dylib" + "libavcodec.60.dylib" + "libavdevice.60.dylib" + "libswresample.4.dylib" + "libopenvino_hetero_plugin.so" + "libopenvino_auto_batch_plugin.so" + "libopenvino_auto_plugin.so" + "libblend2d.dylib" + "libopencv_core.410.dylib" + "libopenvino_arm_cpu_plugin.so" + "libopencv_videoio.410.dylib" + "libopencv_features2d.410.dylib" + "libopencv_calib3d.410.dylib" + "libopencv_flann.410.dylib" + "libopencv_highgui.410.dylib" + "libopencv_optflow.410.dylib" + "libopencv_imgproc.410.dylib" + "libopencv_video.410.dylib" + "libopencv_ximgproc.410.dylib" + "libmacos_bindings.dylib" + "libtbb.12.dylib" + "libopencv_imgcodecs.410.dylib" + "libcore_tokenizers.dylib" +) +FIX_LIBRARIES_LINK_SOURCES=( + "libmacos_bindings.dylib" + "libopencv_videoio.410.dylib" + "libopencv_videoio.410.dylib" +) +FIX_LIBRARIES_LINK_TARGETS=( + "libavutil.58.dylib" + "libavformat.60.dylib" + "libavcodec.60.dylib" + "libavdevice.60.dylib" + "libswresample.4.dylib" +) + +function join_by { + local d=${1-} f=${2-} + if shift 2; then + printf %s "$f" "${@/#/$d}" + fi +} + + +Bundle (){ + # Copy the libraries to the app bundle + if [ -z "${FLUTTER_NOT_BUNDLE_LIBRARIES}" ]; then + for lib in "${BUNDLE_FRAMEWORK_LIBS[@]}"; do + rsync -av "${BUNDLE_FRAMEWORK_LIBS_SOURCE_DIR}/${lib}" "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}" + done + fi +} + +Link (){ + echo '' > debug.log + if [ -z "${FIX_LIBRARIES_LINKS}" ]; then + # for lib in "${BUNDLE_FRAMEWORK_LIBS[@]}"; do + # local dependencies=$(otool -L "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/$lib" | awk '{print $1}' | grep -v : | grep -v '^$' | grep -v '^@rpath' | grep -v '^@loader_path' | grep -v '^@executable_path') + # local changed=false + # for dep in $dependencies; do + # local basename=$(basename "$dep") + # for fix in "${FIX_LIBRARIES_LINK_TARGETS[@]}"; do + # if [[ "$basename" == "$fix" ]]; then + # echo "Fixing $dep link for $lib" >> debug.log + # install_name_tool -change "$dep" "@rpath/$basename" "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/$lib" + # changed=true + # fi + # done + # done + # if [[ "$changed" == true ]]; then + # codesign --force --verbose --sign "-" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/$lib" + # fi + # done + # ${TOOLCHAIN_DIR}/usr/bin/clang -dynamiclib -o "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/MacOS/OpenVINO Test Drive.$(echo $CONFIGURATION | awk '{print tolower($0)}').dylib" -L"${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}" -l$(join_by " -l" "${BUNDLE_FRAMEWORK_LIBS[@]}") + # install_name_tool "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/MacOS/OpenVINO Test Drive.$(echo $CONFIGURATION | awk '{print tolower($0)}').dylib" -add_rpath "@rpa + echo "Fixing libraries links" + fi +} + +Sign (){ + # Sign the libraries + if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then + for lib in "${BUNDLE_FRAMEWORK_LIBS_TO_SIGN[@]}"; do + codesign --force --verbose --sign "${EXPANDED_CODE_SIGN_IDENTITY}" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/${lib}" + done + fi +} + +if [[ $# -eq 0 ]]; then + Bundle +else + case $1 in + "bundle") + Bundle ;; + "link") + Link ;; + "sign") + Sign ;; + *) + echo "Invalid argument: $1" ;; + esac +fi \ No newline at end of file From 2bce9d54b02107dfe8371e2a97883d8e5f8d3e6e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Tue, 14 Jan 2025 21:08:18 +0100 Subject: [PATCH 22/68] Fixed build with ffmpeg --- macos/Runner.xcodeproj/project.pbxproj | 22 +---------- macos/Scripts/libraries_tools.sh | 48 ----------------------- openvino_bindings/WORKSPACE | 4 +- openvino_bindings/scripts/setup_ffmpeg.sh | 8 ++-- openvino_bindings/src/BUILD | 1 + 5 files changed, 8 insertions(+), 75 deletions(-) diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 4194d307..6cf6b103 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -301,7 +301,6 @@ 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 37774C5D2D2EEF8A00118F12 /* Bundle Libraries */, - 37774C5E2D2F532900118F12 /* Custom Link With Libraries */, 37774C5F2D2F542600118F12 /* Sign Libraries */, 3399D490228B24CF009A79C7 /* Run Script */, 9B80A0F0DE430B7EAD998043 /* [CP] Embed Pods Frameworks */, @@ -467,25 +466,6 @@ shellPath = /bin/sh; shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh bundle\n"; }; - 37774C5E2D2F532900118F12 /* Custom Link With Libraries */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Custom Link With Libraries"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh link\n"; - }; 37774C5F2D2F542600118F12 /* Sign Libraries */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -503,7 +483,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh link\n"; + shellScript = "\"${PROJECT_DIR}\"/Scripts/libraries_tools.sh sign\n"; }; 543C0C5B7DCBDB2F3CBC7E75 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; diff --git a/macos/Scripts/libraries_tools.sh b/macos/Scripts/libraries_tools.sh index a351a535..aec884b3 100755 --- a/macos/Scripts/libraries_tools.sh +++ b/macos/Scripts/libraries_tools.sh @@ -64,26 +64,6 @@ BUNDLE_FRAMEWORK_LIBS_TO_SIGN=( "libopencv_imgcodecs.410.dylib" "libcore_tokenizers.dylib" ) -FIX_LIBRARIES_LINK_SOURCES=( - "libmacos_bindings.dylib" - "libopencv_videoio.410.dylib" - "libopencv_videoio.410.dylib" -) -FIX_LIBRARIES_LINK_TARGETS=( - "libavutil.58.dylib" - "libavformat.60.dylib" - "libavcodec.60.dylib" - "libavdevice.60.dylib" - "libswresample.4.dylib" -) - -function join_by { - local d=${1-} f=${2-} - if shift 2; then - printf %s "$f" "${@/#/$d}" - fi -} - Bundle (){ # Copy the libraries to the app bundle @@ -94,32 +74,6 @@ Bundle (){ fi } -Link (){ - echo '' > debug.log - if [ -z "${FIX_LIBRARIES_LINKS}" ]; then - # for lib in "${BUNDLE_FRAMEWORK_LIBS[@]}"; do - # local dependencies=$(otool -L "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/$lib" | awk '{print $1}' | grep -v : | grep -v '^$' | grep -v '^@rpath' | grep -v '^@loader_path' | grep -v '^@executable_path') - # local changed=false - # for dep in $dependencies; do - # local basename=$(basename "$dep") - # for fix in "${FIX_LIBRARIES_LINK_TARGETS[@]}"; do - # if [[ "$basename" == "$fix" ]]; then - # echo "Fixing $dep link for $lib" >> debug.log - # install_name_tool -change "$dep" "@rpath/$basename" "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/$lib" - # changed=true - # fi - # done - # done - # if [[ "$changed" == true ]]; then - # codesign --force --verbose --sign "-" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/$lib" - # fi - # done - # ${TOOLCHAIN_DIR}/usr/bin/clang -dynamiclib -o "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/MacOS/OpenVINO Test Drive.$(echo $CONFIGURATION | awk '{print tolower($0)}').dylib" -L"${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}" -l$(join_by " -l" "${BUNDLE_FRAMEWORK_LIBS[@]}") - # install_name_tool "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/MacOS/OpenVINO Test Drive.$(echo $CONFIGURATION | awk '{print tolower($0)}').dylib" -add_rpath "@rpa - echo "Fixing libraries links" - fi -} - Sign (){ # Sign the libraries if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then @@ -135,8 +89,6 @@ else case $1 in "bundle") Bundle ;; - "link") - Link ;; "sign") Sign ;; *) diff --git a/openvino_bindings/WORKSPACE b/openvino_bindings/WORKSPACE index e7d83dd0..26e325bd 100644 --- a/openvino_bindings/WORKSPACE +++ b/openvino_bindings/WORKSPACE @@ -109,13 +109,13 @@ git_repository( new_local_repository( name = "linux_ffmpeg", build_file = "//third_party/ffmpeg:linux.BUILD", - path = "/usr" + path = "/opt/ffmpeg" ) new_local_repository( name = "mac_ffmpeg", build_file = "//third_party/ffmpeg:mac.BUILD", - path = "/opt/homebrew/opt/ffmpeg@6", + path = "/opt/ffmpeg", ) new_local_repository( diff --git a/openvino_bindings/scripts/setup_ffmpeg.sh b/openvino_bindings/scripts/setup_ffmpeg.sh index 8435935e..3371078b 100755 --- a/openvino_bindings/scripts/setup_ffmpeg.sh +++ b/openvino_bindings/scripts/setup_ffmpeg.sh @@ -5,10 +5,10 @@ echo "Installing ffmpeg from source" rm -rf /tmp/build_ffmpeg mkdir /tmp/build_ffmpeg cd /tmp/build_ffmpeg -curl -L https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.xz --output ffmpeg.tar.xz -tar -xJf ffmpeg.tar.xz -cd ./ffmpeg-$FFMPEG_VERSION -./configure --enable-shared --prefix=/usr +git clone https://git.ffmpeg.org/ffmpeg.git +cd ffmpeg +git checkout n$FFMPEG_VERSION +./configure --prefix=/opt/ffmpeg --disable-autodetect --enable-rpath --enable-shared --disable-swscale --disable-avfilter --disable-static --disable-doc --install-name-dir=@rpath make -j8 make install rm -rf /tmp/build_ffmpeg \ No newline at end of file diff --git a/openvino_bindings/src/BUILD b/openvino_bindings/src/BUILD index 756d22dc..de5eaddd 100644 --- a/openvino_bindings/src/BUILD +++ b/openvino_bindings/src/BUILD @@ -5,6 +5,7 @@ cc_library( deps = [ "@nlohmann_json//:json", "//third_party:opencv", + "//third_party:ffmpeg", "//src/utils:status", "//src/utils:utils", "//src/image:image_inference", From 7f3ed47813ffa69b9b71c0bdd50a0ee558c74cea Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Tue, 14 Jan 2025 21:29:26 +0100 Subject: [PATCH 23/68] Fixed build step --- .github/workflows/build-ui.yml | 1 + macos/Scripts/libraries_tools.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 8fa03303..28d5a01b 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -47,6 +47,7 @@ jobs: run: flutter build ${{env.OS_NAME}} --release env: FLUTTER_NOT_BUNDLE_LIBRARIES: true + FLUTTER_NOT_SIGN_LIBS: true - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/macos/Scripts/libraries_tools.sh b/macos/Scripts/libraries_tools.sh index aec884b3..d733789d 100755 --- a/macos/Scripts/libraries_tools.sh +++ b/macos/Scripts/libraries_tools.sh @@ -76,10 +76,12 @@ Bundle (){ Sign (){ # Sign the libraries - if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then - for lib in "${BUNDLE_FRAMEWORK_LIBS_TO_SIGN[@]}"; do - codesign --force --verbose --sign "${EXPANDED_CODE_SIGN_IDENTITY}" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/${lib}" - done + if [[ -z ${FLUTTER_NOT_SIGN_LIBS} ]]; then + if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]]; then + for lib in "${BUNDLE_FRAMEWORK_LIBS_TO_SIGN[@]}"; do + codesign --force --verbose --sign "${EXPANDED_CODE_SIGN_IDENTITY}" -- "${BUNDLE_FRAMEWORK_LIBS_TARGET_DIR}/${lib}" + done + fi fi } From 9d743d058fce11185204e924a64d514376ece13e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 15 Jan 2025 10:19:51 +0100 Subject: [PATCH 24/68] First attempt on macos bindings build --- .github/workflows/build-and-test.yml | 5 +++ .github/workflows/build-macos-bindings.yml | 37 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/build-macos-bindings.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bc8717b8..00d39342 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -47,3 +47,8 @@ jobs: permissions: contents: write uses: ./.github/workflows/build-windows-bindings.yml + + build-macos-bindings: + permissions: + contents: write + uses: ./.github/workflows/build-macos-bindings.yml diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml new file mode 100644 index 00000000..275fa73d --- /dev/null +++ b/.github/workflows/build-macos-bindings.yml @@ -0,0 +1,37 @@ +name: Build MacOS Bindings + +on: + workflow_call: + +jobs: + build-macos-bindings: + name: Build MacOS Bindings + runs-on: macos-latest + permissions: + contents: write + + steps: + # Step 1: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install bazelisk + run: | + brew install bazelisk + + - name: Install OpenVINO + run: | + curl -L https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/macos/openvino_genai_macos_12_6_2024.6.0.0_arm64.tar.gz \ + -o /tmp/openvino.tar.gz + tar -xvf /tmp/openvino.tar.gz -C /opt/intel + rm /tmp/openvino.tar.gz + ls /opt/intel/openvino + + - name: Install OpenCV + run: | + . openvino_bindings/scripts/install_opencv.sh + + - name: Install ffmpeg + run: | + . openvino_bindings/scripts/install_ffmpeg.sh + From 7f01770d6f8dbd2f498e3a1cfbb5b67ff844d45d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 15 Jan 2025 17:50:52 +0100 Subject: [PATCH 25/68] WIP macos build --- .github/workflows/build-and-test.yml | 1 + .github/workflows/build-macos-bindings.yml | 20 +++++++++++++------- openvino_bindings/scripts/setup_opencv.sh | 12 +++++++----- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 00d39342..47e4f724 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -7,6 +7,7 @@ on: jobs: build-ui: + if: false permissions: contents: write strategy: diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 275fa73d..11b46ac0 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -15,23 +15,29 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install bazelisk - run: | - brew install bazelisk - - name: Install OpenVINO run: | curl -L https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/macos/openvino_genai_macos_12_6_2024.6.0.0_arm64.tar.gz \ -o /tmp/openvino.tar.gz - tar -xvf /tmp/openvino.tar.gz -C /opt/intel + sudo mkdir /opt/intel + sudo tar -xvf /tmp/openvino.tar.gz -C /opt/intel + sudo mv /opt/intel/openvino_genai_macos_12_6_2024.6.0.0_arm64 /opt/intel/openvino rm /tmp/openvino.tar.gz ls /opt/intel/openvino - name: Install OpenCV run: | - . openvino_bindings/scripts/install_opencv.sh + sudo /bin/bash openvino_bindings/scripts/setup_opencv.sh - name: Install ffmpeg run: | - . openvino_bindings/scripts/install_ffmpeg.sh + sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh + - name: Install numpy + run: | + brew install numpy + + - name: Build bindings + run: | + bazelisk build :macos_bindings + working-directory: openvino_bindings diff --git a/openvino_bindings/scripts/setup_opencv.sh b/openvino_bindings/scripts/setup_opencv.sh index 363e807e..41a83626 100755 --- a/openvino_bindings/scripts/setup_opencv.sh +++ b/openvino_bindings/scripts/setup_opencv.sh @@ -13,12 +13,12 @@ mkdir opencv/release cd opencv git checkout tags/$OPENCV_VERSION cd release +# -DOPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib/modules \ cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local \ -DBUILD_LIST=core,improc,imgcodecs,calib3d,features2d,highgui,imgproc,video,videoio,optflow \ -DBUILD_TESTS=OFF \ -DBUILD_PERF_TESTS=OFF \ -DBUILD_opencv_ts=OFF \ -# -DOPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib/modules \ -DBUILD_opencv_aruco=OFF \ -DBUILD_opencv_bgsegm=OFF \ -DBUILD_opencv_bioinspired=OFF \ @@ -57,7 +57,9 @@ make install rm -rf /tmp/build_opencv echo "OpenCV has been built. You can find the header files and libraries in /usr/local/include/opencv2/ and /usr/local/lib" -# https://github.com/cggos/dip_cvqt/issues/1#issuecomment-284103343 -touch /etc/ld.so.conf.d/mp_opencv.conf -bash -c "echo /usr/local/lib >> /etc/ld.so.conf.d/mp_opencv.conf" -ldconfig -v +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + # https://github.com/cggos/dip_cvqt/issues/1#issuecomment-284103343 + touch /etc/ld.so.conf.d/mp_opencv.conf + bash -c "echo /usr/local/lib >> /etc/ld.so.conf.d/mp_opencv.conf" + ldconfig -v +fi From 378cc08a37c71038eee67c2c7782d0d4c7f4d139 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 08:59:29 +0100 Subject: [PATCH 26/68] Added package step --- .github/workflows/build-and-test.yml | 119 ++++++++++++++++++++- .github/workflows/build-macos-bindings.yml | 11 +- 2 files changed, 122 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 47e4f724..43cd4554 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -13,21 +13,19 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest] + os: [ubuntu-22.04, windows-latest, macos-latest] uses: ./.github/workflows/build-ui.yml with: os: ${{ matrix.os }} build-linux-bindings: - if: false name: Build Linux Bindings runs-on: ubuntu-22.04-16-cores permissions: contents: write steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build Docker image @@ -44,7 +42,6 @@ jobs: if-no-files-found: error build-windows-bindings: - if: false permissions: contents: write uses: ./.github/workflows/build-windows-bindings.yml @@ -53,3 +50,115 @@ jobs: permissions: contents: write uses: ./.github/workflows/build-macos-bindings.yml + + package-linux: + name: Package combined Linux release + runs-on: ubuntu-22.04 + needs: [ build-linux-bindings, build-ui ] + steps: + - uses: actions/checkout@v4 + + - name: Set safe filename + id: set_filename + run: | + SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} + echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-linux.zip" >> $GITHUB_ENV + + - name: Download bindings build artifact + uses: actions/download-artifact@v4 + with: + name: "linux_bindings.tgz" + + - name: Download flutter build artifact + uses: actions/download-artifact@v4 + with: + name: "OpenVINO-TestDrive-no-bindings-linux.zip" + path: flutter + + - name: Combine artifacts + run: | + tar -xvf linux_bindings.tgz -C ./bindings + rm linux_bindings.tgz + + mkdir -p flutter/data/flutter_assets/bindings + + mv bindings/* flutter/data/flutter_assets/bindings + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.SANITIZED_FILENAME }} + path: flutter + + package-windows: + name: Package combined Windows release + runs-on: ubuntu-22.04 + needs: [ build-windows-bindings, build-ui ] + steps: + - uses: actions/checkout@v4 + + - name: Set safe filename + id: set_filename + run: | + SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} + echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-windows.zip" >> $GITHUB_ENV + + - name: Download bindings build artifact + uses: actions/download-artifact@v4 + with: + name: "windows_bindings.tar" + + - name: Download flutter build artifact + uses: actions/download-artifact@v4 + with: + name: "OpenVINO-TestDrive-no-bindings-windows.zip" + path: flutter + + - name: Combine artifacts + run: | + tar -xvf windows_bindings.tar -C ./bindings + rm windows_bindings.tar + + mv bindings/* flutter + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.SANITIZED_FILENAME }} + path: flutter + + package-macos: + name: Package combined MacOS release + runs-on: ubuntu-22.04 + needs: [ build-macos-bindings, build-ui ] + steps: + - uses: actions/checkout@v4 + + - name: Set safe filename + id: set_filename + run: | + SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} + echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-macos.zip" >> $GITHUB_ENV + + - name: Download bindings build artifact + uses: actions/download-artifact@v4 + with: + name: "macos_bindings.tgz" + + - name: Download flutter build artifact + uses: actions/download-artifact@v4 + with: + name: "OpenVINO-TestDrive-no-bindings-macos.zip" + + - name: Combine artifacts + run: | + tar -xvf macos_bindings.tgz -C ./bindings + rm macos_bindings.tgz + + mv bindings/* flutter/OpenVINO\ Test\ Drive.app/Contents/Frameworks + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.SANITIZED_FILENAME }} + path: flutter diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 11b46ac0..8886ced7 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -11,9 +11,7 @@ jobs: contents: write steps: - # Step 1: Checkout the repository - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install OpenVINO run: | @@ -41,3 +39,10 @@ jobs: run: | bazelisk build :macos_bindings working-directory: openvino_bindings + + - name: Upload bindings to artifacts + uses: actions/upload-artifact@v4 + with: + name: "macos_bindings.tgz" + path: "openvino_bindings/bazel-bin/macos_bindings.tgz" + if-no-files-found: error From 3985cc0c0044ab51f161ec26d0832a83de083bda Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 09:04:31 +0100 Subject: [PATCH 27/68] Enabled workflow --- .github/workflows/build-and-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 43cd4554..921a2df3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -7,7 +7,6 @@ on: jobs: build-ui: - if: false permissions: contents: write strategy: From 93ae36bd14861c2c05a82030f6bfebdb2ce8d57f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 09:33:14 +0100 Subject: [PATCH 28/68] Fixed filename in package step --- .github/workflows/build-and-test.yml | 6 +++--- openvino_bindings/Dockerfile.ubuntu | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 921a2df3..76278f76 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -71,7 +71,7 @@ jobs: - name: Download flutter build artifact uses: actions/download-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-linux.zip" + name: "OpenVINO-TestDrive-no-bindings-Linux.zip" path: flutter - name: Combine artifacts @@ -110,7 +110,7 @@ jobs: - name: Download flutter build artifact uses: actions/download-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-windows.zip" + name: "OpenVINO-TestDrive-no-bindings-Windows.zip" path: flutter - name: Combine artifacts @@ -147,7 +147,7 @@ jobs: - name: Download flutter build artifact uses: actions/download-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-macos.zip" + name: "OpenVINO-TestDrive-no-bindings-macOS.zip" - name: Combine artifacts run: | diff --git a/openvino_bindings/Dockerfile.ubuntu b/openvino_bindings/Dockerfile.ubuntu index 7dd9696a..c186ffd4 100644 --- a/openvino_bindings/Dockerfile.ubuntu +++ b/openvino_bindings/Dockerfile.ubuntu @@ -30,6 +30,8 @@ RUN ./setup_opencv.sh COPY scripts/setup_ffmpeg.sh /scripts/setup_ffmpeg.sh RUN ./setup_ffmpeg.sh +RUN ls /opt/ffmpeg + RUN pip3 install numpy COPY bazel /build/bazel From 6d533e59a7af8aa01da4cf0f8fd75a676ef47f25 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 09:40:05 +0100 Subject: [PATCH 29/68] Fixed trigger --- .github/workflows/build-and-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 76278f76..96c20251 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,7 +3,10 @@ name: Build and test on: push: branches: - - dkalinin/integration-tests + - main + pull_request: + branches: + - main jobs: build-ui: From 34ff675fffe5ef50364a7cad4aaad131e42a72bd Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 18:33:10 +0100 Subject: [PATCH 30/68] Build fix --- .github/workflows/build-and-test.yml | 6 ++++++ openvino_bindings/scripts/setup_ffmpeg.sh | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 96c20251..be6dae5e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -152,6 +152,12 @@ jobs: with: name: "OpenVINO-TestDrive-no-bindings-macOS.zip" + - name: Debug + run: | + ls -la ./ + ls -la ./bindings + ls -la ./flutter + - name: Combine artifacts run: | tar -xvf macos_bindings.tgz -C ./bindings diff --git a/openvino_bindings/scripts/setup_ffmpeg.sh b/openvino_bindings/scripts/setup_ffmpeg.sh index 3371078b..073b4c2f 100755 --- a/openvino_bindings/scripts/setup_ffmpeg.sh +++ b/openvino_bindings/scripts/setup_ffmpeg.sh @@ -11,4 +11,10 @@ git checkout n$FFMPEG_VERSION ./configure --prefix=/opt/ffmpeg --disable-autodetect --enable-rpath --enable-shared --disable-swscale --disable-avfilter --disable-static --disable-doc --install-name-dir=@rpath make -j8 make install -rm -rf /tmp/build_ffmpeg \ No newline at end of file +rm -rf /tmp/build_ffmpeg + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + touch /etc/ld.so.conf.d/ffmpeg.conf + bash -c "echo /opt/ffmpeg/lib >> /etc/ld.so.conf.d/ffmpeg.conf" + ldconfig -v +fi \ No newline at end of file From b869a6a9f8ba9f4c4c1ed8e5d30893a3f2cd2c0d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 20:02:43 +0100 Subject: [PATCH 31/68] Fix build --- .github/workflows/build-and-test.yml | 3 +++ openvino_bindings/third_party/ffmpeg/linux.BUILD | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index be6dae5e..56e5b441 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -118,6 +118,7 @@ jobs: - name: Combine artifacts run: | + mkdir bindings tar -xvf windows_bindings.tar -C ./bindings rm windows_bindings.tar @@ -151,6 +152,7 @@ jobs: uses: actions/download-artifact@v4 with: name: "OpenVINO-TestDrive-no-bindings-macOS.zip" + path: flutter - name: Debug run: | @@ -160,6 +162,7 @@ jobs: - name: Combine artifacts run: | + mkdir bindings tar -xvf macos_bindings.tgz -C ./bindings rm macos_bindings.tgz diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index 3d8de2a8..8c787be2 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -10,5 +10,8 @@ cc_library( "-l:libavutil.so", "-l:libswresample.so", ], + includes = [ + "include", + ] visibility = ["//visibility:public"], ) From 5438ab547a8b6e6dcc630995aa2c4e78ac477ff5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 20:09:31 +0100 Subject: [PATCH 32/68] Fixed build --- openvino_bindings/third_party/ffmpeg/linux.BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index 8c787be2..2899d112 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -12,6 +12,6 @@ cc_library( ], includes = [ "include", - ] + ], visibility = ["//visibility:public"], ) From 6cd5759ee2f94aa4e87d973475ddb66cd1456462 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 16 Jan 2025 23:55:24 +0100 Subject: [PATCH 33/68] Fixed build --- openvino_bindings/third_party/ffmpeg/linux.BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index 2899d112..5bc5fca2 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -13,5 +13,6 @@ cc_library( includes = [ "include", ], + hdrs = glob([""include/**/*.h"]), visibility = ["//visibility:public"], ) From e111a4cb8e4a394d56881707011deaa5f6c13155 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 09:16:58 +0100 Subject: [PATCH 34/68] Fixed typo --- openvino_bindings/third_party/ffmpeg/linux.BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index 5bc5fca2..ae31a5cd 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -13,6 +13,6 @@ cc_library( includes = [ "include", ], - hdrs = glob([""include/**/*.h"]), + hdrs = glob(["include/**/*.h"]), visibility = ["//visibility:public"], ) From 52b29eb6fa2d716fd2cb47c70a28fc11ae34964c Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 09:17:54 +0100 Subject: [PATCH 35/68] Removed debug --- .github/workflows/build-and-test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 56e5b441..7e5149c3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -154,12 +154,6 @@ jobs: name: "OpenVINO-TestDrive-no-bindings-macOS.zip" path: flutter - - name: Debug - run: | - ls -la ./ - ls -la ./bindings - ls -la ./flutter - - name: Combine artifacts run: | mkdir bindings From eda28d5a643c205dbdae236012cf21b64dbb6ab2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 09:29:58 +0100 Subject: [PATCH 36/68] Fixed ffmpeg installation --- openvino_bindings/scripts/setup_ffmpeg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvino_bindings/scripts/setup_ffmpeg.sh b/openvino_bindings/scripts/setup_ffmpeg.sh index 073b4c2f..c736e4e0 100755 --- a/openvino_bindings/scripts/setup_ffmpeg.sh +++ b/openvino_bindings/scripts/setup_ffmpeg.sh @@ -8,7 +8,7 @@ cd /tmp/build_ffmpeg git clone https://git.ffmpeg.org/ffmpeg.git cd ffmpeg git checkout n$FFMPEG_VERSION -./configure --prefix=/opt/ffmpeg --disable-autodetect --enable-rpath --enable-shared --disable-swscale --disable-avfilter --disable-static --disable-doc --install-name-dir=@rpath +./configure --prefix=/opt/ffmpeg --disable-autodetect --enable-rpath --enable-shared --disable-swscale --disable-avfilter --disable-doc --install-name-dir=@rpath make -j8 make install rm -rf /tmp/build_ffmpeg From 3fa0710f90035a8b8e3b4656462e9127b4298f42 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 15:50:42 +0100 Subject: [PATCH 37/68] Trying to fix linux build --- openvino_bindings/Dockerfile.ubuntu | 5 +++-- openvino_bindings/scripts/setup_ffmpeg.sh | 2 +- openvino_bindings/third_party/ffmpeg/linux.BUILD | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openvino_bindings/Dockerfile.ubuntu b/openvino_bindings/Dockerfile.ubuntu index c186ffd4..6d36b75c 100644 --- a/openvino_bindings/Dockerfile.ubuntu +++ b/openvino_bindings/Dockerfile.ubuntu @@ -22,13 +22,14 @@ RUN cd /tmp && mkdir -p /opt/intel && \ RUN cd /opt/intel/openvino && ./install_dependencies/install_openvino_dependencies.sh -y +COPY scripts/setup_ffmpeg.sh /scripts/setup_ffmpeg.sh +RUN ./setup_ffmpeg.sh + RUN mkdir -p /scripts WORKDIR /scripts COPY scripts/setup_opencv.sh /scripts/setup_opencv.sh RUN ./setup_opencv.sh -COPY scripts/setup_ffmpeg.sh /scripts/setup_ffmpeg.sh -RUN ./setup_ffmpeg.sh RUN ls /opt/ffmpeg diff --git a/openvino_bindings/scripts/setup_ffmpeg.sh b/openvino_bindings/scripts/setup_ffmpeg.sh index c736e4e0..c3da6276 100755 --- a/openvino_bindings/scripts/setup_ffmpeg.sh +++ b/openvino_bindings/scripts/setup_ffmpeg.sh @@ -8,7 +8,7 @@ cd /tmp/build_ffmpeg git clone https://git.ffmpeg.org/ffmpeg.git cd ffmpeg git checkout n$FFMPEG_VERSION -./configure --prefix=/opt/ffmpeg --disable-autodetect --enable-rpath --enable-shared --disable-swscale --disable-avfilter --disable-doc --install-name-dir=@rpath +./configure --prefix=/opt/ffmpeg --disable-autodetect --enable-rpath --enable-shared --disable-swscale --disable-avfilter --disable-static --disable-doc --install-name-dir=@rpath make -j8 make install rm -rf /tmp/build_ffmpeg diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index ae31a5cd..a2b08a28 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -4,12 +4,12 @@ exports_files(["LICENSE"]) cc_library( name = "ffmpeg", - linkopts = [ - "-l:libavcodec.so", - "-l:libavformat.so", - "-l:libavutil.so", - "-l:libswresample.so", - ], + linkopts = glob([ + "-l:libavcodec.so.*", + "-l:libavformat.so.*", + "-l:libavutil.so.*", + "-l:libswresample.so.*", + ]), includes = [ "include", ], From 45a59a7a84bd77e8c419e60e46dd1fbd35b785ff Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 15:57:42 +0100 Subject: [PATCH 38/68] Fix build --- openvino_bindings/Dockerfile.ubuntu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvino_bindings/Dockerfile.ubuntu b/openvino_bindings/Dockerfile.ubuntu index 6d36b75c..3791cad7 100644 --- a/openvino_bindings/Dockerfile.ubuntu +++ b/openvino_bindings/Dockerfile.ubuntu @@ -22,11 +22,11 @@ RUN cd /tmp && mkdir -p /opt/intel && \ RUN cd /opt/intel/openvino && ./install_dependencies/install_openvino_dependencies.sh -y +RUN mkdir -p /scripts +WORKDIR /scripts COPY scripts/setup_ffmpeg.sh /scripts/setup_ffmpeg.sh RUN ./setup_ffmpeg.sh -RUN mkdir -p /scripts -WORKDIR /scripts COPY scripts/setup_opencv.sh /scripts/setup_opencv.sh RUN ./setup_opencv.sh From 168670c4dea0687d277d489fc3e0437a80aaacab Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 16:15:33 +0100 Subject: [PATCH 39/68] Fixed build --- .github/workflows/build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7e5149c3..e23f0769 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -79,6 +79,7 @@ jobs: - name: Combine artifacts run: | + mkdir bindings tar -xvf linux_bindings.tgz -C ./bindings rm linux_bindings.tgz From c2f1e6505b18c5d3fcac7ced303821d67b10bfa8 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 23:30:53 +0100 Subject: [PATCH 40/68] Combined package jobs --- .github/workflows/build-and-test.yml | 108 +++++---------------------- 1 file changed, 20 insertions(+), 88 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e23f0769..e042052c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -53,88 +53,13 @@ jobs: contents: write uses: ./.github/workflows/build-macos-bindings.yml - package-linux: - name: Package combined Linux release + package: + name: Package combined release runs-on: ubuntu-22.04 - needs: [ build-linux-bindings, build-ui ] - steps: - - uses: actions/checkout@v4 - - - name: Set safe filename - id: set_filename - run: | - SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} - echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-linux.zip" >> $GITHUB_ENV - - - name: Download bindings build artifact - uses: actions/download-artifact@v4 - with: - name: "linux_bindings.tgz" - - - name: Download flutter build artifact - uses: actions/download-artifact@v4 - with: - name: "OpenVINO-TestDrive-no-bindings-Linux.zip" - path: flutter - - - name: Combine artifacts - run: | - mkdir bindings - tar -xvf linux_bindings.tgz -C ./bindings - rm linux_bindings.tgz - - mkdir -p flutter/data/flutter_assets/bindings - - mv bindings/* flutter/data/flutter_assets/bindings - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.SANITIZED_FILENAME }} - path: flutter - - package-windows: - name: Package combined Windows release - runs-on: ubuntu-22.04 - needs: [ build-windows-bindings, build-ui ] - steps: - - uses: actions/checkout@v4 - - - name: Set safe filename - id: set_filename - run: | - SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} - echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-windows.zip" >> $GITHUB_ENV - - - name: Download bindings build artifact - uses: actions/download-artifact@v4 - with: - name: "windows_bindings.tar" - - - name: Download flutter build artifact - uses: actions/download-artifact@v4 - with: - name: "OpenVINO-TestDrive-no-bindings-Windows.zip" - path: flutter - - - name: Combine artifacts - run: | - mkdir bindings - tar -xvf windows_bindings.tar -C ./bindings - rm windows_bindings.tar - - mv bindings/* flutter - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.SANITIZED_FILENAME }} - path: flutter - - package-macos: - name: Package combined MacOS release - runs-on: ubuntu-22.04 - needs: [ build-macos-bindings, build-ui ] + needs: [ build-linux-bindings, build-windows-bindings, build-macos-bindings, build-ui ] + strategy: + matrix: + os: [linux, windows, macos] steps: - uses: actions/checkout@v4 @@ -142,26 +67,33 @@ jobs: id: set_filename run: | SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} - echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-macos.zip" >> $GITHUB_ENV + echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-${{ matrix.os }}.zip" >> $GITHUB_ENV - name: Download bindings build artifact uses: actions/download-artifact@v4 with: - name: "macos_bindings.tgz" + name: "${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }}" - name: Download flutter build artifact uses: actions/download-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-macOS.zip" + name: "OpenVINO-TestDrive-no-bindings-${{ matrix.os | title }}.zip" path: flutter - name: Combine artifacts run: | mkdir bindings - tar -xvf macos_bindings.tgz -C ./bindings - rm macos_bindings.tgz - - mv bindings/* flutter/OpenVINO\ Test\ Drive.app/Contents/Frameworks + tar -xvf ${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }} -C ./bindings + rm ${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }} + + if [ "${{ matrix.os }}" == "macos" ]; then + mv bindings/* flutter/OpenVINO\ Test\ Drive.app/Contents/Frameworks + elif [ "${{ matrix.os }}" == "windows" ]; then + mv bindings/* flutter + else + mkdir -p flutter/data/flutter_assets/bindings + mv bindings/* flutter/data/flutter_assets/bindings + fi - name: Upload Artifact uses: actions/upload-artifact@v4 From f2f31ca2c1f9193538421a97e4e33e5861d11487 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 23:37:25 +0100 Subject: [PATCH 41/68] Included test jobs into main workflow --- .github/workflows/build-and-test.yml | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e042052c..a464cc77 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -100,3 +100,88 @@ jobs: with: name: ${{ env.SANITIZED_FILENAME }} path: flutter + + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download OpenVINO bindings + env: + GH_TOKEN: ${{ github.token }} + run: | + mkdir -p bindings + gh release download ${{ env.BINDINGS_RELEASE }} -p linux_bindings.tgz + tar -xzf linux_bindings.tgz -C bindings + rm linux_bindings.tgz + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version-file: pubspec.yaml + + - name: Install dependencies + run: flutter pub get + + - name: Run tests + run: flutter test --coverage --no-pub + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: coverage/lcov.info + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + + integration_tests: + runs-on: ubuntu-latest + + env: + DISPLAY: ":99" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb + + - name: Download OpenVINO bindings + uses: actions/download-artifact@v4 + with: + name: "linux_bindings.tgz" + + - name: Unpack OpenVINO bindings + run: | + mkdir -p bindings + tar -xzf linux_bindings.tgz -C bindings + rm linux_bindings.tgz + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version-file: pubspec.yaml + + - name: Install dependencies + run: flutter pub get + + - name: Start Xvfb + run: | + sudo Xvfb $DISPLAY -screen 0 1280x1024x24 > /dev/null 2>&1 & + echo "Xvfb started" + + - name: Run integration tests + run: flutter drive --target=test_driver/app.dart --no-pub + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: coverage/lcov.info + flags: integrationtests + name: codecov-umbrella + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} From 03893bb35f2e149d5833adfcf8e23b4f436d68d2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 23:57:17 +0100 Subject: [PATCH 42/68] Fixed build --- .github/workflows/build-and-test.yml | 4 ++-- .github/workflows/build-ui.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a464cc77..cd37aa80 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -77,7 +77,7 @@ jobs: - name: Download flutter build artifact uses: actions/download-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-${{ matrix.os | title }}.zip" + name: "OpenVINO-TestDrive-no-bindings-${{ matrix.os }}" path: flutter - name: Combine artifacts @@ -87,7 +87,7 @@ jobs: rm ${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }} if [ "${{ matrix.os }}" == "macos" ]; then - mv bindings/* flutter/OpenVINO\ Test\ Drive.app/Contents/Frameworks + mv bindings/* flutter/Contents/Frameworks elif [ "${{ matrix.os }}" == "windows" ]; then mv bindings/* flutter else diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index 28d5a01b..f776d5d0 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -26,7 +26,7 @@ jobs: echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV elif [[ "${{ runner.os }}" == "macOS" ]]; then mkdir bindings - echo "RELEASE_PATH=build/macos/Build/Products/Release" >> $GITHUB_ENV + echo "RELEASE_PATH=build/macos/Build/Products/Release/OpenVINO Test Drive.app" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV - uses: subosito/flutter-action@v2.18.0 @@ -51,5 +51,5 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: "OpenVINO-TestDrive-no-bindings-${{runner.os}}.zip" + name: "OpenVINO-TestDrive-no-bindings-${{env.OS_NAME}}" path: ${{ env.RELEASE_PATH }} From dcbcd21fa102bb22ac7e77edca58f0b53fd1b364 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 17 Jan 2025 23:58:21 +0100 Subject: [PATCH 43/68] Fixed workflow --- .github/workflows/build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index cd37aa80..c4a66f03 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -139,6 +139,7 @@ jobs: integration_tests: runs-on: ubuntu-latest + needs: [ build-linux-bindings ] env: DISPLAY: ":99" From 22620b79c4219cdb8dcc43027898c89362aea81f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Sat, 18 Jan 2025 00:02:25 +0100 Subject: [PATCH 44/68] Fixed workflow --- .github/workflows/build-and-test.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c4a66f03..436bd814 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -108,15 +108,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download OpenVINO bindings - env: - GH_TOKEN: ${{ github.token }} - run: | - mkdir -p bindings - gh release download ${{ env.BINDINGS_RELEASE }} -p linux_bindings.tgz - tar -xzf linux_bindings.tgz -C bindings - rm linux_bindings.tgz - - name: Set up Flutter uses: subosito/flutter-action@v2 with: From 5865baaf30b87a77a9fb5c3827de73bf2e391630 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 20 Jan 2025 08:38:57 +0100 Subject: [PATCH 45/68] Fixed test workflow --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 436bd814..52b70900 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -167,7 +167,7 @@ jobs: echo "Xvfb started" - name: Run integration tests - run: flutter drive --target=test_driver/app.dart --no-pub + run: flutter test --coverage --no-pub integration_test -d linux - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 From d042fcb7a1da518086404c6a73b970d54bbe825b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 20 Jan 2025 10:54:35 +0100 Subject: [PATCH 46/68] Fixed imports --- integration_test/app_test.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index dc150c92..2c2bc706 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: Apache-2.0 +import 'package:flutter_test/flutter_test.dart'; +import 'package:inference/main.dart'; import 'package:integration_test/integration_test.dart'; void main() { From 19aec5f28f114a0b11f4685fd0bf80c92bfbf891 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 09:47:08 +0100 Subject: [PATCH 47/68] WIP on build --- .github/workflows/build-and-test.yml | 5 +++-- openvino_bindings/third_party/ffmpeg/linux.BUILD | 16 +++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 52b70900..80c8b34a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-latest, macos-latest] + os: [ubuntu-22.04, macos-latest] uses: ./.github/workflows/build-ui.yml with: os: ${{ matrix.os }} @@ -44,6 +44,7 @@ jobs: if-no-files-found: error build-windows-bindings: + if: false permissions: contents: write uses: ./.github/workflows/build-windows-bindings.yml @@ -59,7 +60,7 @@ jobs: needs: [ build-linux-bindings, build-windows-bindings, build-macos-bindings, build-ui ] strategy: matrix: - os: [linux, windows, macos] + os: [linux, macos] steps: - uses: actions/checkout@v4 diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index a2b08a28..2be378b7 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -4,12 +4,18 @@ exports_files(["LICENSE"]) cc_library( name = "ffmpeg", - linkopts = glob([ - "-l:libavcodec.so.*", - "-l:libavformat.so.*", - "-l:libavutil.so.*", - "-l:libswresample.so.*", + srcs = glob([ + "lib/libavcodec.so.*", + "lib/libavformat.so.*", + "lib/libavutil.so.*", + "lib/libswresample.so.*", ]), + linkopts = [ + "-lavcodec", + "-lavformat", + "-lavutil", + "-lswresample", + ], includes = [ "include", ], From fad412992b4ca2f89d12225300429b835c86ef0e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 18:34:12 +0100 Subject: [PATCH 48/68] Fix linux build --- openvino_bindings/third_party/ffmpeg/linux.BUILD | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openvino_bindings/third_party/ffmpeg/linux.BUILD b/openvino_bindings/third_party/ffmpeg/linux.BUILD index 2be378b7..d651e243 100644 --- a/openvino_bindings/third_party/ffmpeg/linux.BUILD +++ b/openvino_bindings/third_party/ffmpeg/linux.BUILD @@ -10,12 +10,12 @@ cc_library( "lib/libavutil.so.*", "lib/libswresample.so.*", ]), - linkopts = [ - "-lavcodec", - "-lavformat", - "-lavutil", - "-lswresample", - ], + linkopts = glob([ + "-l:libavcodec.so.*", + "-l:libavformat.so.*", + "-l:libavutil.so.*", + "-l:libswresample.so.*", + ]), includes = [ "include", ], From b01c3c81763449b3881b4fdcba642d56ab387199 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 19:48:52 +0100 Subject: [PATCH 49/68] Added cache, removed old CI --- .github/workflows/build-and-test.yml | 5 + .github/workflows/build-macos-bindings.yml | 40 +++- .github/workflows/build-ui.yml | 6 + .github/workflows/linux-build.yaml | 145 ------------- .github/workflows/macos-build.yaml | 50 ----- .github/workflows/test-coverage.yaml | 102 --------- .github/workflows/windows-build.yaml | 228 --------------------- 7 files changed, 50 insertions(+), 526 deletions(-) delete mode 100644 .github/workflows/linux-build.yaml delete mode 100644 .github/workflows/macos-build.yaml delete mode 100644 .github/workflows/test-coverage.yaml delete mode 100644 .github/workflows/windows-build.yaml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 80c8b34a..5d0989ca 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,6 +8,9 @@ on: branches: - main +env: + OPENVINO_VERSION: '2024.6' + jobs: build-ui: permissions: @@ -53,6 +56,8 @@ jobs: permissions: contents: write uses: ./.github/workflows/build-macos-bindings.yml + with: + OPENVINO_VERSION: ${{ env.OPENVINO_VERSION }} package: name: Package combined release diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 8886ced7..a7691c7d 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -2,6 +2,11 @@ name: Build MacOS Bindings on: workflow_call: + inputs: + OPENVINO_VERSION: + required: true + description: 'The version of OpenVINO to use' + type: string jobs: build-macos-bindings: @@ -19,15 +24,38 @@ jobs: -o /tmp/openvino.tar.gz sudo mkdir /opt/intel sudo tar -xvf /tmp/openvino.tar.gz -C /opt/intel - sudo mv /opt/intel/openvino_genai_macos_12_6_2024.6.0.0_arm64 /opt/intel/openvino + sudo mv /opt/intel/openvino_genai_macos_12_6_${{ inputs.OPENVINO_VERSION }}.0.0_arm64 /opt/intel/openvino rm /tmp/openvino.tar.gz ls /opt/intel/openvino + - name: Install OpenVINO dependencies + run: | + sudo /bin/bash /opt/intel/openvino/install_dependencies/install_openvino_dependencies.sh -y + + - name: Cache OpenCV build + id: cache-opencv + uses: actions/cache@v4 + with: + path: | + /usr/local/include/opencv4 + /usr/local/lib/libopencv_* + key: ${{ runner.os }}-opencv-${{ hashFiles('openvino_bindings/scripts/setup_opencv.sh') }} + - name: Install OpenCV + if: steps.cache-opencv.outputs.cache-hit != 'true' run: | sudo /bin/bash openvino_bindings/scripts/setup_opencv.sh + - name: Cache ffmpeg + id: cache-ffmpeg + uses: actions/cache@v4 + with: + path: | + /opt/ffmpeg + key: ${{ runner.os }}-ffmpeg + - name: Install ffmpeg + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' run: | sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh @@ -35,6 +63,16 @@ jobs: run: | brew install numpy + - name: Cache Bazel build outputs + uses: actions/cache@v3 + with: + path: | + ~/.cache/bazel + openvino_bindings/bazel-out + key: ${{ runner.os }}-bazel-${{ hashFiles('**/*BUILD', '**/*WORKSPACE') }} + restore-keys: | + ${{ runner.os }}-bazel- + - name: Build bindings run: | bazelisk build :macos_bindings diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index f776d5d0..f15402ed 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -43,6 +43,12 @@ jobs: run: flutter pub run build_runner build --delete-conflicting-outputs - name: Enable build run: flutter config --enable-${{env.OS_NAME}}-desktop + - name: Cache build + uses: actions/cache@v4 + with: + path: | + build + key: ${{ runner.os }}-flutter - name: Build artifacts run: flutter build ${{env.OS_NAME}} --release env: diff --git a/.github/workflows/linux-build.yaml b/.github/workflows/linux-build.yaml deleted file mode 100644 index f0fda8c8..00000000 --- a/.github/workflows/linux-build.yaml +++ /dev/null @@ -1,145 +0,0 @@ -name: Linux build - -on: push - -jobs: - build-linux-bindings: - name: Build Linux bindings - runs-on: ubuntu-22.04-16-cores - permissions: - contents: write - - if: false - steps: - # Step 1: Checkout the repository - - name: Checkout repository - uses: actions/checkout@v4 - - # Step 2: Set up Docker Buildx (if you want cross-platform support, otherwise you can skip this) - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - # Step 3: Navigate to the src directory and build the Docker image - - name: Build Docker image - run: | - cd openvino_bindings - docker build -f Dockerfile.ubuntu -t linux-bindings-ubuntu . - docker create --name bindings_container linux-bindings-ubuntu - docker cp bindings_container:/bindings-out/linux_bindings.tgz ./linux_bindings.tgz - docker rm bindings_container - pwd - ls -lh - - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: "linux_bindings.tgz" - path: openvino_bindings/linux_bindings.tgz - if-no-files-found: error - - - build-linux-ui: - name: Build Linux UI - - runs-on: ubuntu-22.04 - permissions: - contents: write - - if: false - - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - flutter-version: '3.24.5' - - name: Install dependencies - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev - - name: Install project dependencies - run: flutter pub get - - name: Generate intermediates - run: flutter pub run build_runner build --delete-conflicting-outputs - - name: Enable linux build - run: flutter config --enable-linux-desktop - - name: Build artifacts - run: flutter build linux --release - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - type: 'zip' - filename: "OpenVINO-TestDrive-no-bindings-linux.zip" - path: build/linux/x64/release/bundle - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: "OpenVINO-TestDrive-no-bindings-linux.zip" - path: build/linux/x64/release/bundle - - package: - name: Package combined Linux release - runs-on: ubuntu-22.04 - needs: [ build-linux-bindings, build-linux-ui ] # Waits for both jobs to succeed - if: false - steps: - # Step 1: Check out the repository - - name: Checkout repository - uses: actions/checkout@v4 - - # Step 2: Set filename for release - - name: Set safe filename - id: set_filename - run: | - SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} - echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-linux.zip" >> $GITHUB_ENV - - # Step 3: Download artifact from build-linux-ui - - name: Download bindings build artifact - uses: actions/download-artifact@v4 - with: - name: "linux_bindings.tgz" # Matches the artifact name from build-linux-ui - path: ./bindings # Directory to store the downloaded artifact - - # Step 4: Download artifact from build-linux-ui - - name: Download flutter build artifact - uses: actions/download-artifact@v4 - with: - name: "OpenVINO-TestDrive-no-bindings-linux.zip" # Matches the artifact name from build-linux-ui - path: ./flutter # Directory to store the downloaded artifact - - # Step 5: Combine artifacts - - name: Combine artifacts - run: | - ls -la ./ - ls -la ./bindings - ls -la ./flutter - - tar -xvf ./bindings/linux_bindings.tgz -C ./bindings - rm ./bindings/linux_bindings.tgz - - ls -la ./bindings - mkdir -p ./flutter/data/flutter_assets/bindings - mv ./bindings/* ./flutter/data/flutter_assets/bindings - - # Step 5: Archive combined folder - - name: Archive Release artifact - uses: thedoctor0/zip-release@master - with: - type: 'zip' - filename: ${{ env.SANITIZED_FILENAME }} - path: ./flutter/ - - # Step 5: Upload new artifact - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.SANITIZED_FILENAME }} - path: ./flutter/ - - # Step 6: Update release - # - name: Linux Release - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # files: ${{ env.SANITIZED_FILENAME }} diff --git a/.github/workflows/macos-build.yaml b/.github/workflows/macos-build.yaml deleted file mode 100644 index a2e966bd..00000000 --- a/.github/workflows/macos-build.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: macOS build - -on: push - -jobs: - build-macos-ui: - name: Build macOS ui - runs-on: macos-latest - permissions: - contents: write - - if: false - - steps: - - uses: actions/checkout@v4 - - name: Set safe filename - id: set_filename - run: | - SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} - echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-macos.zip" >> $GITHUB_ENV - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - flutter-version: '3.24.5' - - name: Install project dependencies - run: flutter pub get - - name: Generate intermediates - run: flutter pub run build_runner build --delete-conflicting-outputs - - name: Enable macOS build - run: flutter config --enable-macos-desktop - - name: Build artifacts - run: flutter build macos --release - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - type: 'zip' - filename: ${{ env.SANITIZED_FILENAME }} - path: build/macos/Build/Products/Release - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.SANITIZED_FILENAME }} - path: build/macos/Build/Products/Release - - name: macOS Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: ${{ env.SANITIZED_FILENAME }} \ No newline at end of file diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index 8e34cf73..00000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,102 +0,0 @@ -name: Test Coverage - -on: - push: - branches: - - main - pull_request: - branches: - - main - -# This workaround will be fixed after integration with the building workflow for OpenVINO bindings -env: - BINDINGS_RELEASE: untagged-31bc62defa3b34302d79 - -permissions: - contents: write - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Download OpenVINO bindings - env: - GH_TOKEN: ${{ github.token }} - run: | - mkdir -p bindings - gh release download ${{ env.BINDINGS_RELEASE }} -p linux_bindings.tgz - tar -xzf linux_bindings.tgz -C bindings - rm linux_bindings.tgz - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version-file: pubspec.yaml - - - name: Install dependencies - run: flutter pub get - - - name: Run tests - run: flutter test --coverage --no-pub - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - files: coverage/lcov.info - flags: unittests - name: codecov-umbrella - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - - integration_tests: - runs-on: ubuntu-latest - # NOTE: Temporary disabled due to the issue with integration tests on CI - if: false - - env: - DISPLAY: ":99" - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install dependencies - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb - - - name: Download OpenVINO bindings - env: - GH_TOKEN: ${{ github.token }} - run: | - mkdir -p bindings - gh release download ${{ env.BINDINGS_RELEASE }} -p linux_bindings.tgz - tar -xzf linux_bindings.tgz -C bindings - rm linux_bindings.tgz - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version-file: pubspec.yaml - - - name: Install dependencies - run: flutter pub get - - - name: Start Xvfb - run: | - sudo Xvfb $DISPLAY -screen 0 1280x1024x24 > /dev/null 2>&1 & - echo "Xvfb started" - - - name: Run integration tests - run: flutter test --coverage --no-pub integration_test -d linux - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - files: coverage/lcov.info - flags: integrationtests - name: codecov-umbrella - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/windows-build.yaml b/.github/workflows/windows-build.yaml deleted file mode 100644 index 3866b6e3..00000000 --- a/.github/workflows/windows-build.yaml +++ /dev/null @@ -1,228 +0,0 @@ -name: Windows build - -on: push - -jobs: - build-windows-bindings: - name: Build Windows bindings - runs-on: windows-2019-16-core - - if: false - - steps: - # Step 1: Checkout the repository - - name: Checkout repository - uses: actions/checkout@v4 - -# Step 2: Install Visual Studio Build Tools (only needed on windows-latest or runners without VS2019) -# - name: Install Visual Studio Build Tools -# run: | -# choco install visualstudio2019buildtools -y -# choco install visualstudio2019-workload-vctools -y -# shell: cmd - - # Step 3: Install Python 3.13 - - name: Install Python 3.13 - uses: actions/setup-python@v5 - with: - python-version: '3.13.0' - - - name: Add Python to PATH - run: | - setx PATH "%PATH%;C:\hostedtoolcache\windows\Python\3.13.0\x64" - shell: cmd - - # Step 4: Add Python to PATH - - name: Install numpy - run: | - C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe -m pip install numpy - shell: cmd - - # Step 5: Install MSYS2 - - name: Install MSYS2 - run: | - choco install msys2 -y - setx PATH "%PATH%;C:\tools\msys64\usr\bin" - shell: cmd - - - name: Initialize MSYS2 - run: | - C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Syuu --noconfirm" - C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm" - shell: cmd - - # Step 6: Install Bazelisk - - name: Install Bazelisk - run: | - choco install bazelisk -y - shell: cmd - - # Step 7: Set up Bazel environment variables - - name: Set up Bazel environment variables - env: - BAZEL_VC: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC - BAZEL_VS: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools - BAZEL_VC_FULL_VERSION: 14.29.30133 - BAZEL_SH: C:\msys64\usr\bin\bash.exe - run: echo "Bazel environment variables set." - - # Step 8: Download and Install OpenCV - - name: Download OpenCV - run: | - curl -L -o opencv.exe https://github.com/opencv/opencv/releases/download/4.9.0/opencv-4.9.0-windows.exe - start /wait opencv.exe -suppresslaunch -y -gm2 -o"C:\" - shell: cmd - - # Step 9: Install vcpkg and ffmpeg - - name: Install vcpkg and ffmpeg - shell: powershell - run: | - if (!(Test-Path "C:\vcpkg")) { git clone https://github.com/microsoft/vcpkg.git C:\vcpkg } - C:\vcpkg\bootstrap-vcpkg.bat - cd openvino_bindings/third_party - C:\vcpkg\vcpkg install - - # Step 10: Download and Install OpenVINO Runtime - - name: Download and Install OpenVINO Runtime 24.6.0 - shell: powershell - run: | - Invoke-WebRequest -Uri https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/windows/openvino_genai_windows_2024.6.0.0_x86_64.zip -OutFile openvino_runtime.zip - Expand-Archive -Path openvino_runtime.zip -DestinationPath C:/Intel/ - Rename-Item -Path "C:/Intel/openvino_genai_windows_2024.6.0.0_x86_64" -NewName "openvino_2024.6.0" - dir C:/Intel/openvino_2024.6.0/ - - # Step 11: Install Mediapipe Requirements - - name: Install Mediapipe Requirements - run: | - C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm git patch unzip" - shell: bash - - # Step 12: Build with Bazel - - name: Build Windows Bindings with Bazel - env: - PYTHON_BIN_PATH: "C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe" - run: | - cd openvino_bindings - bazel build -c opt :windows_bindings --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe" - shell: bash - - # Step 13: Verify the DLLs - - name: Verify DLLs in Bazel Output - run: | - dir openvino_bindings/bazel-out/x64_windows-opt/bin/windows_bindings.tar - - # Step 14: Upload release artifact - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: windows_bindings.tar - path: openvino_bindings/bazel-out/x64_windows-opt/bin/windows_bindings.tar - - build-windows-ui: - name: Build Windows UI - runs-on: windows-latest - permissions: - contents: write - - if: false - - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - flutter-version: '3.24.5' - - name: check flutter - run: flutter doctor -v - - name: Install project dependencies - run: flutter pub get - - name: Generate intermediates - run: flutter pub run build_runner build --delete-conflicting-outputs - - name: Enable windows build - run: flutter config --enable-windows-desktop - - name: Copy bindings # Todo - run: | - mkdir bindings - New-Item -ItemType File -Path "bindings\\fake.dll" -Force - - name: Build artifacts - run: flutter build windows --release - - name: Archive Release artifact - uses: thedoctor0/zip-release@master - with: - type: 'zip' - filename: "OpenVINO-TestDrive-no-bindings-windows.zip" - path: build/windows/x64/runner/Release - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: "OpenVINO-TestDrive-no-bindings-windows.zip" - path: build\\windows\\x64\\runner\\Release - - package: - name: Package combined Windows release - runs-on: ubuntu-22.04 - needs: [ build-windows-bindings, build-windows-ui ] # Waits for both jobs to succeed - steps: - # Step 1: Check out the repository - - name: Checkout repository - uses: actions/checkout@v4 - - # Step 2: Set filename for release - - name: Set safe filename - id: set_filename - run: | - SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} - echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-windows.zip" >> $GITHUB_ENV - - # Step 3: Download artifact from build-windows-ui - - name: Download bindings build artifact - uses: actions/download-artifact@v4 - with: - name: "windows_bindings.tar" # Matches the artifact name from build-windows-ui - path: ./bindings # Directory to store the downloaded artifact - - # Step 4: Download artifact from build-windows-ui - - name: Download flutter build artifact - uses: actions/download-artifact@v4 - with: - name: "OpenVINO-TestDrive-no-bindings-windows.zip" # Matches the artifact name from build-windows-ui - path: ./flutter # Directory to store the downloaded artifact - - # Step 5: Combine artifacts - - name: Combine artifacts - run: | - ls -la ./ - ls -la ./bindings - ls -la ./flutter - rm -rf ./flutter/fake.dll - - tar -xvf ./bindings/windows_bindings.tar -C ./bindings - rm ./bindings/windows_bindings.tar - - ls -la ./bindings - - mv ./bindings/* ./flutter/ - - # Step 5: Archive combined folder - - name: Archive Release artifact - uses: thedoctor0/zip-release@master - with: - type: 'zip' - filename: ${{ env.SANITIZED_FILENAME }} - path: ./flutter/ - - # Step 5: Upload new artifact - - name: Upload Release Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.SANITIZED_FILENAME }} - path: ./flutter/ - - # Step 6: Update release - - name: Windows Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: ${{ env.SANITIZED_FILENAME }} From 85d8c35a576111697fe7cdf9e67633532fa3f65b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 20:05:38 +0100 Subject: [PATCH 50/68] Fixed workflow --- .github/workflows/build-and-test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5d0989ca..b5e87719 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,9 +8,6 @@ on: branches: - main -env: - OPENVINO_VERSION: '2024.6' - jobs: build-ui: permissions: @@ -57,7 +54,7 @@ jobs: contents: write uses: ./.github/workflows/build-macos-bindings.yml with: - OPENVINO_VERSION: ${{ env.OPENVINO_VERSION }} + OPENVINO_VERSION: '2024.6' package: name: Package combined release From b88fde89b8d237e0ec7826e76069d48d75e47f4d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 20:09:30 +0100 Subject: [PATCH 51/68] Fixed workflow --- .github/workflows/build-macos-bindings.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index a7691c7d..276ddcbf 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -28,10 +28,6 @@ jobs: rm /tmp/openvino.tar.gz ls /opt/intel/openvino - - name: Install OpenVINO dependencies - run: | - sudo /bin/bash /opt/intel/openvino/install_dependencies/install_openvino_dependencies.sh -y - - name: Cache OpenCV build id: cache-opencv uses: actions/cache@v4 From bd5e54fde20fd33c4cba8994615e78c3936edf46 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 21:00:00 +0100 Subject: [PATCH 52/68] fixed cache --- .github/workflows/build-ui.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index f15402ed..211a7203 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -17,6 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Determine comon OS vars shell: bash run: | @@ -29,31 +30,39 @@ jobs: echo "RELEASE_PATH=build/macos/Build/Products/Release/OpenVINO Test Drive.app" >> $GITHUB_ENV fi echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV + - uses: subosito/flutter-action@v2.18.0 with: channel: 'stable' flutter-version-file: pubspec.yaml cache: true + - name: Install linux dependencies if: ${{ runner.os == 'Linux' }} run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev + - name: Install project dependencies run: flutter pub get - - name: Generate intermediates - run: flutter pub run build_runner build --delete-conflicting-outputs - - name: Enable build - run: flutter config --enable-${{env.OS_NAME}}-desktop + - name: Cache build uses: actions/cache@v4 with: path: | build key: ${{ runner.os }}-flutter + + - name: Generate intermediates + run: flutter pub run build_runner build --delete-conflicting-outputs + + - name: Enable build + run: flutter config --enable-${{env.OS_NAME}}-desktop + - name: Build artifacts run: flutter build ${{env.OS_NAME}} --release env: FLUTTER_NOT_BUNDLE_LIBRARIES: true FLUTTER_NOT_SIGN_LIBS: true + - name: Upload artifacts uses: actions/upload-artifact@v4 with: From 6905a690f66f4caf1103972c2a5516cb0c7ead9c Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 21:16:55 +0100 Subject: [PATCH 53/68] Fixed workflow --- .github/workflows/build-macos-bindings.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 276ddcbf..d229dab3 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -30,7 +30,7 @@ jobs: - name: Cache OpenCV build id: cache-opencv - uses: actions/cache@v4 + uses: actions/cache@v3 with: path: | /usr/local/include/opencv4 @@ -44,7 +44,7 @@ jobs: - name: Cache ffmpeg id: cache-ffmpeg - uses: actions/cache@v4 + uses: actions/cache@v3 with: path: | /opt/ffmpeg @@ -59,13 +59,12 @@ jobs: run: | brew install numpy - - name: Cache Bazel build outputs + - name: Cache Bazel uses: actions/cache@v3 with: path: | - ~/.cache/bazel - openvino_bindings/bazel-out - key: ${{ runner.os }}-bazel-${{ hashFiles('**/*BUILD', '**/*WORKSPACE') }} + /private/var/tmp/_bazel_runner/ + key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel', '**/*BUILD') }} restore-keys: | ${{ runner.os }}-bazel- From 7d2f5e6308dbfd299714c9ad34f93a628f9c3ad2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 21:59:09 +0100 Subject: [PATCH 54/68] Fixed cache --- .github/workflows/build-macos-bindings.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index d229dab3..c286b698 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -18,6 +18,13 @@ jobs: steps: - uses: actions/checkout@v4 + # Need to wrap the tar command to fix permission denied error (https://github.com/actions/cache/issues/629#issuecomment-1189184648) + - name: "Install gtar wrapper" + run: | + sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig + sudo cp macosx/gtar /usr/local/bin/gtar + sudo chmod +x /usr/local/bin/gtar + - name: Install OpenVINO run: | curl -L https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/macos/openvino_genai_macos_12_6_2024.6.0.0_arm64.tar.gz \ @@ -30,7 +37,7 @@ jobs: - name: Cache OpenCV build id: cache-opencv - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | /usr/local/include/opencv4 @@ -44,7 +51,7 @@ jobs: - name: Cache ffmpeg id: cache-ffmpeg - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | /opt/ffmpeg @@ -60,7 +67,7 @@ jobs: brew install numpy - name: Cache Bazel - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | /private/var/tmp/_bazel_runner/ From 6078806add992bb7cea124237a976bef0991700c Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 22:06:11 +0100 Subject: [PATCH 55/68] Fixed workflow --- .github/workflows/build-macos-bindings.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index c286b698..42c49ea5 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -18,12 +18,12 @@ jobs: steps: - uses: actions/checkout@v4 - # Need to wrap the tar command to fix permission denied error (https://github.com/actions/cache/issues/629#issuecomment-1189184648) + # Need to wrap the tar command to fix permission denied error in cache action (https://github.com/actions/cache/issues/629#issuecomment-1189184648) - name: "Install gtar wrapper" run: | - sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig - sudo cp macosx/gtar /usr/local/bin/gtar - sudo chmod +x /usr/local/bin/gtar + sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig + sudo echo '#!/bin/bash sudo /opt/homebrew/bin/gtar.orig "$@"' | sudo tee /opt/homebrew/bin/gtar + sudo chmod +x /opt/homebrew/bin/gtar - name: Install OpenVINO run: | From 9f80e4e3fe5efa1052bd327dbe9f9292acb01f42 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 29 Jan 2025 22:12:59 +0100 Subject: [PATCH 56/68] Fixed workflow --- .github/workflows/build-macos-bindings.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 42c49ea5..7a70404c 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -22,7 +22,7 @@ jobs: - name: "Install gtar wrapper" run: | sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig - sudo echo '#!/bin/bash sudo /opt/homebrew/bin/gtar.orig "$@"' | sudo tee /opt/homebrew/bin/gtar + echo '#!/bin/bash\nsudo /opt/homebrew/bin/gtar.orig "$@"' | sudo tee /opt/homebrew/bin/gtar sudo chmod +x /opt/homebrew/bin/gtar - name: Install OpenVINO @@ -86,3 +86,7 @@ jobs: name: "macos_bindings.tgz" path: "openvino_bindings/bazel-bin/macos_bindings.tgz" if-no-files-found: error + + - name: Restore gtar + run: | + sudo mv /opt/homebrew/bin/gtar.orig /opt/homebrew/bin/gtar From 9454eb21fe96c0a71445f70e77fa704643f8a74d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 10:08:48 +0100 Subject: [PATCH 57/68] Trying to fix cache --- .github/workflows/build-macos-bindings.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 7a70404c..ef16335f 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -18,12 +18,16 @@ jobs: steps: - uses: actions/checkout@v4 - # Need to wrap the tar command to fix permission denied error in cache action (https://github.com/actions/cache/issues/629#issuecomment-1189184648) - - name: "Install gtar wrapper" + # # Need to wrap the tar command to fix permission denied error in cache action (https://github.com/actions/cache/issues/629#issuecomment-1189184648) + # - name: "Install gtar wrapper" + # run: | + # sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig + # echo '#!/bin/bash\nsudo /opt/homebrew/bin/gtar.orig "$@"' | sudo tee /opt/homebrew/bin/gtar + # sudo chmod +x /opt/homebrew/bin/gtar + + - name: Change ownership run: | - sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig - echo '#!/bin/bash\nsudo /opt/homebrew/bin/gtar.orig "$@"' | sudo tee /opt/homebrew/bin/gtar - sudo chmod +x /opt/homebrew/bin/gtar + sudo chown -R $USER /usr/local /opt - name: Install OpenVINO run: | From dedca77b9bdce458b8799836c4008de8770b30f6 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 10:11:39 +0100 Subject: [PATCH 58/68] Fixed build --- .github/workflows/build-macos-bindings.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index ef16335f..45c9c114 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -91,6 +91,6 @@ jobs: path: "openvino_bindings/bazel-bin/macos_bindings.tgz" if-no-files-found: error - - name: Restore gtar - run: | - sudo mv /opt/homebrew/bin/gtar.orig /opt/homebrew/bin/gtar + # - name: Restore gtar + # run: | + # sudo mv /opt/homebrew/bin/gtar.orig /opt/homebrew/bin/gtar From a5b0035d3e538f98e0dcc0b4c0440b1f1e56825c Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 10:48:03 +0100 Subject: [PATCH 59/68] Extracted linux workflow --- .github/workflows/build-and-test.yml | 24 ++----- .github/workflows/build-linux-bindings.yml | 83 ++++++++++++++++++++++ .github/workflows/build-macos-bindings.yml | 39 ++++------ 3 files changed, 101 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/build-linux-bindings.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b5e87719..e209cc00 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -21,27 +21,11 @@ jobs: os: ${{ matrix.os }} build-linux-bindings: - name: Build Linux Bindings - runs-on: ubuntu-22.04-16-cores permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build Docker image - run: | - cd openvino_bindings - docker build -f Dockerfile.ubuntu -t linux-bindings-ubuntu . - docker create --name bindings_container linux-bindings-ubuntu - docker cp bindings_container:/bindings-out/linux_bindings.tgz ./linux_bindings.tgz - - name: Upload bindings to artifacts - uses: actions/upload-artifact@v4 - with: - name: "linux_bindings.tgz" - path: openvino_bindings/linux_bindings.tgz - if-no-files-found: error + contents: write + uses: ./.github/workflows/build-linux-bindings.yml + with: + OPENVINO_VERSION: '2024.6' build-windows-bindings: if: false diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml new file mode 100644 index 00000000..08bf974a --- /dev/null +++ b/.github/workflows/build-linux-bindings.yml @@ -0,0 +1,83 @@ +name: Build Linux Bindings + +on: + workflow_call: + inputs: + OPENVINO_VERSION: + required: true + description: 'The version of OpenVINO to use' + type: string + +jobs: + build-linux-bindings: + runs-on: ubuntu-22.04-16-cores + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y \ + build-essential \ + nasm yasm \ + unzip \ + curl \ + git + + - name: Install Bazel + run: | + BAZEL_VERSION=6.1.1 + curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + chmod +x bazel-*.sh && \ + sudo ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + rm -f bazel-$BAZEL_VERSION-installer-linux-x86_64.sh + + - name: Install OpenVINO + run: | + sudo mkdir -p /opt/intel + curl -L https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/linux/openvino_genai_ubuntu22_${{ inputs.OPENVINO_VERSION }}.0.0_x86_64.tar.gz \ + --output openvino.tgz && tar -xf openvino.tgz && \ + sudo mv openvino_genai_ubuntu22_${{ inputs.OPENVINO_VERSION }}.0.0_x86_64 /opt/intel/openvino && rm openvino.tgz + cd /opt/intel/openvino && sudo ./install_dependencies/install_openvino_dependencies.sh -y + + - name: Cache ffmpeg + id: cache-ffmpeg + uses: actions/cache@v4 + with: + path: | + /opt/ffmpeg + key: ${{ runner.os }}-ffmpeg + + - name: Install FFmpeg + run: | + sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh + + - name: Cache OpenCV build + id: cache-opencv + uses: actions/cache@v4 + with: + path: | + /usr/local/include/opencv4 + /usr/local/lib/libopencv_* + key: ${{ runner.os }}-opencv-${{ hashFiles('openvino_bindings/scripts/setup_opencv.sh') }} + + - name: Install OpenCV + run: | + sudo /bin/bash openvino_bindings/scripts/setup_opencv.sh + + - name: Install numpy + run: | + sudo pip3 install numpy + + - name: Build bindings + run: | + sudo bazel build //:linux_bindings + + - name: Upload bindings to artifacts + uses: actions/upload-artifact@v4 + with: + name: "linux_bindings.tgz" + path: openvino_bindings/bazel-bin/linux_bindings.tgz + if-no-files-found: error diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index 45c9c114..f505465b 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -18,13 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - # # Need to wrap the tar command to fix permission denied error in cache action (https://github.com/actions/cache/issues/629#issuecomment-1189184648) - # - name: "Install gtar wrapper" - # run: | - # sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig - # echo '#!/bin/bash\nsudo /opt/homebrew/bin/gtar.orig "$@"' | sudo tee /opt/homebrew/bin/gtar - # sudo chmod +x /opt/homebrew/bin/gtar - + # NOTE: cache action executes without sudo, so we need to change ownership (https://github.com/actions/cache/issues/845#issuecomment-1252594999) - name: Change ownership run: | sudo chown -R $USER /usr/local /opt @@ -37,7 +31,19 @@ jobs: sudo tar -xvf /tmp/openvino.tar.gz -C /opt/intel sudo mv /opt/intel/openvino_genai_macos_12_6_${{ inputs.OPENVINO_VERSION }}.0.0_arm64 /opt/intel/openvino rm /tmp/openvino.tar.gz - ls /opt/intel/openvino + + - name: Cache ffmpeg + id: cache-ffmpeg + uses: actions/cache@v4 + with: + path: | + /opt/ffmpeg + key: ${{ runner.os }}-ffmpeg + + - name: Install ffmpeg + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' + run: | + sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh - name: Cache OpenCV build id: cache-opencv @@ -53,19 +59,6 @@ jobs: run: | sudo /bin/bash openvino_bindings/scripts/setup_opencv.sh - - name: Cache ffmpeg - id: cache-ffmpeg - uses: actions/cache@v4 - with: - path: | - /opt/ffmpeg - key: ${{ runner.os }}-ffmpeg - - - name: Install ffmpeg - if: steps.cache-ffmpeg.outputs.cache-hit != 'true' - run: | - sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh - - name: Install numpy run: | brew install numpy @@ -90,7 +83,3 @@ jobs: name: "macos_bindings.tgz" path: "openvino_bindings/bazel-bin/macos_bindings.tgz" if-no-files-found: error - - # - name: Restore gtar - # run: | - # sudo mv /opt/homebrew/bin/gtar.orig /opt/homebrew/bin/gtar From 6ae953fbe48314782efd0f28893c603904e4a501 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 10:48:57 +0100 Subject: [PATCH 60/68] Fixed workflow --- .github/workflows/build-linux-bindings.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml index 08bf974a..4a0064c9 100644 --- a/.github/workflows/build-linux-bindings.yml +++ b/.github/workflows/build-linux-bindings.yml @@ -46,9 +46,9 @@ jobs: id: cache-ffmpeg uses: actions/cache@v4 with: - path: | - /opt/ffmpeg - key: ${{ runner.os }}-ffmpeg + path: | + /opt/ffmpeg + key: ${{ runner.os }}-ffmpeg - name: Install FFmpeg run: | From 4803b1107893f6dd79aa9bdf005520d723c058a6 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 10:59:54 +0100 Subject: [PATCH 61/68] Fixed linux build --- .github/workflows/build-linux-bindings.yml | 10 ++++++++++ .github/workflows/build-macos-bindings.yml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml index 4a0064c9..53b1859b 100644 --- a/.github/workflows/build-linux-bindings.yml +++ b/.github/workflows/build-linux-bindings.yml @@ -71,9 +71,19 @@ jobs: run: | sudo pip3 install numpy + - name: Cache Bazel + uses: actions/cache@v4 + with: + path: | + ~/.cache/bazel + key: ${{ runner.os }}-bazel-${{ hashFiles('**/.bazelversion', '**/.bazelrc', '**/WORKSPACE', '**/WORKSPACE.bazel', '**/MODULE.bazel', '**/*BUILD') }} + restore-keys: | + ${{ runner.os }}-bazel- + - name: Build bindings run: | sudo bazel build //:linux_bindings + working-directory: openvino_bindings - name: Upload bindings to artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/build-macos-bindings.yml b/.github/workflows/build-macos-bindings.yml index f505465b..14188a55 100644 --- a/.github/workflows/build-macos-bindings.yml +++ b/.github/workflows/build-macos-bindings.yml @@ -68,7 +68,7 @@ jobs: with: path: | /private/var/tmp/_bazel_runner/ - key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel', '**/*BUILD') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('**/.bazelversion', '**/.bazelrc', '**/WORKSPACE', '**/WORKSPACE.bazel', '**/MODULE.bazel', '**/*BUILD') }} restore-keys: | ${{ runner.os }}-bazel- From 4b300c1c14fa8c34c07d446d466d14b905edc2d0 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 12:31:07 +0100 Subject: [PATCH 62/68] Trying to fix build --- .github/workflows/build-linux-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml index 53b1859b..08eae863 100644 --- a/.github/workflows/build-linux-bindings.yml +++ b/.github/workflows/build-linux-bindings.yml @@ -82,7 +82,7 @@ jobs: - name: Build bindings run: | - sudo bazel build //:linux_bindings + bazel build //:linux_bindings working-directory: openvino_bindings - name: Upload bindings to artifacts From d5b69482c2195aba0ce25ae5db1e50ff1a083b2e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 13:00:11 +0100 Subject: [PATCH 63/68] Fixed cache --- .github/workflows/build-and-test.yml | 4 ++++ .github/workflows/build-linux-bindings.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e209cc00..f8314ed0 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -98,7 +98,9 @@ jobs: - name: Set up Flutter uses: subosito/flutter-action@v2 with: + cache: true flutter-version-file: pubspec.yaml + channel: 'stable' - name: Install dependencies run: flutter pub get @@ -143,7 +145,9 @@ jobs: - name: Set up Flutter uses: subosito/flutter-action@v2 with: + cache: true flutter-version-file: pubspec.yaml + channel: 'stable' - name: Install dependencies run: flutter pub get diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml index 08eae863..e88ba255 100644 --- a/.github/workflows/build-linux-bindings.yml +++ b/.github/workflows/build-linux-bindings.yml @@ -51,6 +51,7 @@ jobs: key: ${{ runner.os }}-ffmpeg - name: Install FFmpeg + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' run: | sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh @@ -64,6 +65,7 @@ jobs: key: ${{ runner.os }}-opencv-${{ hashFiles('openvino_bindings/scripts/setup_opencv.sh') }} - name: Install OpenCV + if: steps.cache-opencv.outputs.cache-hit != 'true' run: | sudo /bin/bash openvino_bindings/scripts/setup_opencv.sh From 53802a9c32546284e8acd9aff424865e06e897b6 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 13:06:14 +0100 Subject: [PATCH 64/68] Adjusted rights --- .github/workflows/build-linux-bindings.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml index e88ba255..9da12a3b 100644 --- a/.github/workflows/build-linux-bindings.yml +++ b/.github/workflows/build-linux-bindings.yml @@ -17,6 +17,11 @@ jobs: steps: - uses: actions/checkout@v4 + # NOTE: cache action executes without sudo, so we need to change ownership (https://github.com/actions/cache/issues/845#issuecomment-1252594999) + - name: Change ownership + run: | + sudo chown -R $USER /usr/local + - name: Install dependencies run: | sudo apt-get update && sudo apt-get install -y \ From 224adbcb18f1f87a00c6d2baaaef18ae4c6feded Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 17:03:38 +0100 Subject: [PATCH 65/68] Trying to fix build --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/build-linux-bindings.yml | 2 +- linux/packaging/deb/make_config.yaml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f8314ed0..52053b26 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -129,7 +129,7 @@ jobs: uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb libtiff5 - name: Download OpenVINO bindings uses: actions/download-artifact@v4 diff --git a/.github/workflows/build-linux-bindings.yml b/.github/workflows/build-linux-bindings.yml index 9da12a3b..d726237c 100644 --- a/.github/workflows/build-linux-bindings.yml +++ b/.github/workflows/build-linux-bindings.yml @@ -20,7 +20,7 @@ jobs: # NOTE: cache action executes without sudo, so we need to change ownership (https://github.com/actions/cache/issues/845#issuecomment-1252594999) - name: Change ownership run: | - sudo chown -R $USER /usr/local + sudo chown $USER /usr/local/lib /usr/local/include - name: Install dependencies run: | diff --git a/linux/packaging/deb/make_config.yaml b/linux/packaging/deb/make_config.yaml index bbef5738..f3957189 100644 --- a/linux/packaging/deb/make_config.yaml +++ b/linux/packaging/deb/make_config.yaml @@ -15,7 +15,6 @@ dependencies: - libtbb12 - libtiff5 - libopenjp2-7 - - libtiff5 - libpng16-16 - libzstd1 From c1ad3015b2db10aae007fd26c3c771854d7e16c1 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 17:10:15 +0100 Subject: [PATCH 66/68] Downgraded ubuntu on the integration tests --- .github/workflows/build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 52053b26..d50f86f8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -118,7 +118,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} integration_tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [ build-linux-bindings ] env: @@ -129,7 +129,7 @@ jobs: uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb libtiff5 + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb - name: Download OpenVINO bindings uses: actions/download-artifact@v4 From 6bbfb048d9015436d8a76fe8cf59986bf65d7990 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 17:44:24 +0100 Subject: [PATCH 67/68] Enabled windows build --- .github/workflows/build-and-test.yml | 12 ++++++++--- .github/workflows/build-windows-bindings.yml | 22 +++++++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d50f86f8..72b2c74a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-latest] + os: [ubuntu-22.04, windows-latest, macos-latest] uses: ./.github/workflows/build-ui.yml with: os: ${{ matrix.os }} @@ -28,7 +28,6 @@ jobs: OPENVINO_VERSION: '2024.6' build-windows-bindings: - if: false permissions: contents: write uses: ./.github/workflows/build-windows-bindings.yml @@ -46,7 +45,7 @@ jobs: needs: [ build-linux-bindings, build-windows-bindings, build-macos-bindings, build-ui ] strategy: matrix: - os: [linux, macos] + os: [linux, windows, macos] steps: - uses: actions/checkout@v4 @@ -157,6 +156,13 @@ jobs: sudo Xvfb $DISPLAY -screen 0 1280x1024x24 > /dev/null 2>&1 & echo "Xvfb started" + - name: Cache build + uses: actions/cache@v4 + with: + path: | + build + key: ${{ runner.os }}-flutter + - name: Run integration tests run: flutter test --coverage --no-pub integration_test -d linux diff --git a/.github/workflows/build-windows-bindings.yml b/.github/workflows/build-windows-bindings.yml index 352024cc..8fd666d9 100644 --- a/.github/workflows/build-windows-bindings.yml +++ b/.github/workflows/build-windows-bindings.yml @@ -74,8 +74,19 @@ jobs: start /wait opencv.exe -suppresslaunch -y -gm2 -o"C:\" shell: cmd + - name: Cache vcpkg + uses: actions/cache@v4 + id: cache-vcpkg + with: + path: | + C:\vcpkg + key: ${{ runner.os }}-vcpkg-${{ hashFiles('openvino_bindings/third_party/vcpkg.json') }} + restore-keys: | + ${{ runner.os }}-vcpkg- + # Step 9: Install vcpkg and ffmpeg - name: Install vcpkg and ffmpeg + if: steps.cache-vcpkg.outputs.cache-hit != 'true' shell: powershell run: | if (!(Test-Path "C:\vcpkg")) { git clone https://github.com/microsoft/vcpkg.git C:\vcpkg } @@ -98,12 +109,21 @@ jobs: C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm git patch unzip" shell: bash + - name: Cache Bazel + uses: actions/cache@v4 + with: + path: | + C:/users/runneradmin.runner/_bazel_runneradmin/ + key: ${{ runner.os }}-bazel-${{ hashFiles('**/.bazelversion', '**/.bazelrc', '**/WORKSPACE', '**/WORKSPACE.bazel', '**/MODULE.bazel', '**/*BUILD') }} + restore-keys: | + ${{ runner.os }}-bazel- + # Step 12: Build with Bazel - name: Build Windows Bindings with Bazel + working-directory: openvino_bindings env: PYTHON_BIN_PATH: "C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe" run: | - cd openvino_bindings bazel build -c opt :windows_bindings --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe" shell: bash From 83c3e7d86839cb8e62c226cf67ad96208b6aa6d3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 30 Jan 2025 18:48:44 +0100 Subject: [PATCH 68/68] Fixed cache --- .github/workflows/build-windows-bindings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-windows-bindings.yml b/.github/workflows/build-windows-bindings.yml index 8fd666d9..f6d4dd2a 100644 --- a/.github/workflows/build-windows-bindings.yml +++ b/.github/workflows/build-windows-bindings.yml @@ -80,6 +80,7 @@ jobs: with: path: | C:\vcpkg + openvino_bindings/third_party/vcpkg_installed key: ${{ runner.os }}-vcpkg-${{ hashFiles('openvino_bindings/third_party/vcpkg.json') }} restore-keys: | ${{ runner.os }}-vcpkg-