Skip to content

Commit

Permalink
Merge branch 'master' into akup/py-op-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mlukasze authored Dec 10, 2024
2 parents 7a473f0 + 67f2537 commit cae438b
Show file tree
Hide file tree
Showing 580 changed files with 14,829 additions and 6,302 deletions.
6 changes: 3 additions & 3 deletions .github/actions/cache/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/actions/openvino_provider/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ runs:
else
ov_package_url=$(curl -s ${{ inputs.nightly_package_source }} | jq -r '.${{ inputs.platform }}_${{ inputs.arch }}')
fi
cd ${{ inputs.install_dir || env.GITHUB_WORKSPACE }}
cd ${{ inputs.install_dir || github.workspace }}
package_basename=$(basename $ov_package_url)
wget $ov_package_url --progress=bar:force:noscroll -O $package_basename
package_folder=${package_basename%.*}
Expand All @@ -196,7 +196,7 @@ runs:
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ steps.openvino_s3_download.outputs.ov_artifact_name }}
path: ${{ steps.openvino_s3_download.outputs.ov_package_path }}
path: ${{ github.workspace }}/${{ steps.openvino_s3_download.outputs.ov_package_path }}
if-no-files-found: 'error'

- name: Get wheel
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/openvino_provider/get_s3_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def main(product, version_pattern, platform, arch, folder):
matching_files = filter_files_by_criteria(all_files, product, version_pattern, platform, arch, folder)
if matching_files:
logger.info(f"Matching packages: {sorted(matching_files)}")
if len(matching_files) > 1:
custom_release_build_pattern = fr".*/{version_pattern}/(linux_|windows_|macos_).*/.*"
# Exclude custom release builds, if any, from matches
matching_files = [file for file in matching_files if not re.search(custom_release_build_pattern, file)]
package_url = f"https://storage.openvinotoolkit.org{sorted(matching_files)[-1]}"
logger.info(f"Returning package URL: {package_url}")
action_utils.set_github_output("package_url", package_url)
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/debian_10_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-16-cores-arm-docker-build
runs-on: aks-linux-4-cores-8gb-arm-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
volumes:
Expand All @@ -75,7 +75,7 @@ jobs:
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-arm'
runner: 'aks-linux-16-cores-32gb-arm'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.debian_10_arm }}", "volumes": ["/mount:/mount"], "options": "-e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING"}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_cxx_unit_tests.yml
with:
runner: 'aks-linux-16-cores-arm'
runner: 'aks-linux-8-cores-16gb-arm'
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.debian_10_arm }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
os: 'debian_10'
Expand All @@ -116,6 +116,8 @@ jobs:
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_cpu_functional_tests.yml
with:
# Additional investigation needed why CPU functional tests are failing on v6 VM size's version,
# so leave it as it is for now
runner: 'aks-linux-16-cores-arm'
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.debian_10_arm }}
python-version: '3.7'
Expand Down
142 changes: 142 additions & 0 deletions .github/workflows/job_python_api_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Python API tests

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}'
python-version:
description: 'Python version to setup. E.g., "3.11"'
type: string
required: true

permissions: read-all

env:
PIP_CACHE_PATH: /mount/caches/pip/linux

jobs:
Python_Unit_Tests:
name: Python API tests
timeout-minutes: 30
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_REPO: ${{ github.workspace }}/openvino
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/openvino_tests
INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/openvino_wheels
steps:
- name: Download OpenVINO artifacts (tarballs and wheels)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: openvino_@(wheels|tests)
path: ${{ env.INSTALL_DIR }}

# Needed as ${{ github.workspace }} is not working correctly when using Docker
- name: Setup Variables
run: |
echo "OPENVINO_REPO=$GITHUB_WORKSPACE/openvino" >> "$GITHUB_ENV"
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/openvino_tests" >> "$GITHUB_ENV"
echo "INSTALL_WHEELS_DIR=$GITHUB_WORKSPACE/install/openvino_wheels" >> "$GITHUB_ENV"
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install pigz

- name: Extract OpenVINO packages
run: pigz -dc openvino_tests.tar.gz | tar -xf - -C ${INSTALL_TEST_DIR}
working-directory: ${{ env.INSTALL_TEST_DIR }}

- name: Fetch setup_python and install wheels actions
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
sparse-checkout: |
.github/actions/setup_python/action.yml
.github/actions/install_ov_wheels/action.yml
sparse-checkout-cone-mode: false
path: 'action_root'

- name: Setup Python ${{ inputs.python-version }}
uses: ./action_root/.github/actions/setup_python
with:
version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }}
should-setup-pip-paths: ${{ runner.os == 'Linux' }}
self-hosted-runner: ${{ runner.os == 'Linux' }}

#
# Tests
#
- name: Install OpenVINO Python wheels
uses: ./action_root/.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_WHEELS_DIR }}
wheels-to-install: 'openvino'

- name: Install Python API tests dependencies
run: python3 -m pip install -r ${INSTALL_TEST_DIR}/tests/bindings/python/requirements_test.txt

#
# Tests
#

- name: Python API Tests
run: |
# for 'template' extension
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}/tests/:$LD_LIBRARY_PATH
python3 -m pytest -sv ${INSTALL_TEST_DIR}/tests/pyopenvino \
--junitxml=${INSTALL_TEST_DIR}/TEST-Pyngraph.xml \
--ignore=${INSTALL_TEST_DIR}/tests/pyopenvino/tests/test_utils/test_utils.py
- name: Python API Tests -- numpy>=2.0.0
run: |
python3 -m pip uninstall -y numpy
python3 -m pip install "numpy~=2.0.0"
python3 -m pip install -r ${INSTALL_TEST_DIR}/tests/bindings/python/requirements_test.txt
# for 'template' extension
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}/tests/:$LD_LIBRARY_PATH
python3 -m pytest -sv ${INSTALL_TEST_DIR}/tests/pyopenvino \
--junitxml=${INSTALL_TEST_DIR}/TEST-Pyngraph_new_numpy.xml \
--ignore=${INSTALL_TEST_DIR}/tests/pyopenvino/tests/test_utils/test_utils.py
- name: Clone API snippets
if: runner.os != 'macOS'
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
sparse-checkout: docs/articles_en/assets/snippets
path: ${{ env.OPENVINO_REPO }}
submodules: 'false'

- name: Docs Python snippets
if: runner.os != 'macOS'
run: |
# torch, onnx
python3 -m pip install -r ${INSTALL_TEST_DIR}/tests/python/preprocess/torchvision/requirements.txt -r ${INSTALL_TEST_DIR}/tests/requirements_onnx
# to find 'snippets' module in docs
export PYTHONPATH=${OPENVINO_REPO}/docs/articles_en/assets
# for 'template' extension
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}/tests/:$LD_LIBRARY_PATH
python3 ${OPENVINO_REPO}/docs/articles_en/assets/snippets/main.py
- name: Upload Test Results
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ !cancelled() }}
with:
name: test-results-python-api-${{ inputs.python-version }}
path: |
${{ env.INSTALL_TEST_DIR }}/TEST*.html
${{ env.INSTALL_TEST_DIR }}/TEST*.xml
if-no-files-found: 'warn'
54 changes: 8 additions & 46 deletions .github/workflows/job_python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,22 @@ jobs:
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV"
echo "LAYER_TESTS_INSTALL_DIR=$GITHUB_WORKSPACE/install/tests/layer_tests" >> "$GITHUB_ENV"
echo "INSTALL_WHEELS_DIR=$GITHUB_WORKSPACE/install/wheels" >> "$GITHUB_ENV"
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install pigz

- name: Extract OpenVINO packages
run: |
pigz -dc openvino_tests.tar.gz | tar -xf - -C ${INSTALL_DIR}
run: pigz -dc openvino_tests.tar.gz | tar -xf - -C ${INSTALL_DIR}
working-directory: ${{ env.INSTALL_DIR }}

- name: Fetch setup_python action
- name: Fetch setup_python and install wheels actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: |
.github/actions/setup_python/action.yml
.github/actions/install_ov_wheels/action.yml
sparse-checkout-cone-mode: false
path: 'action_root'

Expand All @@ -92,11 +93,10 @@ jobs:
self-hosted-runner: ${{ runner.os == 'Linux' }}

- name: Install OpenVINO Python wheels
run: |
# Install the core OV wheel
python3 -m pip install ./openvino-*.whl
working-directory: ${{ env.INSTALL_WHEELS_DIR }}
uses: ./action_root/.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_WHEELS_DIR }}
wheels-to-install: 'openvino'

- name: Install Python API tests dependencies
run: |
Expand All @@ -121,15 +121,6 @@ jobs:
# Tests
#

- name: Python API Tests
if: ${{ fromJSON(inputs.affected-components).Python_API.test }}
run: |
# for 'template' extension
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH
python3 -m pytest -sv ${INSTALL_TEST_DIR}/pyopenvino \
--junitxml=${INSTALL_TEST_DIR}/TEST-Pyngraph.xml \
--ignore=${INSTALL_TEST_DIR}/pyopenvino/tests/test_utils/test_utils.py
- name: Python ONNX operators tests
if: (fromJSON(inputs.affected-components).Python_API.test ||
fromJSON(inputs.affected-components).ONNX_FE.test) &&
Expand Down Expand Up @@ -185,35 +176,6 @@ jobs:
TEST_DEVICE: CPU
TEST_PRECISION: FP16

- name: Clone API snippets
if: runner.os != 'macOS'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: docs/articles_en/assets/snippets
path: ${{ env.OPENVINO_REPO }}
submodules: 'false'

- name: Docs Python snippets
if: runner.os != 'macOS'
run: |
# to find 'snippets' module in docs
export PYTHONPATH=${OPENVINO_REPO}/docs/articles_en/assets
# for 'template' extension
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH
python3 ${OPENVINO_REPO}/docs/articles_en/assets/snippets/main.py
- name: Python API Tests -- numpy>=2.0.0
if: ${{ fromJSON(inputs.affected-components).Python_API.test }}
run: |
python3 -m pip uninstall -y numpy
python3 -m pip install "numpy>=2.0.0,<2.2.0"
python3 -m pip install -r ${INSTALL_TEST_DIR}/bindings/python/requirements_test.txt
# for 'template' extension
export LD_LIBRARY_PATH=${INSTALL_TEST_DIR}:$LD_LIBRARY_PATH
python3 -m pytest -sv ${INSTALL_TEST_DIR}/pyopenvino \
--junitxml=${INSTALL_TEST_DIR}/TEST-Pyngraph.xml \
--ignore=${INSTALL_TEST_DIR}/pyopenvino/tests/test_utils/test_utils.py
- name: Upload Test Results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ !cancelled() }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/job_samples_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV"
echo "BUILD_DIR=$GITHUB_WORKSPACE/build" >> "$GITHUB_ENV"
echo "INSTALL_WHEELS_DIR=$GITHUB_WORKSPACE/install/wheels" >> "$GITHUB_ENV"
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
Expand All @@ -65,13 +66,12 @@ jobs:
pigz -dc openvino_tests.tar.gz | tar -xf - -C ${INSTALL_DIR}
working-directory: ${{ env.INSTALL_DIR }}

- name: Fetch setup_python action
# Python is already installed on Ubuntu within Dockerfile
if: runner.os != 'Linux'
- name: Fetch setup_python and install wheels actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: |
.github/actions/setup_python/action.yml
.github/actions/install_ov_wheels/action.yml
sparse-checkout-cone-mode: false
path: 'openvino'

Expand Down Expand Up @@ -113,6 +113,12 @@ jobs:
# Tests
#

- name: Install OpenVINO Python wheels
uses: ./openvino/.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_WHEELS_DIR }}
wheels-to-install: 'openvino'

- name: Samples tests
if: fromJSON(inputs.affected-components).samples.test
run: |
Expand All @@ -122,7 +128,7 @@ jobs:
export SHARE=$INSTALL_TEST_DIR/smoke_tests/samples_smoke_tests_data
# Install Python benchmark_app by installing openvino-*.whl
python3 -m pip install --ignore-installed PyYAML -r $INSTALL_TEST_DIR/smoke_tests/requirements.txt $INSTALL_WHEELS_DIR/openvino-*.whl
python3 -m pip install --ignore-installed PyYAML -r $INSTALL_TEST_DIR/smoke_tests/requirements.txt
export LD_LIBRARY_PATH=${IE_APP_PATH}:$LD_LIBRARY_PATH
source ${INSTALL_DIR}/setupvars.sh
Expand Down
Loading

0 comments on commit cae438b

Please sign in to comment.