Skip to content

Commit

Permalink
Ported changes from master (#22193)
Browse files Browse the repository at this point in the history
* [CI] [GHA] Introduce JS API as a part of the existing workflows (#21898)

* add js api to linux

* try inside the ov repo

* use rel path

* use a separate job for js api

* correct command formatting

* add missing var

* use spacing

* mv js building

* add node installing

* add to windows

* check pwsh and cmd running npm

* add smart CI conditions; disable for win

* use node version as env var

* extract js job into a separate workflow, add to other *nix

* fix input name

* Activate js bindings tests for arm64

* upload ov js package

* correct formatting

* add missing syntax

---------

Co-authored-by: Vishniakov Nikolai <[email protected]>

* Cmake Python build option flags should be added to the command in step #3 not step #4. I fixed the typo (#21993)

* [CI] [GHA] [JS API] Remove explicit default values settings in Linux ARM64 `cmake` (#22019)

* rm explicit default values settings

* Activate mac arm64 js api check

* Specify test run

---------

Co-authored-by: Vishniakov Nikolai <[email protected]>

* [OV JS] Activate validation for mac x86 (#22035)

* Extend validation for mac x86

* Remove extra params

* fixed broken doc links (#22088)

Co-authored-by: Przemyslaw Wysocki <[email protected]>

* [GHA] Update MO deps (#22130)

* [GHA] Update MO deps

Signed-off-by: Kazantsev, Roman <[email protected]>

* Update .github/components.yml

---------

Signed-off-by: Kazantsev, Roman <[email protected]>

* Avoid DOWNLOAD_EXTRACT_TIMESTAMP warning (#22135)

* Avoid DOWNLOAD_EXTRACT_TIMESTAMP warning

* Change applying policy condition

Co-authored-by: Ilya Lavrenov <[email protected]>

---------

Co-authored-by: Ilya Lavrenov <[email protected]>

* Fixed API validator search (#22136)

* [OV JS] Conditional enabling of JS API (#22139)

* Disable js api building for vcpkg

* Disable JS API by default

* Add disable JS API conditions in features.cmake

* Update cmake/features.cmake

* Update src/bindings/js/CMakeLists.txt

---------

Co-authored-by: Ilya Lavrenov <[email protected]>

* Fixed GHSA-h5c8-rqwp-cp95 (#22159)

* [PyOV][SAMPLES] Fix bugbear issue B038 (#22183)

* Fixed compilation on GHA CI

* Decrease number of workers for ONNX Model tests to prevent OOM kills (#22243)

* Decrease number of workers for ONNX Model tests to prevent OOM kills

* Try to use "-n auto" also

---------

Signed-off-by: Kazantsev, Roman <[email protected]>
Co-authored-by: Andrei Kashchikhin <[email protected]>
Co-authored-by: Vishniakov Nikolai <[email protected]>
Co-authored-by: fredrickomondi <[email protected]>
Co-authored-by: Santhosh Mamidisetti <[email protected]>
Co-authored-by: Przemyslaw Wysocki <[email protected]>
Co-authored-by: Roman Kazantsev <[email protected]>
Co-authored-by: Jan Iwaszkiewicz <[email protected]>
Co-authored-by: Andrey Babushkin <[email protected]>
  • Loading branch information
9 people authored Jan 19, 2024
1 parent 187e262 commit d19307b
Show file tree
Hide file tree
Showing 24 changed files with 291 additions and 57 deletions.
4 changes: 4 additions & 0 deletions .github/actions/setup_python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ runs:
name: Install 'actions/setup-python@v4' dependencies
shell: bash
run: apt-get update && apt-get install -y ca-certificates software-properties-common
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input

- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
name: Setup sudo and python3
shell: bash
run: apt-get update && apt-get install -y sudo python3 # Needed for the deadsnakes action
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input

- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
name: Setup Python ${{ inputs.version }}
Expand Down
3 changes: 2 additions & 1 deletion .github/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ IE_Tests:

MO:
revalidate:
- POT
- PyTorch_FE
- TF_FE
build:
- Python_API

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_cxx_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Samples
name: C++ Unit Tests

on:
workflow_call:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_onnx_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
python3 -m pip install pytest-xdist[psutil] pytest-forked
- name: ONNX Models Tests
run: python3 -m pytest --backend="CPU" --model_zoo_dir="${MODELS_SHARE_PATH}" ${INSTALL_TEST_DIR}/onnx/tests/tests_python/test_zoo_models.py -v -n 12 --forked -k 'not _cuda' --model_zoo_xfail
run: python3 -m pytest --backend="CPU" --model_zoo_dir="${MODELS_SHARE_PATH}" ${INSTALL_TEST_DIR}/onnx/tests/tests_python/test_zoo_models.py -v -n auto --forked -k 'not _cuda' --model_zoo_xfail
61 changes: 61 additions & 0 deletions .github/workflows/job_openvino_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: OpenVINO JS API

on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
container:
description: 'JSON to be converted to the value of the "container" configuration for the job'
type: string
required: false
default: '{"image": null}'

jobs:
JS_API:
name: OpenVINO JS API
timeout-minutes: 10
runs-on: ${{ inputs.runner }}
container: ${{ fromJSON(inputs.container) }}
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
OPENVINO_JS_DIR: ${{ github.workspace }}/openvino/src/bindings/js
OPENVINO_JS_LIBS_DIR: ${{ github.workspace }}/openvino/src/bindings/js/node/bin
NODE_VERSION: 18
steps:
- name: Fetch OpenVINO JS sources
uses: actions/checkout@v4
with:
sparse-checkout: |
src/bindings/js
path: 'openvino'

# Needed as ${{ github.workspace }} is not working correctly when using Docker
- name: Setup Variables
run: |
echo "OPENVINO_JS_DIR=$GITHUB_WORKSPACE/openvino/src/bindings/js" >> "$GITHUB_ENV"
echo "OPENVINO_JS_LIBS_DIR=$GITHUB_WORKSPACE/openvino/src/bindings/js/node/bin" >> "$GITHUB_ENV"
- name: Download OpenVINO JS package
uses: actions/download-artifact@v3
with:
name: openvino_js_package
path: ${{ env.OPENVINO_JS_LIBS_DIR }}

- name: Setup Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Configure OpenVINO JS API
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm i

- name: Test OpenVINO JS API
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm run test
27 changes: 27 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
OPENVINO_REPO: /__w/openvino/openvino/openvino
OPENVINO_CONTRIB_REPO: /__w/openvino/openvino/openvino_contrib
INSTALL_DIR: /__w/openvino/openvino/openvino_install
INSTALL_DIR_JS: /__w/openvino/openvino/openvino_install/js
INSTALL_TEST_DIR: /__w/openvino/openvino/tests_install
DEVELOPER_PACKAGE_DIR: /__w/openvino/openvino/developer_package_install
BUILD_DIR: /__w/openvino/openvino/openvino_build
Expand Down Expand Up @@ -222,6 +223,15 @@ jobs:
-B ${BUILD_DIR}
cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
- name: CMake configure, build and install - OpenVINO JS API
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
run:
cmake -DCPACK_GENERATOR=NPM -DENABLE_SYSTEM_TBB=OFF -UTBB* -S ${OPENVINO_REPO} -B ${BUILD_DIR}

cmake --build ${BUILD_DIR} --parallel

cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR_JS} -P ${BUILD_DIR}/cmake_install.cmake

#
# Upload build artifacts
#
Expand All @@ -234,6 +244,14 @@ jobs:
path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz
if-no-files-found: 'error'

- name: Upload openvino js package
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: actions/upload-artifact@v3
with:
name: openvino_js_package
path: ${{ env.INSTALL_DIR_JS }}
if-no-files-found: 'error'

- name: Upload openvino developer package
if: ${{ always() }}
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -275,6 +293,15 @@ jobs:
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}

JS_API:
name: OpenVINO JS API
needs: [ Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: ./.github/workflows/job_openvino_js.yml
with:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04"}'

Conformance:
needs: [ Build, Smart_CI ]
timeout-minutes: ${{ matrix.TEST_TYPE == 'API' && 5 || 15 }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
OPENVINO_REPO: /__w/openvino/openvino/openvino
OPENVINO_CONTRIB_REPO: /__w/openvino/openvino/openvino_contrib
INSTALL_DIR: /__w/openvino/openvino/openvino_install
INSTALL_DIR_JS: /__w/openvino/openvino/openvino_install/js
INSTALL_TEST_DIR: /__w/openvino/openvino/tests_install
DEVELOPER_PACKAGE_DIR: /__w/openvino/openvino/developer_package_install
BUILD_DIR: /__w/openvino/openvino/openvino_build
Expand Down Expand Up @@ -221,6 +222,20 @@ jobs:
-B ${BUILD_DIR}
cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
- name: CMake configure, build and install - OpenVINO JS API
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
run: |
cmake \
-DCPACK_GENERATOR=NPM \
-DENABLE_SYSTEM_TBB=OFF -UTBB* \
-DENABLE_INTEL_GPU=OFF \
-S ${OPENVINO_REPO} \
-B ${BUILD_DIR}
cmake --build ${BUILD_DIR} --parallel
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR_JS} -P ${BUILD_DIR}/cmake_install.cmake
#
# Upload build artifacts
#
Expand All @@ -241,6 +256,14 @@ jobs:
path: ${{ env.BUILD_DIR }}/openvino_developer_package.tar.gz
if-no-files-found: 'error'

- name: Upload openvino js package
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: actions/upload-artifact@v3
with:
name: openvino_js_package
path: ${{ env.INSTALL_DIR_JS }}
if-no-files-found: 'error'

- name: Upload openvino debian packages
if: ${{ 'false' }}
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -275,6 +298,15 @@ jobs:
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}

JS_API:
name: OpenVINO JS API
needs: [ Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: ./.github/workflows/job_openvino_js.yml
with:
runner: 'aks-linux-16-cores-arm'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04"}'

ONNX_Runtime:
name: ONNX Runtime Integration
if: fromJSON(needs.smart_ci.outputs.affected_components).ONNX_RT
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
OPENVINO_REPO: ${{ github.workspace }}/openvino
OPENVINO_CONTRIB_REPO: ${{ github.workspace }}/openvino_contrib
INSTALL_DIR: ${{ github.workspace }}/openvino_install
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install
BUILD_DIR: ${{ github.workspace }}/build
steps:
Expand Down Expand Up @@ -190,6 +191,17 @@ jobs:
-B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
- name: CMake configure, build and install - OpenVINO JS API
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
run: |
cmake \
-DCPACK_GENERATOR=NPM \
-S ${{ env.OPENVINO_REPO }} \
-B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --parallel
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR_JS }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
#
# Upload build artifacts
#
Expand All @@ -210,6 +222,14 @@ jobs:
path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gz
if-no-files-found: 'error'

- name: Upload openvino js package
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: actions/upload-artifact@v3
with:
name: openvino_js_package
path: ${{ env.INSTALL_DIR_JS }}
if-no-files-found: 'error'

Samples:
needs: [ Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).samples
Expand All @@ -218,6 +238,14 @@ jobs:
runner: 'macos-13'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}

JS_API:
name: OpenVINO JS API
needs: [ Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: ./.github/workflows/job_openvino_js.yml
with:
runner: 'macos-13'

CXX_Unit_Tests:
name: C++ unit tests
needs: [ Build, Smart_CI ]
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/mac_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
OPENVINO_REPO: ${{ github.workspace }}/openvino
OPENVINO_CONTRIB_REPO: ${{ github.workspace }}/openvino_contrib
INSTALL_DIR: ${{ github.workspace }}/openvino_install
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install
BUILD_DIR: ${{ github.workspace }}/build
steps:
Expand Down Expand Up @@ -189,6 +190,17 @@ jobs:
-B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
- name: CMake configure, build and install - OpenVINO JS API
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
run: |
cmake \
-DCPACK_GENERATOR=NPM \
-S ${{ env.OPENVINO_REPO }} \
-B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --parallel
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR_JS }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
#
# Upload build artifacts
#
Expand All @@ -209,13 +221,29 @@ jobs:
path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gz
if-no-files-found: 'error'

- name: Upload openvino js package
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: actions/upload-artifact@v3
with:
name: openvino_js_package
path: ${{ env.INSTALL_DIR_JS }}
if-no-files-found: 'error'

Samples:
needs: Build
uses: ./.github/workflows/job_samples_tests.yml
with:
runner: 'macos-13-xlarge'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}

JS_API:
name: OpenVINO JS API
needs: [ Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: ./.github/workflows/job_openvino_js.yml
with:
runner: 'macos-13-xlarge'

CXX_Unit_Tests:
name: C++ unit tests
needs: [ Build, Smart_CI ]
Expand Down
Loading

0 comments on commit d19307b

Please sign in to comment.