51
51
id : openvino_download
52
52
with :
53
53
platform : ubuntu22
54
- commit_packages_to_provide : wheels
54
+ commit_packages_to_provide : wheels,openvino_js_package.tar.gz
55
55
revision : latest_available_commit
56
56
57
57
- name : Clone docker tag from OpenVINO repo
@@ -420,8 +420,9 @@ jobs:
420
420
env :
421
421
CMAKE_GENERATOR : Unix Makefiles
422
422
OV_INSTALL_DIR : ${{ github.workspace }}/ov
423
+ SRC_DIR : ${{ github.workspace }}/openvino.genai
424
+ INSTALL_DIR : ${{ github.workspace }}/openvino.genai/src/js/bin
423
425
BUILD_DIR : ${{ github.workspace }}/build
424
- SRC_DIR : ${{ github.workspace }}/src
425
426
426
427
steps :
427
428
- name : Clone openvino.genai
@@ -437,27 +438,19 @@ jobs:
437
438
path : ${{ env.OV_INSTALL_DIR }}
438
439
merge-multiple : true
439
440
440
- - name : Build with ENABLE_JS=ON
441
+ - name : Build GenAI Node.js bindings
441
442
run : |
442
443
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
443
- cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_JS=ON -S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }}
444
+ cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
445
+ -DENABLE_JS=ON -DCPACK_GENERATOR=NPM \
446
+ -DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF \
447
+ -S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }}
444
448
cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose
445
- cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }}
446
-
447
- - name : Combine binaries for Node.js package
448
- run : |
449
- mkdir -p nodejs
450
- cp -r runtime/lib/intel64/* nodejs
451
- cp -r runtime/3rdparty/tbb/lib/* nodejs
452
- cp genai_node_addon.node nodejs
453
- GENAI_VERSION=$(grep -oP '(?<=CMAKE_PROJECT_VERSION:STATIC=)[^"]*' ${{ env.BUILD_DIR }}/CMakeCache.txt)
454
- OV_VERSION=$(echo $GENAI_VERSION | sed 's/..$//')
455
- patchelf --set-rpath '$ORIGIN' nodejs/libopenvino.so.$OV_VERSION nodejs/libopenvino_genai.so.$GENAI_VERSION
456
- working-directory : ${{ env.OV_INSTALL_DIR }}
457
-
449
+ cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }}
450
+
458
451
- name : Pack Node.js bindings libs
459
452
run : tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/genai_nodejs_bindings.tar.gz
460
- working-directory : ${{ env.OV_INSTALL_DIR }}/nodejs
453
+ working-directory : ${{ env.INSTALL_DIR }}
461
454
462
455
- name : Upload Archive Package with Node.js bindings
463
456
if : ${{ always() }}
@@ -467,16 +460,27 @@ jobs:
467
460
path : ${{ env.BUILD_DIR }}/genai_nodejs_bindings.tar.gz
468
461
if-no-files-found : ' error'
469
462
470
- - name : Run npm package tests
463
+ # JS pacakges uses the OpenVINO and OpenVINO GenAI libraries from the bin directory.
464
+ # Here we emulate the installation of the openvino-node package from NPM. The latest
465
+ # release of the openvino-node package is installed, and we need to update the binaries
466
+ # in the node_modules/openvino-node/bin directory to work correctly with GenAI
467
+ - name : Install npm package tests dependencies
471
468
working-directory : ${{ env.SRC_DIR }}/src/js
472
469
run : |
473
- cp -R ${{ env.OV_INSTALL_DIR }}/nodejs bin
474
- npm install
475
- npm test
470
+ npm install --verbose
471
+ rm -rf node_modules/openvino-node/bin
472
+ cp -R ${{ env.OV_INSTALL_DIR }}/openvino_js_package node_modules/openvino-node/bin
473
+
474
+ - name : Run npm package tests
475
+ working-directory : ${{ env.SRC_DIR }}/src/js
476
+ run : npm test
476
477
477
478
- name : Install genai-node samples dependencies
478
- run : npm install
479
479
working-directory : ${{ env.SRC_DIR }}/samples/js/text_generation
480
+ run : |
481
+ npm install --verbose
482
+ rm -rf node_modules/openvino-node/bin
483
+ cp -R ${{ env.OV_INSTALL_DIR }}/openvino_js_package node_modules/openvino-node/bin
480
484
481
485
- name : Run samples tests
482
486
run : npm test
0 commit comments