Skip to content

Commit 3137543

Browse files
[JS] Split building and testing NodeJS for Linux CI (#1859)
Signed-off-by: Kirill Suvorov <kirill.suvorov@intel.com> Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
1 parent f61bd0d commit 3137543

File tree

2 files changed

+76
-33
lines changed

2 files changed

+76
-33
lines changed

.github/workflows/linux.yml

+75-32
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,63 @@ jobs:
263263
path: ${{ env.INSTALL_DIR }}/*.tar.gz
264264
if-no-files-found: 'error'
265265

266+
genai_build_nodejs:
267+
name: Build Node.js bindings
268+
strategy:
269+
fail-fast: false
270+
matrix:
271+
build-type: [Release]
272+
needs: [ openvino_download ]
273+
timeout-minutes: 20
274+
defaults:
275+
run:
276+
shell: bash
277+
runs-on: aks-linux-4-cores-16gb
278+
container:
279+
image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
280+
volumes:
281+
- /mount:/mount
282+
- ${{ github.workspace }}:${{ github.workspace }}
283+
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
284+
285+
env:
286+
SRC_DIR: ${{ github.workspace }}/openvino.genai
287+
BUILD_DIR: ${{ github.workspace }}/build
288+
INSTALL_DIR: ${{ github.workspace }}/openvino.genai/src/js/bin
289+
OV_INSTALL_DIR: ${{ github.workspace }}/ov
290+
291+
steps:
292+
- name: Clone openvino.genai
293+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
294+
with:
295+
submodules: recursive
296+
path: ${{ env.SRC_DIR }}
297+
298+
- name: Download OpenVINO package
299+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
300+
with:
301+
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
302+
path: ${{ env.OV_INSTALL_DIR }}
303+
merge-multiple: true
304+
305+
- name: Build GenAI Node.js bindings
306+
run: |
307+
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
308+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
309+
-DENABLE_JS=ON -DCPACK_GENERATOR=NPM \
310+
-DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF \
311+
-S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }}
312+
cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose
313+
cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }}
314+
315+
- name: Upload Node.js bindings Build Package
316+
if: always()
317+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
318+
with:
319+
name: genai_nodejs_bindings
320+
path: ${{ env.INSTALL_DIR }}
321+
if-no-files-found: 'error'
322+
266323
genai_tests_wheel:
267324
name: Python (${{ matrix.test.name}}) Tests (wheel)
268325
needs: [ openvino_download, genai_build_wheel ]
@@ -395,29 +452,25 @@ jobs:
395452
SAMPLES_CPP_DIR: "${{ env.INSTALL_DIR }}/samples_bin"
396453
SAMPLES_C_DIR: "${{ env.INSTALL_DIR }}/samples_bin"
397454

398-
genai_build_nodejs_bindings:
399-
name: Build Node.js bindings
400-
strategy:
401-
fail-fast: false
402-
matrix:
403-
build-type: [Release]
404-
needs: [ openvino_download ]
455+
genai_nodejs_tests:
456+
name: Node.js bindings tests
457+
needs: [ openvino_download, genai_build_nodejs ]
405458
timeout-minutes: 20
406459
defaults:
407460
run:
408461
shell: bash
409462
runs-on: aks-linux-4-cores-16gb
410463
container:
411-
image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
464+
image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
412465
volumes:
413466
- /mount:/mount
414-
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING -v ${{ github.workspace }}:${{ github.workspace }}
467+
- ${{ github.workspace }}:${{ github.workspace }}
468+
415469
env:
416-
CMAKE_GENERATOR: Unix Makefiles
417470
OV_INSTALL_DIR: ${{ github.workspace }}/ov
418471
SRC_DIR: ${{ github.workspace }}/openvino.genai
419472
INSTALL_DIR: ${{ github.workspace }}/openvino.genai/src/js/bin
420-
BUILD_DIR: ${{ github.workspace }}/build
473+
NODE_VERSION: 21
421474

422475
steps:
423476
- name: Clone openvino.genai
@@ -426,34 +479,24 @@ jobs:
426479
path: ${{ env.SRC_DIR }}
427480
submodules: recursive
428481

429-
- name: Download OpenVINO package
482+
- name: Download OpenVINO Artifacts
430483
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
431484
with:
432485
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
433486
path: ${{ env.OV_INSTALL_DIR }}
434487
merge-multiple: true
435488

436-
- name: Build GenAI Node.js bindings
437-
run: |
438-
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
439-
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
440-
-DENABLE_JS=ON -DCPACK_GENERATOR=NPM \
441-
-DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF \
442-
-S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }}
443-
cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose
444-
cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }}
445-
446-
- name: Pack Node.js bindings libs
447-
run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/genai_nodejs_bindings.tar.gz
448-
working-directory: ${{ env.INSTALL_DIR }}
449-
450-
- name: Upload Archive Package with Node.js bindings
451-
if: ${{ always() }}
452-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
489+
- name: Download GenAI JS Bildings Artifacts
490+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
453491
with:
454492
name: genai_nodejs_bindings
455-
path: ${{ env.BUILD_DIR }}/genai_nodejs_bindings.tar.gz
456-
if-no-files-found: 'error'
493+
path: ${{ env.INSTALL_DIR }}
494+
merge-multiple: true
495+
496+
- name: Setup Node ${{ env.NODE_VERSION }}
497+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
498+
with:
499+
node-version: ${{ env.NODE_VERSION }}
457500

458501
# JS pacakges uses the OpenVINO and OpenVINO GenAI libraries from the bin directory.
459502
# Here we emulate the installation of the openvino-node package from NPM. The latest
@@ -489,7 +532,7 @@ jobs:
489532

490533
Overall_Status:
491534
name: ci/gha_overall_status_linux
492-
needs: [openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples, genai_tests_wheel, genai_samples_tests, genai_build_nodejs_bindings]
535+
needs: [openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples, genai_build_nodejs, genai_tests_wheel, genai_samples_tests, genai_nodejs_tests]
493536
if: ${{ always() }}
494537
runs-on: ubuntu-latest
495538
steps:

src/js/BUILD.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ Add the `openvino-genai-node` package manually by specifying the path to the `sr
104104
105105
### Verify the installation:
106106
```sh
107-
node -e "const { Pipeline } = require('openvino-genai-node'); console.log(Pipeline);"
107+
node -e "const { LLMPipeline } = require('openvino-genai-node'); console.log(LLMPipeline);"
108108
```

0 commit comments

Comments
 (0)