Skip to content

Commit

Permalink
Merge branch 'master' into gha/cache_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov authored Sep 25, 2024
2 parents f318226 + 2659786 commit f4eec73
Show file tree
Hide file tree
Showing 53 changed files with 370 additions and 133 deletions.
5 changes: 5 additions & 0 deletions .github/actions/smart-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ inputs:
description: "Comma-separated list of patterns (fnmatch-style). If PR has only matching files changed,
return indicator that CI can be skipped"
required: false
enable_for_org:
description: "Enables running workflows for a given organization; triggers from other orgs are skipped"
required: false
default: "openvinotoolkit"

outputs:
all_components:
Expand Down Expand Up @@ -99,6 +103,7 @@ runs:
-c "${{ inputs.components_config }}" \
-m "${{ inputs.components_config_schema }}" \
-l "${{ inputs.labeler_config }}" \
--enable_for_org "${{ inputs.enable_for_org }}" \
--skip-when-only-listed-labels-set "${{ inputs.skip_when_only_listed_labels_set }}" \
--skip-when-only-listed-files-changed "${{ inputs.skip_when_only_listed_files_changed }}"
shell: bash
Expand Down
11 changes: 11 additions & 0 deletions .github/actions/smart-ci/smart_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import os
import re
import argparse
import sys

import yaml
import json
import jsonschema
Expand Down Expand Up @@ -146,6 +148,8 @@ def parse_args():
parser.add_argument('--skip-when-only-listed-files-changed',
help="Comma-separated list of patterns (fnmatch-style). If PR has only matching files changed, "
"return indicator that CI can be skipped")
parser.add_argument('--enable_for_org', default='openvinotoolkit',
help='Enable running workflows for a given organization; triggers from other orgs are skipped')
args = parser.parse_args()
return args

Expand Down Expand Up @@ -176,6 +180,13 @@ def main():
components_config = yaml.safe_load(config)

owner, repository = args.repo.split('/')

if owner != args.enable_for_org:
logger.info(f"Running workflows is enabled only for repos in {args.enable_for_org} organization. "
f"The current workflow was initiated from other org: {owner}, skipping")
set_github_output("skip_workflow", "True")
sys.exit(0)

gh_api = GhApi(owner=owner, repo=repository, token=os.getenv("GITHUB_TOKEN"))
pr = gh_api.pulls.get(args.pr) if args.pr else None

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand Down Expand Up @@ -95,7 +96,6 @@ jobs:
VCPKG_DEFAULT_BINARY_CACHE: '/mount/caches/ccache/android_arm64/vcpkg_cache'
VCPKG_FORCE_SYSTEM_BINARIES: '1'
SCCACHE_AZURE_KEY_PREFIX: android_arm64
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand Down Expand Up @@ -94,7 +95,6 @@ jobs:
ANDROID_SDK_VERSION: 29
ANDROID_ABI_CONFIG: x86_64
SCCACHE_AZURE_KEY_PREFIX: android_x64
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/assign_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
permissions:
issues: write
timeout-minutes: 10
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: take an issue
uses: bdougie/take-action@1439165ac45a7461c2d89a59952cd7d941964b87 # v1.6.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ permissions: read-all
jobs:
Build_Doc:
runs-on: ubuntu-20.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check_pr_commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ permissions: read-all
jobs:
Checks:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cleanup_caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
Cleanup_PIP:
name: Cleanup PIP cache
runs-on: aks-linux-2-cores-8gb
if: ${{ github.repository_owner == 'openvinotoolkit' }}
container:
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
volumes:
Expand All @@ -38,6 +39,7 @@ jobs:
Cleanup_ccache_lin:
name: Cleanup Linux ccache
runs-on: aks-linux-2-cores-8gb
if: ${{ github.repository_owner == 'openvinotoolkit' }}
container:
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
volumes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/code_snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
matrix:
os: ['ubuntu-22.04', 'macos-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
if: ${{ github.repository_owner == 'openvinotoolkit' }}
container:
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/debian_10_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-16-cores-arm-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dependency_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ permissions: read-all
jobs:
dependency-review:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fedora_29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand All @@ -71,7 +72,6 @@ jobs:

Build:
needs: [Docker, Smart_CI]
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/files_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions: read-all
jobs:
Check_Files_Size:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-16-cores-arm-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand All @@ -75,7 +76,6 @@ jobs:

Build:
needs: [ Docker, Smart_CI ]
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-arm'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand Down Expand Up @@ -104,7 +105,7 @@ jobs:
SELECTIVE_BUILD_STAT_DIR: /__w/openvino/openvino/selective_build_stat
MODELS_PATH: /__w/openvino/openvino/testdata
SCCACHE_AZURE_KEY_PREFIX: ubuntu22_x86_64_itt_clang_Release_faster_build
if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }}
if: ${{ github.event_name != 'merge_group' }}

steps:
- name: Clone OpenVINO
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linux_riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
Docker:
needs: Smart_CI
runs-on: aks-linux-4-cores-16gb-docker-build
if: "!needs.smart_ci.outputs.skip_workflow"
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
volumes:
Expand Down Expand Up @@ -88,7 +89,7 @@ jobs:
CCACHE_TEMPDIR: /__w/openvino/openvino/ccache_temp
CCACHE_MAXSIZE: 2G

if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }}
if: ${{ github.event_name != 'merge_group' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
if: ${{ github.repository_owner == 'openvinotoolkit' }}
container:
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
volumes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install
BUILD_DIR: ${{ github.workspace }}/build
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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 @@ -78,6 +78,7 @@ jobs:
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install
BUILD_DIR: ${{ github.workspace }}/build
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ permissions: read-all
jobs:
Pylint-UT:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ovc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ permissions: read-all
jobs:
Pylint-UT:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/py_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ permissions: read-all
jobs:
linters:
runs-on: ubuntu-20.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/send_workflows_to_opentelemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
otel-export-trace:
name: Export finished workflow metrics
runs-on: aks-linux-2-cores-8gb
if: github.repository == 'openvinotoolkit/openvino'
if: ${{ github.repository_owner == 'openvinotoolkit' }}

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stale_prs_and_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand All @@ -77,7 +78,6 @@ jobs:

Build:
needs: [Docker, Smart_CI]
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand All @@ -80,7 +81,6 @@ jobs:

Build:
needs: [Docker, Smart_CI]
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_22_dpcpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand All @@ -66,7 +67,6 @@ jobs:

Build:
needs: [Docker, Smart_CI]
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand All @@ -74,7 +75,6 @@ jobs:

Build:
needs: [Docker, Smart_CI]
if: "!needs.smart_ci.outputs.skip_workflow"
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:

Docker:
needs: Smart_CI
if: "!needs.smart_ci.outputs.skip_workflow"
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
Expand Down Expand Up @@ -88,7 +89,6 @@ jobs:
OPENVINO_REPO: /__w/openvino/openvino/openvino
OPENVINO_BUILD_DIR: /__w/openvino/openvino/openvino_build
SCCACHE_AZURE_KEY_PREFIX: webassembly_Release
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/workflow_rerunner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ permissions: read-all
jobs:
rerun:
name: Rerun Workflow
if: ${{ github.event.workflow_run.conclusion == 'failure' }} # Run only for the failed workflows
# Run only for the failed workflows in openvinotoolkit org
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.repository_owner == 'openvinotoolkit' }}
runs-on: aks-linux-2-cores-8gb
permissions:
actions: write
Expand Down
Loading

0 comments on commit f4eec73

Please sign in to comment.