Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 48 additions & 24 deletions .github/repos-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,191 +6,215 @@
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "tensile",
"url": "ROCm/Tensile",
"branch": "develop",
"category": "shared",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "origami",
"url": "ROCm/origami",
"branch": "develop",
"category": "shared",
"auto_subtree_pull": false,
"auto_subtree_push": false
"auto_subtree_push": false,
"monorepo_source_of_truth": true
},
{
"name": "mxdatagenerator",
"url": "ROCm/mxDataGenerator",
"branch": "develop",
"category": "shared",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "composablekernel",
"url": "ROCm/composable_kernel",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": true,
"auto_subtree_push": false
"auto_subtree_push": false,
"monorepo_source_of_truth": false
},
{
"name": "hipblas",
"url": "ROCm/hipBLAS",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipblas-common",
"url": "ROCm/hipBLAS-common",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipblaslt",
"url": "ROCm/hipBLASLt",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipcub",
"url": "ROCm/hipCUB",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipfft",
"url": "ROCm/hipFFT",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hiprand",
"url": "ROCm/hipRAND",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipsolver",
"url": "ROCm/hipSOLVER",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipsparse",
"url": "ROCm/hipSPARSE",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipsparselt",
"url": "ROCm/hipSPARSELt",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocblas",
"url": "ROCm/rocBLAS",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocfft",
"url": "ROCm/rocFFT",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocprim",
"url": "ROCm/rocPRIM",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocrand",
"url": "ROCm/rocRAND",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocroller",
"url": "ROCm/rocRoller",
"branch": "develop",
"category": "shared",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocsolver",
"url": "ROCm/rocSOLVER",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocsparse",
"url": "ROCm/rocSPARSE",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocthrust",
"url": "ROCm/rocThrust",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "hipdnn",
"url": "ROCm/hipDNN",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
{
"name": "rocwmma",
"url": "ROCm/rocWMMA",
"branch": "develop",
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true
"auto_subtree_push": true,
"monorepo_source_of_truth": true
}
]
}
17 changes: 6 additions & 11 deletions .github/scripts/pr_detect_changed_subtrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
--config : OPTIONAL, path to the repos-config.json file.
--require-auto-pull : If set, only include entries with auto_subtree_pull=true.
--require-auto-push : If set, only include entries with auto_subtree_push=true.
--require-monorepo-source : If set, only include entries with monorepo_source_of_truth=true.
--dry-run : If set, will only log actions without making changes.
--debug : If set, enables detailed debug logging.

Expand Down Expand Up @@ -51,27 +52,21 @@ def parse_arguments(argv: Optional[List[str]] = None) -> argparse.Namespace:
parser.add_argument("--config", required=False, default=".github/repos-config.json", help="Path to the repos-config.json file")
parser.add_argument("--require-auto-pull", action="store_true", help="Only include entries with auto_subtree_pull=true")
parser.add_argument("--require-auto-push", action="store_true", help="Only include entries with auto_subtree_push=true")
parser.add_argument("--require-monorepo-source", action="store_true", help="Only include entries with monorepo_source_of_truth=true")
parser.add_argument("--dry-run", action="store_true", help="Print results without writing to GITHUB_OUTPUT.")
parser.add_argument("--debug", action="store_true", help="Enable debug logging")
return parser.parse_args(argv)

def get_valid_prefixes(config: List[RepoEntry]) -> Set[str]:
"""Extract valid subtree prefixes from the configuration."""
valid_prefixes = {
f"{entry.category}/{entry.name}"
for entry in config
}
logger.debug("Valid subtrees:\n" + "\n".join(sorted(valid_prefixes)))
return valid_prefixes

def get_valid_prefixes(config: List[RepoEntry], require_auto_pull: bool = False, require_auto_push: bool = False) -> Set[str]:
def get_valid_prefixes(config: List[RepoEntry], require_auto_pull: bool = False, require_auto_push: bool = False, require_monorepo_source: bool = False) -> Set[str]:
"""Extract valid subtree prefixes from the configuration based on filters."""
valid_prefixes = set()
for entry in config:
if require_auto_pull and not getattr(entry, "auto_subtree_pull", False):
continue
if require_auto_push and not getattr(entry, "auto_subtree_push", False):
continue
if require_monorepo_source and not getattr(entry, "monorepo_source_of_truth", False):
continue
valid_prefixes.add(f"{entry.category}/{entry.name}")
logger.debug("Valid subtrees:\n" + "\n".join(sorted(valid_prefixes)))
return valid_prefixes
Expand Down Expand Up @@ -131,7 +126,7 @@ def main(argv=None) -> None:
logger.error(f"SHA-based Git CLI fallback failed: {e}")
sys.exit(1)

valid_prefixes = get_valid_prefixes(config, args.require_auto_pull, args.require_auto_push)
valid_prefixes = get_valid_prefixes(config, args.require_auto_pull, args.require_auto_push, args.require_monorepo_source)
matched_subtrees = find_matched_subtrees(changed_files, valid_prefixes)
output_subtrees(matched_subtrees, args.dry_run)

Expand Down
18 changes: 13 additions & 5 deletions .github/scripts/repo_config_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,40 @@
"name": "rocblas",
"url": "ROCm/rocBLAS",
"branch": "develop",
"category": "projects"
"category": "projects",
"auto_subtree_pull": false,
"auto_subtree_push": true,
"monorepo_source_of_truth": true
},
...
]
}
"""

from typing import List

from pydantic import BaseModel

class RepoEntry(BaseModel):
"""
Represents a single repository entry in the repos-config.json file.

Fields:
name : Name of the project matching packaging file names. Lower-cased and no underscores. (e.g., "rocblas")
url : Individual GitHub org plus repo names in matching case and punctuation. (e.g., "ROCm/rocBLAS")
branch : The base branch of the sub-repo to target (e.g., "develop").
category : Directory category in the monorepo (e.g., "projects" or "shared").
name : Name of the project matching packaging file names. Lower-cased and no underscores. (e.g., "rocblas")
url : Individual GitHub org plus repo names in matching case and punctuation. (e.g., "ROCm/rocBLAS")
branch : The base branch of the sub-repo to target (e.g., "develop").
category : Directory category in the monorepo (e.g., "projects" or "shared").
auto_subtree_pull : Whether to automatically pull updates from the individual repo to the monorepo.
auto_subtree_push : Whether to automatically push changes from the monorepo to the individual repo.
monorepo_source_of_truth : Whether the monorepo is the source of truth for this project.
"""
name: str
url: str
branch: str
category: str
auto_subtree_pull: bool
auto_subtree_push: bool
monorepo_source_of_truth: bool

class RepoConfig(BaseModel):
"""
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/therock_configure_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def retrieve_projects(args):
base_ref = args.get("base_ref")
modified_paths = get_modified_paths(base_ref)
subtrees = get_changed_path_projects(modified_paths)

# by default, we select full tests
test_type = "full"

Expand All @@ -115,7 +115,7 @@ def retrieve_projects(args):
if related_to_therock_ci:
subtrees = list(subtree_to_project_map.keys())
test_type = "smoke"

# for nightly runs, run everything with full tests
if args.get("is_nightly"):
subtrees = list(subtree_to_project_map.keys())
Expand Down
2 changes: 1 addition & 1 deletion docs/migration-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ git push origin develop

1. **Update repos-config.json:**
- Update the true/false values in the [`repos-config.json`](/.github/repos-config.json) file that automated workflows use to determine which way the source gets synchronized..
- `auto_subtree_pull` should now be false, `auto_subtree_push` should now be true for this migrated project.
- `auto_subtree_pull` should now be false, `auto_subtree_push` should now be true for this migrated project. `monorepo_source_of_truth` should be true to reflect the new source of truth is the monorepo.
- Make this change on both the `develop` and `release-staging` branches.
- https://github.com/ROCm/rocm-libraries/blob/develop/.github/repos-config.json
- https://github.com/ROCm/rocm-libraries/blob/release-staging/rocm-rel-7.0/.github/repos-config.json
Expand Down
Loading