cursus.core.utils.project_discovery¶
Discover and summarize Cursus pipeline projects under a root directory.
A “pipeline project” here is a deployable Cursus pipeline directory — e.g. the
projects/* folders under the AmazonCursus root (atoz_xgboost,
rnr_pytorch_bedrock, …) or the per-pipeline folders under a consumer repo such
as BuyerAbuseModsTemplate. Such a project is recognized by a configuration directory
(pipeline_config or pipeline_configs) holding one or more config JSON files,
typically alongside a dockers/scripts directory and a pipeline-definition
.py module.
This is intentionally a read-only inspection utility built on the two existing
primitives — cursus.core.utils path discovery (to locate a named project) and
the config JSON each project already ships — so it answers “what pipeline projects
exist under here, and what does each contain?” without the multi-developer-workspace
authoring machinery. It does not import or require cursus.workspace.
- Public API:
discover_pipeline_projects(root=None, names=None) -> List[ProjectInfo] summarize_project(project_dir) -> Optional[ProjectInfo]
Each project’s config JSON is read for its metadata.config_types (node -> config
class) and configuration.specific (per-node settings), which is how a Cursus config
file records the pipeline’s nodes. No SageMaker/engine objects are constructed, so this
is cheap and safe to run anywhere.
- class ConfigSummary(file, node_count=0, config_types=<factory>, nodes=<factory>, created_at=None, error=None)[source]¶
Bases:
objectSummary of one config JSON file inside a project.
- class ProjectInfo(name, path, config_dir=None, config_files=<factory>, has_dockers=False, has_scripts=False, pipeline_modules=<factory>)[source]¶
Bases:
objectSummary of one discovered pipeline project.
- config_files: List[ConfigSummary]¶
- summarize_project(project_dir)[source]¶
Summarize a single pipeline-project directory.
Returns a
ProjectInfo, orNoneifproject_diris not a recognizable Cursus pipeline project (nopipeline_config/pipeline_configsdirectory).
- discover_pipeline_projects(root=None, names=None)[source]¶
Discover Cursus pipeline projects under
root(or locate specific ones by name).- Parameters:
root (str | Path | None) – Directory to scan for project subdirectories. When
Noneandnamesis given, each name is located viacursus.core.utils.find_project_folder_generic()(cross-deployment search). When both areNone, returns an empty list (nothing to scan).names (List[str] | None) – Optional explicit list of project folder names. If given, only these are returned (located under
rootif provided, else via generic discovery).
- Returns:
A list of
ProjectInfo, one per recognized pipeline project, sorted by name. Directories that are not pipeline projects (no config dir) are skipped.- Return type: