Skip to content

Commit

Permalink
Merge branch 'master' into an/new_deconv_slt
Browse files Browse the repository at this point in the history
  • Loading branch information
allnes authored Jan 22, 2024
2 parents f518342 + 92cc4f5 commit 0c74c3f
Show file tree
Hide file tree
Showing 1,934 changed files with 15,859 additions and 43,584 deletions.
4 changes: 4 additions & 0 deletions .github/actions/smart-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
commit_sha:
description: "GitHub commit hash. Used if no PR number is set"
required: false
ref_name:
description: "GitHub ref name"
required: false
component_pattern:
description: "Pattern to extract component name from PR label. If not set, any label is considered a component name"
required: false
Expand Down Expand Up @@ -88,6 +91,7 @@ runs:
python ${{ github.action_path }}/smart_ci.py \
$([[ -n "${{ inputs.pr }}" ]] && echo '--pr ${{ inputs.pr }}' || echo '-s ${{ inputs.commit_sha }}') \
-r ${{ inputs.repository }} \
-f "${{ inputs.ref_name }}" \
-p "${{ inputs.component_pattern }}" \
-c "${{ inputs.components_config }}" \
-m "${{ inputs.components_config_schema }}" \
Expand Down
36 changes: 30 additions & 6 deletions .github/actions/smart-ci/smart_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,26 @@ def get_changed_component_names(pr, all_possible_components: set, component_patt
return components


def get_changeset(gh_api, pr, target_branch, commit_sha):
"""Returns changeset either from PR or commit"""
if pr:
return gh_api.pulls.list_files(pr)
if target_branch:
target_branch_head_commit = gh_api.repos.get_branch(target_branch).commit.sha
# In merge-queue branch all commits between head of target branch and head of current branch (commit_sha)
# contain changes added to queue earlier to be validated together. Getting all of them + changes from
# commit_sha below
changed_files = gh_api.repos.compare_commits(f'{target_branch_head_commit}...{commit_sha}').get('files', [])
return changed_files
raise ValueError(f'Either "pr" or "target_branch" parameter must be non-empty')


def parse_args():
parser = argparse.ArgumentParser(description='Returns product components changed in a given PR or commit')
parser.add_argument('--pr', type=int, required=False, help='PR number. If not set, --commit is used')
parser.add_argument('-s', '--commit-sha', required=False, help='Commit SHA. If not set, --pr is used')
parser.add_argument('-r', '--repo', help='GitHub repository')
parser.add_argument('-f', '--ref_name', required=False, help='GitHub ref name')
parser.add_argument('-p', '--pattern', default=None, help='Pattern to extract component name from PR label. '
'If not set, any label is considered a component name')
parser.add_argument('-c', '--components-config', default='.github/components.yml',
Expand Down Expand Up @@ -172,18 +187,27 @@ def main():
component_name = component_name_from_label(label, args.pattern)
all_possible_components.add(component_name if component_name else label)

no_match_files_changed = False
run_full_scope = False
# For now, we don't want to apply smart ci rules for post-commits
is_postcommit = not pr
if is_postcommit:

merge_queue_prefix = 'gh-readonly-queue/'
is_merge_queue = args.ref_name.startswith(merge_queue_prefix)
merge_queue_target_branch = re.findall(f'^{merge_queue_prefix}(.*)/', args.ref_name)[0] if is_merge_queue else None

if is_merge_queue:
logger.info(f"The run is a merge-queue run, executing full validation scope for all components, if "
f"not all queued changes match patterns in 'skip-when-only-listed-files-changed'")
run_full_scope = True
elif is_postcommit:
logger.info(f"The run is a post-commit run, executing full validation scope for all components")
run_full_scope = True
else:
no_match_files_changed = 'no-match-files' in [label.name for label in pr.labels]
if no_match_files_changed:
logger.info(f"There are changed files that don't match any pattern in labeler config, "
f"executing full validation scope for all components")

run_full_scope = is_postcommit or no_match_files_changed
run_full_scope = True

# In post-commits - validate all components regardless of changeset
# In pre-commits - validate only changed components with their dependencies
Expand All @@ -197,15 +221,15 @@ def main():
affected_components = cfg.get_affected_components(changed_component_names)

skip_workflow = False
if args.pr and not run_full_scope:
if is_merge_queue or (args.pr and not run_full_scope):
if args.skip_when_only_listed_labels_set:
excepted_labels = set(args.skip_when_only_listed_labels_set.split(','))
excepted_labels_only = changed_component_names - excepted_labels == set()
skip_workflow = excepted_labels_only

if not skip_workflow and args.skip_when_only_listed_files_changed:
# To avoid spending extra API requests running step below only if necessary
changed_files = gh_api.pulls.list_files(args.pr)
changed_files = get_changeset(gh_api, args.pr, merge_queue_target_branch, args.commit_sha)
patterns = set(args.skip_when_only_listed_files_changed.split(','))

matched_files_only = all(any(fnmatch(f.filename, pattern) for pattern in patterns) for f in changed_files)
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/android_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down Expand Up @@ -125,7 +126,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

#
# Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: ./openvino/.github/actions/setup_python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
with:
config-file: './.github/dependency_review.yml'
3 changes: 2 additions & 1 deletion .github/workflows/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Install python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_cpu_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
fi
python3 ${PARALLEL_TEST_SCRIPT} -e ${INSTALL_TEST_DIR}/ov_cpu_func_tests -c ${PARALLEL_TEST_CACHE} -w ${INSTALL_TEST_DIR} -s suite -rf 0 -- --gtest_print_time=1 --gtest_filter=*smoke*
timeout-minutes: 20
timeout-minutes: 25

- name: Save tests execution time
uses: actions/cache/save@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_onnx_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
python3 -m pip install pytest-xdist[psutil] pytest-forked
- name: ONNX Models Tests
run: python3 -m pytest --backend="CPU" --model_zoo_dir="${MODELS_SHARE_PATH}" ${INSTALL_TEST_DIR}/onnx/tests/tests_python/test_zoo_models.py -v -n 12 --forked -k 'not _cuda' --model_zoo_xfail
run: python3 -m pytest --backend="CPU" --model_zoo_dir="${MODELS_SHARE_PATH}" ${INSTALL_TEST_DIR}/onnx/tests/tests_python/test_zoo_models.py -v -n auto --forked -k 'not _cuda' --model_zoo_xfail
14 changes: 5 additions & 9 deletions .github/workflows/job_onnx_runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ jobs:
popd
- name: Install OpenVINO dependencies
run: ${INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -y
run: |
${INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -y
# since we are on Ubuntu 22.04, but compiled OpenVINO on Ubuntu 20.04, we need to install `libtbb2`
apt-get install --assume-yes --no-install-recommends libtbb2
- name: Clone ONNX Runtime
run: |
Expand All @@ -97,7 +100,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Build Lin ONNX Runtime
run: |
Expand Down Expand Up @@ -139,13 +142,6 @@ jobs:
./onnxruntime_global_thread_pools_test
working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo

# Test removed in onnxruntime 1.16.2
# - name: Run onnxruntime_api_tests_without_env
# run: |
# source ${INSTALL_DIR}/setupvars.sh
# ./onnxruntime_api_tests_without_env
# working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo

- name: Run pytorch-converted tests
run: |
source ${INSTALL_DIR}/setupvars.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ jobs:
run: |
# requires 'unit_tests' from 'mo'
export PYTHONPATH=${INSTALL_TEST_DIR}/mo
python3 -m pytest ${LAYER_TESTS_INSTALL_DIR}/tensorflow_tests/ --use_new_frontend -m precommit_tf_fe --junitxml=${INSTALL_TEST_DIR}/TEST-tf_fe.xml
python3 -m pytest ${LAYER_TESTS_INSTALL_DIR}/tensorflow_tests/ --use_new_frontend -m precommit_tf_fe -n logical --junitxml=${INSTALL_TEST_DIR}/TEST-tf_fe.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION: FP16
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: ./openvino/.github/actions/setup_python
Expand Down Expand Up @@ -406,14 +407,16 @@ jobs:

ONNX_Runtime:
name: ONNX Runtime Integration
if: fromJSON(needs.smart_ci.outputs.affected_components).ONNX_RT ||
fromJSON(needs.smart_ci.outputs.affected_components).ONNX_FE
# Enable back once https://github.com/microsoft/onnxruntime/pull/19184 is merged
if: ${{ 'false' }}
# if: fromJSON(needs.smart_ci.outputs.affected_components).ONNX_RT ||
# fromJSON(needs.smart_ci.outputs.affected_components).ONNX_FE
needs: [ Build, Smart_CI ]
uses: ./.github/workflows/job_onnx_runtime.yml
with:
runner: 'aks-linux-16-cores-32gb'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"], "options": "-e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING"}'
sccache-azure-key-prefix: 'ubuntu20_x86_64_onnxruntime'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:22.04", "volumes": ["/mount:/mount"], "options": "-e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING"}'
sccache-azure-key-prefix: 'ubuntu22_x86_64_onnxruntime'

ONNX_Models:
name: ONNX Models Tests
Expand Down Expand Up @@ -562,7 +565,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Install CUDA
run: |
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: ./openvino/.github/actions/setup_python
Expand Down Expand Up @@ -307,14 +308,16 @@ jobs:

ONNX_Runtime:
name: ONNX Runtime Integration
if: fromJSON(needs.smart_ci.outputs.affected_components).ONNX_RT ||
fromJSON(needs.smart_ci.outputs.affected_components).ONNX_FE
# Enable back once https://github.com/microsoft/onnxruntime/pull/19184 is merged
if: ${{ 'false' }}
# if: fromJSON(needs.smart_ci.outputs.affected_components).ONNX_RT ||
# fromJSON(needs.smart_ci.outputs.affected_components).ONNX_FE
needs: [ Build, Smart_CI ]
uses: ./.github/workflows/job_onnx_runtime.yml
with:
runner: 'aks-linux-16-cores-arm'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"], "options": "-e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING"}'
sccache-azure-key-prefix: 'ubuntu20_aarch64_onnxruntime'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:22.04", "volumes": ["/mount:/mount"], "options": "-e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING"}'
sccache-azure-key-prefix: 'ubuntu22_aarch64_onnxruntime'

CXX_Unit_Tests:
name: C++ unit tests
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down Expand Up @@ -111,7 +112,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: ./openvino/.github/actions/setup_python
Expand Down Expand Up @@ -150,6 +151,7 @@ jobs:
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
-DENABLE_PROFILING_ITT=ON \
-DSELECTIVE_BUILD=COLLECT \
-DENABLE_DEBUG_CAPS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
-S ${OPENVINO_REPO} \
Expand Down Expand Up @@ -200,7 +202,7 @@ jobs:
pushd ${INSTALL_TEST_DIR}
tar -czvf ${BUILD_DIR}/openvino_tests.tar.gz \
tests/ov_cpu_func_tests \
tests/libtemplate_extension.so \
tests/libopenvino_template_extension.so \
tests/functional_test_utils/layer_tests_summary/*
popd
Expand Down Expand Up @@ -289,7 +291,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"
#
# Build
#
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux_riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
- name: Install sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
version: "v0.7.5"

- name: emcmake cmake - configure
run: |
Expand Down
Loading

0 comments on commit 0c74c3f

Please sign in to comment.