Bump setup python (#3145) #16870
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux (Ubuntu 22.04, Python 3.11) | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - master | |
| - 'releases/**' | |
| permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions | |
| concurrency: | |
| # github.ref is not unique in post-commit | |
| group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-linux | |
| cancel-in-progress: true | |
| env: | |
| PYTHON_VERSION: '3.11' | |
| OV_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }} | |
| CMAKE_CXX_COMPILER_LAUNCHER: sccache | |
| CMAKE_C_COMPILER_LAUNCHER: sccache | |
| SCCACHE_IGNORE_SERVER_IO_ERROR: 1 | |
| SCCACHE_SERVER_PORT: 35555 | |
| SCCACHE_CACHE_SIZE: 30G | |
| SCCACHE_AZURE_KEY_PREFIX: genai/ubuntu/22_04/x64 | |
| HF_HOME: /mount/caches/huggingface/lin | |
| OV_CACHE: /mount/caches/huggingface/.ov_cache/lin/ | |
| OPENVINO_LOG_LEVEL: 4 | |
| GENAI_ARCHIVE_NAME: genai.tar.gz | |
| GENAI_SAMPLES_NAME: genai_samples.tar.gz | |
| ARTIFACTS_SHARE: '/mount/build-artifacts' | |
| BASE_PRODUCT_TYPE: public_linux_ubuntu_22_04_x86_64 | |
| GENAI_WHEELS_ARTIFACT_NAME: 'genai_wheels' | |
| GENAI_ARCHIVE_ARTIFACT_BASE_NAME: 'genai_archive' | |
| jobs: | |
| smart_ci: | |
| name: Smart CI | |
| runs-on: ubuntu-latest | |
| outputs: | |
| affected_components: "${{ steps.smart_ci.outputs.affected_components }}" | |
| changed_components: "${{ steps.smart_ci.outputs.changed_components }}" | |
| skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}" | |
| steps: | |
| - name: checkout action | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| timeout-minutes: 15 | |
| with: | |
| sparse-checkout: .github | |
| - name: Get affected components | |
| id: smart_ci | |
| uses: openvinotoolkit/openvino/.github/actions/smart-ci@36a8f092d3250e7a2a365f0445e61297d91c358e | |
| with: | |
| repository: ${{ github.repository }} | |
| pr: ${{ github.event.number }} | |
| commit_sha: ${{ github.sha }} | |
| ref_name: ${{ github.ref_name }} | |
| component_pattern: "category: ((?!Python API|CPP API).*)|Structured Output" | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| skip_when_only_listed_labels_set: 'GH Pages Docs' | |
| skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*.gif' | |
| - name: Show affected components | |
| run: echo "${{ toJSON(steps.smart_ci.outputs.affected_components) }}" | |
| shell: bash | |
| openvino_download: | |
| needs: smart_ci | |
| if: ${{ github.event_name != 'merge_group' && needs.smart_ci.outputs.skip_workflow != 'True' }} | |
| name: Download OpenVINO | |
| outputs: | |
| status: ${{ steps.openvino_download.outcome }} | |
| ov_artifact_name: ${{ steps.openvino_download.outputs.ov_artifact_name }} | |
| ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }} | |
| ov_version: ${{ steps.openvino_download.outputs.ov_version }} | |
| docker_tag: ${{ steps.get_docker_tag.outputs.docker_tag }} | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-medium | |
| container: | |
| image: 'openvinogithubactions.azurecr.io/openvino_provider:0.1.0' | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| steps: | |
| - uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master | |
| id: openvino_download | |
| with: | |
| platform: ubuntu22 | |
| commit_packages_to_provide: wheels,developer_package.tar.gz,openvino_node_npm_package.tar.gz | |
| revision: latest_available_commit | |
| # Set specific revision and uncomment to use OV from its PR build: | |
| # branch_name: master | |
| # event_name: pull_request | |
| - name: Clone docker tag from OpenVINO repo | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| repository: 'openvinotoolkit/openvino' | |
| path: 'openvino' | |
| ref: ${{ env.OV_BRANCH }} | |
| sparse-checkout: | | |
| .github/dockerfiles/docker_tag | |
| - name: Save docker tag to output | |
| id: get_docker_tag | |
| run: | | |
| docker_tag=$(cat openvino/.github/dockerfiles/docker_tag) | |
| echo "docker_tag=$docker_tag" >> $GITHUB_OUTPUT | |
| genai_build_cmake: | |
| name: Build Archive - ${{ matrix.build-type }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-type: [Release] | |
| needs: [ openvino_download ] | |
| timeout-minutes: 45 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING | |
| env: | |
| CMAKE_GENERATOR: Unix Makefiles | |
| OV_INSTALL_DIR: ${{ github.workspace }}/ov | |
| INSTALL_DIR: ${{ github.workspace }}/install | |
| INSTALL_TOOLS_DIR: ${{ github.workspace }}/tools | |
| INSTALL_TESTS_DIR: ${{ github.workspace }}/tests | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| SRC_DIR: ${{ github.workspace }}/src | |
| MANIFEST_PATH: ${{ github.workspace }}/manifest.yml | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download OpenVINO package | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: ${{ needs.openvino_download.outputs.ov_artifact_name }} | |
| path: ${{ env.OV_INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Generate product manifest | |
| id: create_manifest | |
| uses: openvinotoolkit/openvino/.github/actions/create_manifest@master | |
| with: | |
| repos: ${{ env.SRC_DIR }} | |
| product_type: ${{ env.BASE_PRODUCT_TYPE }}_${{ matrix.build-type }} | |
| target_arch: 'x86_64' | |
| build_type: ${{ matrix.build-type }} | |
| save_to: ${{ env.MANIFEST_PATH }} | |
| - name: CMake Build | |
| run: | | |
| apt update | |
| apt install -y libgtk2.0-dev pkg-config ffmpeg libavformat-dev libavcodec-dev libswscale-dev libavutil-dev | |
| source ${{ env.OV_INSTALL_DIR }}/setupvars.sh | |
| cmake -DOpenVINODeveloperPackage_DIR=${{ env.OV_INSTALL_DIR }}/developer_package/cmake \ | |
| -DENABLE_PYTHON=OFF \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -S ${{ env.SRC_DIR }} \ | |
| -B ${{ env.BUILD_DIR }} | |
| cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose | |
| # Need to remove the default Python 3.11 in /venv from the Path so that CMake uses the correct one from newly created venv$py_version | |
| export PATH=${PATH/:\/venv\/bin/} | |
| for py_version in "3.10" "3.11" "3.12" "3.13" | |
| do | |
| rm -rf ${{ env.BUILD_DIR }}/CMakeCache.txt | |
| echo "Creating venv for python$py_version" | |
| python$py_version -m venv venv$py_version | |
| source venv$py_version/bin/activate | |
| echo "PATH: $PATH" | |
| echo "Configuring cmake for python$py_version" | |
| cmake -DOpenVINODeveloperPackage_DIR=${{ env.OV_INSTALL_DIR }}/developer_package/cmake \ | |
| -DENABLE_PYTHON=ON \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -S ${{ env.SRC_DIR }} \ | |
| -B ${{ env.BUILD_DIR }} | |
| echo "Configuring cmake done for python$py_version" | |
| cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose | |
| cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }} | |
| deactivate | |
| done | |
| cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_TOOLS_DIR }} --component tools_bin | |
| cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_TESTS_DIR }} --component tests | |
| - name: Pack Artifacts | |
| run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/${{ env.GENAI_ARCHIVE_NAME }} | |
| working-directory: ${{ env.INSTALL_DIR }} | |
| - name: Upload Archive Distribution Package | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_archive_${{ matrix.build-type }} | |
| path: ${{ env.BUILD_DIR }}/${{ env.GENAI_ARCHIVE_NAME }} | |
| if-no-files-found: 'error' | |
| - name: Upload Tools | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_tools_${{ matrix.build-type }} | |
| path: ${{ env.INSTALL_TOOLS_DIR }} | |
| if-no-files-found: 'error' | |
| - name: Upload Tests | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_tests_${{ matrix.build-type }} | |
| path: ${{ env.INSTALL_TESTS_DIR }} | |
| if-no-files-found: 'error' | |
| - name: Upload manifest | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: manifest_${{ matrix.build-type }} | |
| path: ${{ env.MANIFEST_PATH }} | |
| if-no-files-found: 'error' | |
| genai_build_wheels: | |
| name: Build Tokenizers & WWB Wheels | |
| needs: [ openvino_download ] | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING | |
| env: | |
| CMAKE_GENERATOR: Ninja | |
| OV_INSTALL_DIR: ${{ github.workspace }}/ov | |
| INSTALL_DIR: ${{ github.workspace }}/install | |
| WHEELS_DIR: ${{ github.workspace }}/install/wheels | |
| SRC_DIR: ${{ github.workspace }}/src | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download OpenVINO package | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: ${{ needs.openvino_download.outputs.ov_artifact_name }} | |
| path: ${{ env.OV_INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Build Tokenizers Wheel | |
| run: | | |
| python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} \ | |
| --config-settings='override=wheel.build_tag="${{ github.run_number }}"' \ | |
| --config-settings=override=cross.arch="manylinux_2_31_x86_64" \ | |
| --config-settings=cmake.args="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache" \ | |
| ${{ needs.openvino_download.outputs.ov_wheel_source }} \ | |
| ${{ env.SRC_DIR }}/thirdparty/openvino_tokenizers | |
| working-directory: ${{ env.OV_INSTALL_DIR }} | |
| - name: Build WWB Wheel | |
| run: python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} ${{ env.SRC_DIR }}/tools/who_what_benchmark | |
| working-directory: ${{ env.OV_INSTALL_DIR }} | |
| - name: Upload Wheels | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_wheels | |
| path: ${{ env.INSTALL_DIR }} | |
| if-no-files-found: 'error' | |
| genai_build_genai_wheel: | |
| name: Build GenAI Wheel - Python ${{ matrix.python-version }} | |
| needs: [ openvino_download ] | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-8-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING | |
| env: | |
| CMAKE_GENERATOR: Ninja | |
| OV_INSTALL_DIR: ${{ github.workspace }}/ov | |
| INSTALL_DIR: ${{ github.workspace }}/install | |
| WHEELS_DIR: ${{ github.workspace }}/install/wheels | |
| SRC_DIR: ${{ github.workspace }}/src | |
| OpenVINODeveloperPackage_DIR: ${{ github.workspace }}/ov/developer_package/cmake | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download OpenVINO package | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: ${{ needs.openvino_download.outputs.ov_artifact_name }} | |
| path: ${{ env.OV_INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Set CI environment | |
| id: create_manifest | |
| uses: openvinotoolkit/openvino/.github/actions/create_manifest@master | |
| with: | |
| repos: ${{ env.SRC_DIR }} | |
| product_type: ${{ env.BASE_PRODUCT_TYPE }}_Release | |
| target_arch: 'x86_64' | |
| build_type: Release | |
| save_to: ${{ github.workspace }} | |
| - name: Clean sccache stats | |
| run: ${SCCACHE_PATH} --zero-stats | |
| - name: Build GenAI Wheel | |
| run: | | |
| python_exec_path=$(python${{ matrix.python-version }} -c "import sys; print(sys.executable)") | |
| $python_exec_path -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} \ | |
| --config-settings=override=cross.arch="manylinux_2_31_x86_64" \ | |
| --config-settings=cmake.args="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache" \ | |
| ${{ needs.openvino_download.outputs.ov_wheel_source }} \ | |
| ${{ env.SRC_DIR }} | |
| working-directory: ${{ env.OV_INSTALL_DIR }} | |
| - name: Show sccache stats | |
| run: ${SCCACHE_PATH} --show-stats | |
| - name: Upload GenAI Wheel | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_wheel_python_${{ matrix.python-version }} | |
| path: ${{ env.INSTALL_DIR }} | |
| if-no-files-found: 'error' | |
| store_artifacts: | |
| name: Store build artifacts | |
| strategy: | |
| matrix: | |
| build-type: [Release] | |
| needs: [openvino_download, genai_build_wheels, genai_build_genai_wheel, genai_build_cmake] | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-medium | |
| container: | |
| image: openvinogithubactions.azurecr.io/library/python:3.12-slim | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| env: | |
| CPACK_PATH: ${{ github.workspace }}/ov_genai | |
| CPACK_PACKAGE: ${{ github.workspace }}/ov_genai.tar.gz | |
| WHEEL_PACKAGE: ${{ github.workspace }}/wheels | |
| MANIFEST_PATH: ${{ github.workspace }}/manifest.yml | |
| steps: | |
| - name: Download genai package | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: ${{ env.GENAI_ARCHIVE_ARTIFACT_BASE_NAME }}_${{ matrix.build-type }} | |
| path: ${{ env.CPACK_PATH }} | |
| - name: Pack Artifacts | |
| run: tar -czvf ${{ env.CPACK_PACKAGE }} * | |
| working-directory: ${{ env.CPACK_PATH }} | |
| - name: Download manifest and wheels | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| pattern: '{genai_wheels,genai_wheel_python_*,manifest_${{ matrix.build-type }}}' | |
| path: ${{ github.workspace }} | |
| merge-multiple: true | |
| - name: Store ${{ matrix.build_type }} artifacts to a shared drive | |
| id: store_artifacts | |
| if: ${{ always() }} | |
| uses: openvinotoolkit/openvino/.github/actions/store_artifacts@master | |
| with: | |
| artifacts: | | |
| ${{ env.CPACK_PACKAGE }} | |
| ${{ env.WHEEL_PACKAGE }} | |
| ${{ env.MANIFEST_PATH }} | |
| storage_dir: ${{ env.BASE_PRODUCT_TYPE }}_${{ matrix.build-type }} | |
| storage_root: ${{ env.ARTIFACTS_SHARE }} | |
| product_name: ${{ github.event.repository.name }} | |
| genai_build_samples: | |
| name: Build Samples - ${{ matrix.build-type }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-type: [Release] | |
| needs: [ openvino_download, genai_build_cmake ] | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING | |
| env: | |
| CMAKE_GENERATOR: Unix Makefiles | |
| OV_INSTALL_DIR: ${{ github.workspace }}/ov | |
| INSTALL_DIR: ${{ github.workspace }}/install | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| SRC_DIR: ${{ github.workspace }}/src | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download Build Artifacts | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_archive_${{ matrix.build-type }}}" | |
| path: ${{ env.OV_INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Extract Artifacts | |
| run: pigz -dc ${{ env.GENAI_ARCHIVE_NAME }} | tar -xf - -C ${{ env.OV_INSTALL_DIR }} | |
| working-directory: ${{ env.OV_INSTALL_DIR }} | |
| - name: Build Samples (Release) | |
| if: ${{ 'Release' == matrix.build-type }} | |
| run: | | |
| chmod +x ${{ env.OV_INSTALL_DIR }}/samples/cpp/build_samples.sh | |
| ${{ env.OV_INSTALL_DIR }}/samples/cpp/build_samples.sh -i ${{ env.INSTALL_DIR }} | |
| chmod +x ${{ env.OV_INSTALL_DIR }}/samples/c/build_samples.sh | |
| ${{ env.OV_INSTALL_DIR }}/samples/c/build_samples.sh -i ${{ env.INSTALL_DIR }} | |
| - name: Build Samples (${{ matrix.build-type }}) | |
| if: ${{ 'Release' != matrix.build-type }} | |
| run: | | |
| source ${{ env.OV_INSTALL_DIR }}/setupvars.sh | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -S ${{ env.OV_INSTALL_DIR }}/samples/cpp/ -B ${{ env.BUILD_DIR }} | |
| cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) | |
| cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --component samples_bin --prefix ${{ env.INSTALL_DIR }} | |
| - name: Pack Artifacts | |
| run: tar -cvf - * | pigz > ${{ env.INSTALL_DIR }}/${{ env.GENAI_SAMPLES_NAME }} | |
| working-directory: ${{ env.INSTALL_DIR }} | |
| - name: Upload Samples Build Package | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_samples_${{ matrix.build-type }} | |
| path: ${{ env.INSTALL_DIR }}/*.tar.gz | |
| if-no-files-found: 'error' | |
| genai_build_nodejs: | |
| name: Build Node.js bindings | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-type: [Release] | |
| needs: [ openvino_download ] | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING | |
| env: | |
| SRC_DIR: ${{ github.workspace }}/openvino.genai | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| INSTALL_DIR: ${{ github.workspace }}/openvino.genai/src/js/bin | |
| OV_INSTALL_DIR: ${{ github.workspace }}/ov | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: recursive | |
| path: ${{ env.SRC_DIR }} | |
| - name: Download OpenVINO package | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: ${{ needs.openvino_download.outputs.ov_artifact_name }} | |
| path: ${{ env.OV_INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Build GenAI Node.js bindings | |
| run: | | |
| source ${{ env.OV_INSTALL_DIR }}/setupvars.sh | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -DENABLE_JS=ON -DCPACK_GENERATOR=NPM \ | |
| -DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF \ | |
| -S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }} | |
| cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose | |
| cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }} | |
| - name: Upload Node.js bindings Build Package | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: genai_nodejs_bindings | |
| path: ${{ env.INSTALL_DIR }} | |
| if-no-files-found: 'error' | |
| genai_tests_wheel: | |
| name: Python (${{ matrix.test.name}}) Tests (wheel) | |
| needs: [ smart_ci, openvino_download, genai_build_wheels, genai_build_genai_wheel ] | |
| timeout-minutes: ${{ matrix.test.timeout }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: | |
| - name: 'Whisper' | |
| # TODO: skip some tests temporary untill https://github.com/huggingface/datasets/issues/7647 dataset is fixed | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py ./tests/python_tests/test_whisper_pipeline_static.py -k "not test_smoke[sample_from_dataset0 and not test_whisper_constructors[sample_from_dataset0 and not test_max_new_tokens[sample_from_dataset0 and not test_language_mode[language and not test_task_mode[sample_from_dataset0 and not test_language_autodetect[sample_from_dataset0 and not test_whisper_config_constructor and not test_language_autodetect[sample_from_dataset1 and not test_language_autodetect[sample_from_dataset2 and not test_initial_prompt_hotwords[sample_from_dataset0 and not test_random_sampling[sample_from_dataset0"' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).whisper.test }} | |
| timeout: 45 | |
| - name: 'Cacheopt E2E (Part 1)' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_kv_cache_eviction/test_kv_cache_eviction_1.py' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test }} | |
| timeout: 180 | |
| - name: 'Cacheopt E2E (Part 2)' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_kv_cache_eviction/test_kv_cache_eviction_2.py' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test }} | |
| timeout: 360 | |
| - name: 'LLM & VLM' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_llm_pipeline.py tests/python_tests/test_llm_pipeline_static.py ./tests/python_tests/test_vlm_pipeline.py tests/python_tests/test_structured_output.py tests/python_tests/test_image_generation.py --override-ini cache_dir=/mount/caches/pytest/' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test || fromJSON(needs.smart_ci.outputs.affected_components).LLM.test || fromJSON(needs.smart_ci.outputs.affected_components).Image_generation.test }} | |
| timeout: 180 | |
| - name: 'GGUF Reader tests' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_gguf_reader.py' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).GGUF.test || fromJSON(needs.smart_ci.outputs.affected_components).LLM.test }} | |
| timeout: 360 | |
| - name: 'Tokenizer tests' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_tokenizer.py' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).tokenizers.test }} | |
| timeout: 60 | |
| - name: 'API tests' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_continuous_batching.py -k "not eagle3" ./tests/python_tests/test_generation_config.py ./tests/python_tests/test_sampling.py ./tests/python_tests/test_text_streamer.py' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test || fromJSON(needs.smart_ci.outputs.affected_components).sampling.test || fromJSON(needs.smart_ci.outputs.affected_components).text_streamer.test }} | |
| timeout: 60 | |
| - name: 'Rag tests' | |
| cmd: 'python -m pytest -v ./tests/python_tests/test_rag.py' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).RAG.test }} | |
| timeout: 30 | |
| - name: 'WWB tests' | |
| cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava"' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }} | |
| timeout: 120 | |
| - name: 'WWB tests (nanollava)' | |
| cmd: | | |
| python -m pip install transformers==4.48.0 | |
| python -m pytest -v ./tools/who_what_benchmark/tests -m nanollava | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }} | |
| timeout: 90 | |
| - name: 'EAGLE3 speculative decoding tests' | |
| cmd: | | |
| python -m pip install git+https://github.com/xufang-lisa/optimum-intel.git@ea9607daf32919024cdd4390deec9693a7b64d23 | |
| python -m pytest -v ./tests/python_tests/test_continuous_batching.py -k "eagle3" | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).speculative_decoding.test }} | |
| timeout: 90 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-8-cores-64gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e HF_TOKEN | |
| env: | |
| INSTALL_DIR: ${{ github.workspace }}/install | |
| SRC_DIR: ${{ github.workspace }}/src | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| steps: | |
| - name: Clone openvino.genai | |
| if: ${{ matrix.test.run_condition }} | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download Build Artifacts | |
| if: ${{ matrix.test.run_condition }} | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_wheels,genai_wheel_python_*}" | |
| path: ${{ env.INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Install GenAI Wheels | |
| if: ${{ matrix.test.run_condition }} | |
| uses: ./src/.github/actions/install_wheel | |
| with: | |
| packages: "openvino;openvino_tokenizers[transformers];openvino_genai;whowhatbench" | |
| requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt" | |
| local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels | |
| - name: Tests | |
| if: ${{ matrix.test.run_condition }} | |
| run: ${{ matrix.test.cmd }} | |
| working-directory: ${{ env.SRC_DIR }} | |
| genai_samples_tests: | |
| name: Samples ${{ matrix.test.name }} (${{ matrix.build-type }}) | |
| needs: [ smart_ci, openvino_download, genai_build_cmake, genai_build_wheels, genai_build_genai_wheel, genai_build_samples, genai_build_nodejs ] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-type: [Release] | |
| test: | |
| - name: 'LLM' | |
| marker: 'llm' | |
| cmd: 'tests/python_tests/samples' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM_samples.test }} | |
| runner: 'aks-linux-4-cores-16gb' | |
| - name: 'Whisper' | |
| marker: 'whisper' | |
| cmd: 'tests/python_tests/samples' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).Whisper_samples.test }} | |
| runner: 'aks-linux-4-cores-16gb' | |
| - name: 'dreamlike_anime_1_0' | |
| marker: 'dreamlike_anime_1_0' | |
| cmd: 'tests/python_tests/samples' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).Image_generation_samples.test }} | |
| runner: 'aks-linux-8-cores-32gb' | |
| - name: 'LCM_Dreamshaper_v7_int8_ov' | |
| marker: 'LCM_Dreamshaper_v7_int8_ov' | |
| cmd: 'tests/python_tests/samples' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).Image_generation_samples.test }} | |
| runner: 'aks-linux-4-cores-16gb' | |
| - name: 'VLM' | |
| marker: 'vlm' | |
| cmd: 'tests/python_tests/samples' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).VLM_samples.test }} | |
| runner: 'aks-linux-8-cores-64gb' | |
| - name: 'Rag' | |
| marker: 'rag' | |
| cmd: 'tests/python_tests/samples' | |
| runner: 'aks-linux-4-cores-16gb' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).RAG_samples.test }} | |
| - name: 'Speech generation' | |
| marker: 'speech_generation' | |
| cmd: 'tests/python_tests/samples' | |
| runner: 'aks-linux-4-cores-16gb' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).Speech_generation_samples.test }} | |
| - name: 'Eagle3 decoding' | |
| marker: 'eagle3_decoding' | |
| cmd: 'tests/python_tests/samples' | |
| runner: 'aks-linux-4-cores-16gb' | |
| run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).speculative_decoding.test }} | |
| timeout-minutes: 120 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: ${{ matrix.test.runner }} | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e HF_TOKEN | |
| env: | |
| INSTALL_DIR: ${{ github.workspace }}/ov | |
| SRC_DIR: ${{ github.workspace }}/src | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| # The debug logging includes messages about the time it takes to read the GGUF model. | |
| # These messages differ from run to run, so we cannot compare the results of the CPP, Python, and JavaScript parts. | |
| OPENVINO_LOG_LEVEL: 1 | |
| steps: | |
| - name: Clone openvino.genai | |
| if: ${{ matrix.test.run_condition }} | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download Build Artifacts | |
| if: ${{ matrix.test.run_condition }} | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_archive_${{ matrix.build-type }},genai_samples_${{ matrix.build-type }},genai_wheels,genai_wheel_python_*}" | |
| path: ${{ env.INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Download GenAI JS Bildings Artifacts | |
| if: ${{ matrix.test.run_condition }} | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: genai_nodejs_bindings | |
| path: ${{ env.SRC_DIR }}/src/js/bin | |
| merge-multiple: true | |
| - name: Extract Artifacts | |
| if: ${{ matrix.test.run_condition }} | |
| run: | | |
| pigz -dc ${{ env.GENAI_ARCHIVE_NAME }} | tar -xf - -C ${{ env.INSTALL_DIR }} | |
| pigz -dc ${{ env.GENAI_SAMPLES_NAME }} | tar -xf - -C ${{ env.INSTALL_DIR }} | |
| working-directory: ${{ env.INSTALL_DIR }} | |
| - name: Install GenAI wheels | |
| if: ${{ matrix.test.run_condition }} | |
| uses: ./src/.github/actions/install_wheel | |
| with: | |
| packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]" | |
| requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt" | |
| local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels | |
| - name: Setup Node | |
| if: ${{ matrix.test.run_condition }} | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: 21 | |
| - name: Install GenAI NPM package | |
| if: ${{ matrix.test.run_condition }} | |
| working-directory: ${{ env.SRC_DIR }}/src/js | |
| run: | | |
| npm install ${{ env.INSTALL_DIR }}/openvino_node_npm_package/openvino-node-* --ignore-scripts | |
| cp -R ${{ env.INSTALL_DIR }}/openvino_node_npm_package/bin node_modules/openvino-node/bin | |
| npm install --verbose | |
| - name: Install NPM dependencies for samples | |
| if: ${{ matrix.test.run_condition }} | |
| working-directory: ${{ env.SRC_DIR }}/samples/js/text_generation | |
| run: | | |
| npm install ${{ env.SRC_DIR }}/src/js | |
| npm install --verbose | |
| - name : Install specific optimum-intel for eagle3 samples | |
| if: ${{ matrix.test.marker == 'eagle3_decoding' && matrix.test.run_condition }} | |
| run: | | |
| python -m pip install git+https://github.com/xufang-lisa/optimum-intel.git@ea9607daf32919024cdd4390deec9693a7b64d23 | |
| - name: Test Samples (Python and C++) | |
| if: ${{ matrix.test.run_condition }} | |
| run: python -m pytest -vvs ${{ env.SRC_DIR }}/${{ matrix.test.cmd }} -m "${{ matrix.test.marker }}" | |
| env: | |
| LD_LIBRARY_PATH: "${{ env.INSTALL_DIR }}/runtime/lib/intel64:${{ env.INSTALL_DIR }}/runtime/3rdparty/tbb/lib:$LD_LIBRARY_PATH" # Required for C++ samples | |
| SAMPLES_PY_DIR: "${{ env.INSTALL_DIR }}/samples/python" | |
| SAMPLES_JS_DIR: "${{ env.SRC_DIR }}/samples/js" | |
| SAMPLES_CPP_DIR: "${{ env.INSTALL_DIR }}/samples_bin" | |
| SAMPLES_C_DIR: "${{ env.INSTALL_DIR }}/samples_bin" | |
| genai_tools_tests: | |
| name: Tools ${{ matrix.build-type }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-type: [Release] | |
| needs: [ smart_ci, openvino_download, genai_build_cmake, genai_build_wheels, genai_build_genai_wheel ] | |
| if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).llm_bench || fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching }} | |
| timeout-minutes: 90 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e HF_TOKEN | |
| env: | |
| INSTALL_DIR: ${{ github.workspace }}/ov | |
| SRC_DIR: ${{ github.workspace }}/src | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download Build Artifacts | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_archive_${{ matrix.build-type }},genai_tools_${{ matrix.build-type }},genai_tests_${{ matrix.build-type }},genai_wheels,genai_wheel_python_*}" | |
| path: ${{ env.INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Extract Artifacts | |
| run: | | |
| pigz -dc ${{ env.GENAI_ARCHIVE_NAME }} | tar -xf - -C ${{ env.INSTALL_DIR }} | |
| working-directory: ${{ env.INSTALL_DIR }} | |
| - name: Fix C++ samples permissions | |
| run: chmod +x ${{ env.INSTALL_DIR }}/samples_bin/* | |
| - name: Install GenAI wheels | |
| uses: ./src/.github/actions/install_wheel | |
| with: | |
| packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]" | |
| requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt;${{ env.SRC_DIR }}/tools/llm_bench/requirements.txt" | |
| local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels | |
| - name: gtests unit tests | |
| if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching }} | |
| run: | | |
| source ${{ env.INSTALL_DIR }}/setupvars.sh | |
| chmod +x ${{ env.INSTALL_DIR }}/tests/tests_continuous_batching | |
| ${{ env.INSTALL_DIR }}/tests/tests_continuous_batching --gtest_filter="-AddSecondInputTest.*" | |
| - name: Test Continuous Batching Tools | |
| if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching }} | |
| run: | | |
| source ${{ env.INSTALL_DIR }}/setupvars.sh | |
| python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_continuous_batching_tools.py -m "samples" | |
| env: | |
| SAMPLES_CPP_DIR: "${{ env.INSTALL_DIR }}/samples_bin" | |
| - name: Test LLM Benchmark Tools | |
| if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).llm_bench }} | |
| run: | | |
| source ${{ env.INSTALL_DIR }}/setupvars.sh | |
| python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_tools_llm_benchmark.py -m "samples" | |
| env: | |
| SAMPLES_PY_DIR: "${{ env.SRC_DIR }}/tools" | |
| genai_nodejs_tests: | |
| name: Node.js bindings tests | |
| needs: [ smart_ci, openvino_download, genai_build_nodejs ] | |
| if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).JS_API }} | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e HF_TOKEN | |
| env: | |
| OV_INSTALL_DIR: ${{ github.workspace }}/ov | |
| SRC_DIR: ${{ github.workspace }}/openvino.genai | |
| INSTALL_DIR: ${{ github.workspace }}/openvino.genai/src/js/bin | |
| NODE_VERSION: 21 | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download OpenVINO Artifacts | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: ${{ needs.openvino_download.outputs.ov_artifact_name }} | |
| path: ${{ env.OV_INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Download GenAI JS Bildings Artifacts | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| name: genai_nodejs_bindings | |
| path: ${{ env.INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: Setup Node ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| # JS pacakges uses the OpenVINO and OpenVINO GenAI libraries from the bin directory. | |
| # Here we emulate the installation of the openvino-node package from NPM. The latest | |
| # release of the openvino-node package is installed, and we need to update the binaries | |
| # in the node_modules/openvino-node/bin directory to work correctly with GenAI | |
| - name: Install npm package tests dependencies | |
| working-directory: ${{ env.SRC_DIR }}/src/js | |
| run: | | |
| npm install ${{ env.OV_INSTALL_DIR }}/openvino_node_npm_package/openvino-node-* --ignore-scripts | |
| cp -R ${{ env.OV_INSTALL_DIR }}/openvino_node_npm_package/bin node_modules/openvino-node/bin | |
| npm install --verbose | |
| - name: Check lint | |
| working-directory: ${{ env.SRC_DIR }}/src/js | |
| run: npm run lint | |
| - name: Run npm package tests | |
| working-directory: ${{ env.SRC_DIR }}/src/js | |
| run: npm test | |
| genai_xgrammar_off_tests: | |
| name: Build & Test when ENABLE_XGRAMMAR=OFF | |
| needs: [smart_ci, openvino_download, genai_build_wheels] | |
| timeout-minutes: 45 | |
| defaults: | |
| run: | |
| shell: bash | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }} | |
| volumes: | |
| - /mount:/mount | |
| - ${{ github.workspace }}:${{ github.workspace }} | |
| options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING | |
| env: | |
| CMAKE_GENERATOR: Unix Makefiles | |
| INSTALL_DIR: ${{ github.workspace }}/ov | |
| SRC_DIR: ${{ github.workspace }}/src | |
| BUILD_DIR: ${{ github.workspace }}/build_xgrammar | |
| steps: | |
| - name: Clone openvino.genai | |
| uses: actions/[email protected] | |
| with: | |
| path: ${{ env.SRC_DIR }} | |
| submodules: recursive | |
| - name: Download Build Artifacts | |
| uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 | |
| with: | |
| pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_wheels}" | |
| path: ${{ env.INSTALL_DIR }} | |
| merge-multiple: true | |
| - name: CMake Build without XGrammar | |
| run: | | |
| source ${{ env.INSTALL_DIR }}/setupvars.sh | |
| cmake -DOpenVINODeveloperPackage_DIR=${{ env.INSTALL_DIR }}/developer_package/cmake \ | |
| -DENABLE_PYTHON=ON \ | |
| -DENABLE_XGRAMMAR=OFF \ | |
| -BUILD_TOKENIZERS=OFF \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -S ${{ env.SRC_DIR}} \ | |
| -B ${{ env.BUILD_DIR }} | |
| cmake --build ${{ env.BUILD_DIR}} --config Release --parallel $(nproc) --target py_openvino_genai --verbose | |
| - name: Install dependencies | |
| uses: ./src/.github/actions/install_wheel | |
| with: | |
| packages: openvino;openvino_tokenizers[transformers] | |
| requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt" | |
| local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels | |
| - name: Run test_llm_pipeline.py when -DENABLE_XGRAMMAR=OFF | |
| env: | |
| PYTHONPATH: "${{ env.BUILD_DIR }}:" | |
| run: | | |
| source ${{ env.INSTALL_DIR }}/setupvars.sh | |
| python3 -m pytest -v ${{ env.SRC_DIR }}/tests/python_tests/test_llm_pipeline.py -k "not test_perf_metrics_with_structured_output" | |
| Overall_Status: | |
| name: ci/gha_overall_status_linux | |
| needs: [smart_ci, openvino_download, genai_build_cmake, genai_build_wheels, genai_build_genai_wheel, genai_build_samples, genai_build_nodejs, genai_tests_wheel, genai_samples_tests, genai_tools_tests, genai_nodejs_tests, genai_xgrammar_off_tests] | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check status of all jobs | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') || | |
| contains(needs.*.result, 'cancelled') | |
| }} | |
| run: exit 1 |