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
[GHA] Separate folder structure for artifacts from different repos (#29635)
Alina Kladievaf366baf3cfd6
diff --git a/.github/actions/common/artifact_utils.py b/.github/actions/common/artifact_utils.pyindex 8584d71e673..62cf6c61472 100644--- a/.github/actions/common/artifact_utils.py+++ b/.github/actions/common/artifact_utils.py@@ -16,6 +16,8 @@ def add_common_args(parser: argparse.ArgumentParser):default=os.getenv('GITHUB_EVENT_NAME'))parser.add_argument('--storage_root', help='Root path of the artifacts storage', required=False,default=os.getenv('ARTIFACTS_SHARE'))+ parser.add_argument('-n', '--product_name', required=False, default='dldt',+ help='Product name for which artifacts are generated')group = parser.add_mutually_exclusive_group(required=True)group.add_argument('-d', '--storage_dir', help='Subdirectory name for artifacts, same as product type',choices=[product_type.value for product_type in ProductType], type=str.lower)diff --git a/.github/actions/create_manifest/create_manifest.py b/.github/actions/create_manifest/create_manifest.pyindex 5231d5cca2a..4ac62918e99 100644--- a/.github/actions/create_manifest/create_manifest.py+++ b/.github/actions/create_manifest/create_manifest.py@@ -82,7 +82,7 @@ def parse_ov_version(header_file: str | Path) -> str:def generate_manifest(repos: list, product_type: str, event_type: str, build_type: str, target_arch: str) -> Manifest:manifest = Manifest()- component_name = 'dldt' # historical, keep for internal compatibility+ component_name = Nonerepositories = []ov_version = Nonetrigger_repo = None@@ -95,6 +95,7 @@ def generate_manifest(repos: list, product_type: str, event_type: str, build_typov_version = parse_ov_version(version_file)if repo.trigger:trigger_repo = repo+ component_name = repo.namecustom_branch_name = f'-{trigger_repo.branch}' if trigger_repo.branch != 'master' else ''run_number_postfix = f'-{os.environ.get("GITHUB_RUN_NUMBER")}' if os.environ.get("GITHUB_RUN_NUMBER") else ''diff --git a/.github/actions/restore_artifacts/action.yml b/.github/actions/restore_artifacts/action.ymlindex df5b857cd93..f472e977e6d 100644--- a/.github/actions/restore_artifacts/action.yml+++ b/.github/actions/restore_artifacts/action.yml@@ -16,6 +16,9 @@ inputs:branch_name:description: "Target branch name. If not set - taken from github context"required: false+ product_name:+ description: "Product name for which artifacts are generated"+ required: falsetrigger_repo_sha:description: "Commit hash of a trigger repo. If not set - taken from github context"required: false@@ -50,6 +53,7 @@ runs:${{ inputs.unpack_archives == 'true' && '--unpack_archives' || '' }}${{ inputs.branch_name && env.BRANCH_PARAM || '' }}${{ inputs.event_name && env.EVENT_PARAM || '' }}+ ${{ inputs.product_name && env.PRODUCT_NAME_PARAM || '' }}${{ inputs.to_restore && env.TO_RESTORE || '' }}env:ACTION_PATH: ${{ runner.os == 'Windows' && '$env:GITHUB_ACTION_PATH' || '$GITHUB_ACTION_PATH' }}@@ -58,6 +62,7 @@ runs:PLATFORM_PARAM: "--platform ${{ inputs.platform }}"BRANCH_PARAM: "-b ${{ inputs.branch_name }}"EVENT_PARAM: "-e ${{ inputs.event_name }}"+ PRODUCT_NAME_PARAM: "-n ${{ inputs.product_name }}"TO_RESTORE: "-r ${{ inputs.to_restore }}"DEFAULT_TARGET_DIR: "${{ env.GITHUB_WORKSPACE }}/${{ inputs.storage_dir || inputs.platform }}"MERGE_QUEUE_BASE_REF: "${{ github.event.merge_group.base_ref }}"diff --git a/.github/actions/restore_artifacts/restore_artifacts.py b/.github/actions/restore_artifacts/restore_artifacts.pyindex 007bc56aafe..91af90baec3 100644--- a/.github/actions/restore_artifacts/restore_artifacts.py+++ b/.github/actions/restore_artifacts/restore_artifacts.py@@ -50,13 +50,14 @@ def main():if args.commit_sha == 'latest_available_commit':latest_artifacts_link = artifact_utils.get_latest_artifacts_link(storage_dir, args.storage_root,- args.branch_name, args.event_name)+ args.branch_name, args.event_name,+ args.product_name)latest_artifacts_path = PureWindowsPath(latest_artifacts_link.read_text())normalized_path = latest_artifacts_path.as_posix() if os.name == 'posix' else latest_artifacts_pathstorage = Path(args.storage_root) / normalized_pathelse:storage = artifact_utils.get_storage_dir(storage_dir, args.commit_sha, args.storage_root, args.branch_name,- args.event_name)+ args.event_name, args.product_name)action_utils.set_github_output("artifacts_storage_path", str(storage))logger.info(f"Artifacts are taken from here: {storage}")diff --git a/.github/actions/store_artifacts/action.yml b/.github/actions/store_artifacts/action.ymlindex b652f707b75..58d8454f327 100644--- a/.github/actions/store_artifacts/action.yml+++ b/.github/actions/store_artifacts/action.yml@@ -19,6 +19,9 @@ inputs:branch_name:description: "Target branch name. If not set - taken from github context"required: false+ product_name:+ description: "Product name for which artifacts are generated"+ required: falsetrigger_repo_sha:description: "Commit hash of a trigger repo. If not set - taken from github context"required: false@@ -54,10 +57,12 @@ runs:${{ inputs.storage_dir && env.STORAGE_PARAM || env.PLATFORM_PARAM }}${{ inputs.branch_name && env.BRANCH_PARAM || '' }}${{ inputs.event_name && env.EVENT_PARAM || '' }}+ ${{ inputs.product_name && env.PRODUCT_NAME_PARAM || '' }}env:ACTION_PATH: ${{ runner.os == 'Windows' && '$env:GITHUB_ACTION_PATH' || '$GITHUB_ACTION_PATH' }}BRANCH_PARAM: "-b ${{ inputs.branch_name }}"EVENT_PARAM: "-e ${{ inputs.event_name }}"STORAGE_PARAM: "--storage_dir ${{ inputs.storage_dir }}"PLATFORM_PARAM: "--platform ${{ inputs.platform }}"+ PRODUCT_NAME_PARAM: "-n ${{ inputs.product_name }}"MERGE_QUEUE_BASE_REF: ""diff --git a/.github/actions/store_artifacts/store_artifacts.py b/.github/actions/store_artifacts/store_artifacts.pyindex db71af005e2..03cc5d36273 100644--- a/.github/actions/store_artifacts/store_artifacts.py+++ b/.github/actions/store_artifacts/store_artifacts.py@@ -98,7 +98,7 @@ def main():storage_root = args.storage_root or os.getenv('ARTIFACTS_SHARE')storage_dir = args.storage_dir or PlatformMapping[PlatformKey[args.platform.upper()]].valuestorage = artifact_utils.get_storage_dir(storage_dir, args.commit_sha, args.storage_root, args.branch_name,- args.event_name)+ args.event_name, args.product_name)action_utils.set_github_output("artifacts_storage_path", str(storage))logger.info(f"Storing artifacts to {storage}")@@ -139,9 +139,11 @@ def main():file.write(workflow_link)store_checksums(workflow_link_file)+ # TODO: remove 'openvinotoolkit/openvino' condition when Tokenizers artifacts are stored in a separate structureif not error_found and os.getenv('GITHUB_REPOSITORY') == 'openvinotoolkit/openvino':latest_artifacts_for_branch = artifact_utils.get_latest_artifacts_link(storage_dir, args.storage_root,- args.branch_name, args.event_name)+ args.branch_name, args.event_name,+ args.product_name)# Overwrite path to "latest" built artifacts only if a given commit is the head of a given branchif args.event_name != 'pull_request' and args.commit_sha == os.getenv('GITHUB_SHA'):# TODO: lock to avoid corruption in case of a parallel build (unlikely event for now, but still)