Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[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.py
index 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.py
index 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 = None
repositories = []
ov_version = None
trigger_repo = None
@@ -95,6 +95,7 @@ def generate_manifest(repos: list, product_type: str, event_type: str, build_typ
ov_version = parse_ov_version(version_file)
if repo.trigger:
trigger_repo = repo
+ component_name = repo.name
custom_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.yml
index 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: false
trigger_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.py
index 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_path
storage = Path(args.storage_root) / normalized_path
else:
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.yml
index 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: false
trigger_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.py
index 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()]].value
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"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 structure
if 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 branch
if 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)