diff --git a/.github/actions/smart-ci/components_schema.yml b/.github/actions/smart-ci/components_schema.yml index 7e9d0e4483d..69387d54469 100644 --- a/.github/actions/smart-ci/components_schema.yml +++ b/.github/actions/smart-ci/components_schema.yml @@ -16,16 +16,22 @@ definitions: '$ref': '#/definitions/component_name' revalidate: - type: array - uniqueItems: true - items: - '$ref': '#/definitions/component_name' + oneOf: + - type: array + uniqueItems: true + items: + '$ref': '#/definitions/component_name' + - type: string + enum: ['all'] build: - type: array - uniqueItems: true - items: - '$ref': '#/definitions/component_name' + oneOf: + - type: array + uniqueItems: true + items: + '$ref': '#/definitions/component_name' + - type: string + enum: ['all'] propertyNames: # Validates component names '$ref': '#/definitions/component_name' diff --git a/.github/actions/smart-ci/smart_ci.py b/.github/actions/smart-ci/smart_ci.py index 24028d4540c..664e5b85b5c 100644 --- a/.github/actions/smart-ci/smart_ci.py +++ b/.github/actions/smart-ci/smart_ci.py @@ -17,27 +17,21 @@ class ComponentConfig: self.config = config self.log = logging.getLogger(self.__class__.__name__) self.all_defined_components = set(self.config.keys()) # already defined in components.yml - self.all_possible_components = all_possible_components # can be added to components.yml (based on labeler.yml) + # can be added to components.yml (based on labeler.yml) + self.all_possible_components = all_possible_components.union(self.all_defined_components) + self.validate(schema) - self.validate(schema, all_possible_components) - - def validate(self, schema: dict, all_possible_components: set) -> None: + def validate(self, schema: dict) -> None: """Validates syntax of configuration file""" jsonschema.validate(self.config, schema) - invalid_components = self.all_defined_components.difference(all_possible_components) - if invalid_components: - error_msg = f"components are invalid: " \ - f"{invalid_components} are not listed in labeler config: {all_possible_components}" - raise jsonschema.exceptions.ValidationError(error_msg) - for component_name, data in self.config.items(): dependent_components = set(data.get('dependent_components', dict()).keys()) if data else set() - invalid_dependents = dependent_components.difference(all_possible_components) + invalid_dependents = dependent_components.difference(self.all_possible_components) if invalid_dependents: error_msg = f"dependent_components of {component_name} are invalid: " \ - f"{invalid_dependents} are not listed in components config: {all_possible_components}" + f"{invalid_dependents} are not listed in components config: {self.all_possible_components}" raise jsonschema.exceptions.ValidationError(error_msg) def get_affected_components(self, changed_components_names: set) -> dict: @@ -57,6 +51,8 @@ class ComponentConfig: for name in changed_components_names: component_scopes = {k: v for k, v in self.config.get(name, dict()).items() if k in self.ScopeKeys} for key, dependents in component_scopes.items(): + if dependents == 'all': + dependents = self.all_possible_components for dep_name in dependents: affected_components[dep_name] = affected_components.get(dep_name, set()) scope = self.FullScope if key == 'revalidate' else {key} @@ -184,6 +180,7 @@ def main(): all_defined_components = components_config.keys() changed_component_names = set(all_defined_components) if run_full_scope else \ get_changed_component_names(pr, all_possible_components, args.pattern) + logger.info(f"changed_component_names: {changed_component_names}") cfg = ComponentConfig(components_config, schema, all_possible_components) diff --git a/.github/actions/smart-ci/smart_ci_test.py b/.github/actions/smart-ci/smart_ci_test.py index 2c9aa1e4644..da11fc7ca83 100644 --- a/.github/actions/smart-ci/smart_ci_test.py +++ b/.github/actions/smart-ci/smart_ci_test.py @@ -193,6 +193,22 @@ class TestComponentConfig(unittest.TestCase): } self.validate(config_data, changed_components, expected_result) + def test_all_as_dependents(self): + config_data = { + 'comp1': {'build': 'all', 'revalidate': {}}, + 'comp2': {'build': {}, 'revalidate': {}}, + 'comp3': {'build': {}, 'revalidate': {}}, + 'comp4': {'build': {}, 'revalidate': {}}, + } + changed_components = {'comp1'} + expected_result = { + 'comp1': ComponentConfig.FullScope, + 'comp2': {'build'}, + 'comp3': {'build'}, + 'comp4': {'build'}, + } + self.validate(config_data, changed_components, expected_result) + if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/.github/components.yml b/.github/components.yml index 4e147b726b8..9b337ba767f 100644 --- a/.github/components.yml +++ b/.github/components.yml @@ -3,6 +3,7 @@ CPU: - C_API - Python_API - samples + - ONNX_RT build: - HETERO - AUTO_BATCH @@ -63,6 +64,7 @@ TEMPLATE: - AUTO - C_API - Python_API + - NVIDIA build: - IR_FE @@ -163,6 +165,7 @@ IE_Tests: - AUTO_BATCH - TEMPLATE - AUTO + - NVIDIA build: - IR_FE @@ -189,3 +192,23 @@ docs: licensing: revalidate: [] build: [] + +NVIDIA: + revalidate: [] + build: [] + +ONNX_RT: + revalidate: [] + build: [] + +Core: + revalidate: 'all' + +transformations: + revalidate: 'all' + +preprocessing: + revalidate: 'all' + +inference: + revalidate: 'all' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7200e7431d0..d2058bf41ca 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -524,7 +524,7 @@ jobs: ONNX_Runtime: name: ONNX Runtime Integration - needs: Build + needs: [Build, Smart_CI] timeout-minutes: 10 defaults: run: @@ -546,6 +546,7 @@ jobs: ONNX_RUNTIME_REPO: /__w/openvino/openvino/onnxruntime ONNX_RUNTIME_UTILS: /__w/openvino/openvino/install/onnxruntime ONNX_RUNTIME_BUILD_DIR: /__w/openvino/openvino/onnxruntime/build + if: fromJSON(needs.smart_ci.outputs.affected_components).ONNX_RT steps: - name: Fetch install_build_dependencies.sh and setup_python action @@ -1453,7 +1454,7 @@ jobs: NVIDIA_Plugin: name: NVIDIA plugin - needs: Build + needs: [Build, Smart_CI] timeout-minutes: 15 defaults: run: @@ -1477,9 +1478,9 @@ jobs: NVIDIA_BUILD_DIR: /__w/openvino/openvino/nvidia_plugin_build DEBIAN_FRONTEND: 'noninteractive' SCCACHE_AZURE_KEY_PREFIX: ubuntu20_x86_64_Release + if: fromJSON(needs.smart_ci.outputs.affected_components).NVIDIA steps: - - name: Fetch install_build_dependencies.sh uses: actions/checkout@v4 with: