OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[CI] [GHA] Python API tests on Manylinux (#27597)
Andrei Kashchikhin695ba0f9d3f6
diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tagindex 3783a7e8d56..bcfa07fb5c2 100644--- a/.github/dockerfiles/docker_tag+++ b/.github/dockerfiles/docker_tag@@ -1 +1 @@-pr-27430+pr-27597diff --git a/.github/dockerfiles/ov_test/debian_10_py310/Dockerfile b/.github/dockerfiles/ov_test/debian_10_py310/Dockerfilenew file mode 100644index 00000000000..e7dbadf5a41--- /dev/null+++ b/.github/dockerfiles/ov_test/debian_10_py310/Dockerfile@@ -0,0 +1,76 @@+ARG REGISTRY="docker.io"+FROM ${REGISTRY}/library/debian:10.13++USER root++# APT configuration+RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \+ echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \+ echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \+ echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf++ENV DEBIAN_FRONTEND="noninteractive" \+ TZ="Europe/London"++RUN apt-get update && \+ apt-get install \+ git \+ libc6-dev \+ # parallel gzip+ pigz \+ # Python+ python3 \+ python3-pip \+ python3-dev \+ python3-venv \+ python3-distutils \+ # To build Python 3.10 from source+ build-essential \+ libffi-dev \+ libgdbm-dev \+ libc6-dev \+ libssl-dev \+ zlib1g-dev \+ libbz2-dev \+ libreadline-dev \+ libsqlite3-dev \+ libncurses5-dev \+ libncursesw5-dev \+ xz-utils \+ tk-dev \+ libxml2-dev \+ libxmlsec1-dev \+ liblzma-dev \+ wget \+ curl \+ && \+ rm -rf /var/lib/apt/lists/*++# Install openvino dependencies+ADD scripts/install_dependencies/install_openvino_dependencies.sh /install_openvino_dependencies.sh+RUN chmod +x /install_openvino_dependencies.sh && \+ /install_openvino_dependencies.sh && \+ rm -rf /var/lib/apt/lists/*++# Setup Python 3.10+RUN wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tar.xz++RUN tar -xf Python-3.10.9.tar.xz && \+ cd Python-3.10.9 && \+ ./configure --enable-optimizations && \+ make -j 8 && \+ make altinstall++# Setup pip+ENV PIP_VERSION="24.0"+RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \+ python3.10 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \+ rm -f get-pip.py++# Use Python 3.10 as default instead of Python 3.7+# Using venv here 'cause other methods to switch the default Python on Ubuntu 20 break both system and wheels build+RUN python3.10 -m venv venv+ENV PATH="/venv/bin:$PATH"++ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}+ENV PIP_INSTALL_PATH=/venv/lib/python3.10/site-packagesdiff --git a/.github/dockerfiles/ov_test/fedora_33/Dockerfile b/.github/dockerfiles/ov_test/fedora_33/Dockerfileindex c059c82c7d3..6e0fcc7d351 100644--- a/.github/dockerfiles/ov_test/fedora_33/Dockerfile+++ b/.github/dockerfiles/ov_test/fedora_33/Dockerfile@@ -6,7 +6,13 @@ USER rootRUN yum update -y && yum install -y \git \curl \- python3+ python3 \+ findutils \+ ocl-icd \+ ocl-icd-devel \+ # parallel gzip+ pigz \+ xz# Install NodeENV NODE_VERSION=21.7.3diff --git a/.github/dockerfiles/ov_test/ubuntu_20_04_x64_py313/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_20_04_x64_py313/Dockerfilenew file mode 100644index 00000000000..b6b99f81305--- /dev/null+++ b/.github/dockerfiles/ov_test/ubuntu_20_04_x64_py313/Dockerfile@@ -0,0 +1,52 @@+ARG REGISTRY="docker.io"+FROM ${REGISTRY}/library/ubuntu:20.04++USER root++# APT configuration+RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \+ echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \+ echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \+ echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf++ENV DEBIAN_FRONTEND="noninteractive" \+ TZ="Europe/London"++RUN apt-get update && \+ apt-get install software-properties-common && \+ add-apt-repository --yes --no-update ppa:git-core/ppa && \+ add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \+ apt-get update && \+ apt-get install \+ curl \+ git \+ gpg-agent \+ tzdata \+ # parallel gzip+ pigz \+ # Python+ python3.13-dev \+ python3.13-venv \+ && \+ rm -rf /var/lib/apt/lists/*++# Install openvino dependencies+ADD scripts/install_dependencies/install_openvino_dependencies.sh /install_openvino_dependencies.sh+RUN chmod +x /install_openvino_dependencies.sh && \+ /install_openvino_dependencies.sh && \+ rm -rf /var/lib/apt/lists/*++# Setup pip+ENV PIP_VERSION="24.0"+RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \+ python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \+ python3.13 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \+ rm -f get-pip.py++# Use Python 3.13 as default instead of Python 3.8+# Using venv here 'cause other methods to switch the default Python on Ubuntu 20 break both system and wheels build+RUN python3.13 -m venv venv+ENV PATH="/venv/bin:$PATH"++ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}+ENV PIP_INSTALL_PATH=/venv/lib/python3.13/site-packagesdiff --git a/.github/workflows/manylinux_2014.yml b/.github/workflows/manylinux_2014.ymlindex bd5da965226..aa0b06b6cf0 100644--- a/.github/workflows/manylinux_2014.yml+++ b/.github/workflows/manylinux_2014.yml@@ -69,6 +69,11 @@ jobs:images: |ov_build/ubuntu_22_04_x64_dockerov_build/manylinux2014_x86_64+ ov_test/ubuntu_20_04_x64_py313+ ov_test/ubuntu_22_04_x64+ ov_test/ubuntu_24_04_x64+ ov_test/fedora_33+ ov_test/debian_10_py310registry: 'openvinogithubactions.azurecr.io'dockerfiles_root_dir: '.github/dockerfiles'changed_components: ${{ needs.smart_ci.outputs.changed_components }}@@ -92,6 +97,7 @@ jobs:OPENVINO_REPO: ${{ github.workspace }}/srcINSTALL_DIR: ${{ github.workspace }}/install/openvinoINSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels+ INSTALL_TEST_DIR: ${{ github.workspace }}/install/testsBUILD_DIR: ${{ github.workspace }}/buildDOCKER_CONFIG: "/mount/.docker"CMAKE_CXX_COMPILER_LAUNCHER: sccache@@ -135,6 +141,7 @@ jobs:-v ${{ env.OPENVINO_REPO }}:/work/src \-v ov_build_cache:/work/build \-v ${{ env.INSTALL_DIR }}:/work/install \+ -v ${{ env.INSTALL_TEST_DIR }}:/work/api_tests \-e SCCACHE_AZURE_BLOB_CONTAINER \-e SCCACHE_AZURE_CONNECTION_STRING \-e SCCACHE_SERVER_PORT \@@ -148,16 +155,18 @@ jobs:-w /work/src \${{ fromJSON(needs.docker.outputs.images).ov_build.manylinux2014_x86_64 }} \/bin/bash -c "- cmake -DENABLE_CPPLINT=OFF -DENABLE_NCC_STYLE=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF -S /work/src -B /work/build &&+ python3.12 -m pip install -r /work/src/src/bindings/python/wheel/requirements-dev.txt+ cmake -DPython3_EXECUTABLE=/usr/local/bin/python3.12 -DENABLE_CPPLINT=OFF -DENABLE_NCC_STYLE=OFF -DENABLE_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_OV_TF_FRONTEND=OFF -DENABLE_OV_TF_LITE_FRONTEND=OFF -DENABLE_OV_PADDLE_FRONTEND=OFF -DENABLE_OV_PYTORCH_FRONTEND=ON -DENABLE_OV_JAX_FRONTEND=OFF -DENABLE_OV_ONNX_FRONTEND=ON -DENABLE_PYTHON=ON -DENABLE_WHEEL=ON -S /work/src -B /work/build &&cmake --build /work/build --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} &&cmake --install /work/build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /work/install+ cmake --install /work/build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /work/api_tests --component tests"- name: Pack Artifactsrun: mkdir -p ${{ env.BUILD_DIR }} && tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_package.tar.gzworking-directory: ${{ env.INSTALL_DIR }}- - name: Build Python API(Python 3.9-3.13)+ - name: Build Python API (Python 3.9-3.13)run: |SUPPORTED_PYTHON_VERSIONS=("39" "310" "311" "312" "313")for PY_VER in "${SUPPORTED_PYTHON_VERSIONS[@]}"; do@@ -190,6 +199,10 @@ jobs:"done+ - name: Pack openvino_tests+ run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_tests.tar.gz+ working-directory: ${{ env.INSTALL_TEST_DIR }}+## Upload build artifacts#@@ -208,7 +221,15 @@ jobs:name: openvino_wheelspath: ${{ env.INSTALL_WHEELS_DIR }}/wheels/*.whlif-no-files-found: 'error'-++ - name: Upload openvino tests package+ if: ${{ always() }}+ uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3+ with:+ name: openvino_tests+ path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gz+ if-no-files-found: 'error'+- name: Store artifacts to a shared driveid: store_artifactsif: ${{ always() }}@@ -220,10 +241,34 @@ jobs:${{ env.INSTALL_WHEELS_DIR }}/wheelsstorage_dir: ${{ env.PRODUCT_TYPE }}storage_root: ${{ env.ARTIFACTS_SHARE }}-++ Python_API_Tests:+ name: Python API tests+ needs: [ Docker, Build, Smart_CI ]+ uses: ./.github/workflows/job_python_api_tests.yml+ strategy:+ fail-fast: false+ matrix:+ include:+ - python-version: "3.9"+ image: ${{ fromJSON(needs.docker.outputs.images).ov_test.fedora_33 }}+ - python-version: "3.10"+ image: ${{ fromJSON(needs.docker.outputs.images).ov_test.debian_10_py310 }}+ - python-version: "3.11"+ image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64 }}+ - python-version: "3.12"+ image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}+ - python-version: "3.13"+ image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_x64_py313 }}+ with:+ runner: 'aks-linux-4-cores-16gb'+ container: '{"image": "${{ matrix.image }}", "volumes": ["/mount:/mount"]}'+ python-version: ${{ matrix.python-version }}+ if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test+Overall_Status:name: ci/gha_overall_status_manylinux2014- needs: [Smart_CI, Build]+ needs: [Smart_CI, Build, Python_API_Tests]if: ${{ always() }}runs-on: ubuntu-lateststeps: