cursus.core.deps¶
Pipeline Dependencies module - Declarative dependency management for SageMaker pipelines.
This module provides declarative specifications and intelligent resolution for pipeline step dependencies.
- class DependencyType(*values)[source]¶
Bases:
EnumTypes of dependencies in the pipeline.
- MODEL_ARTIFACTS = 'model_artifacts'¶
- PROCESSING_OUTPUT = 'processing_output'¶
- TRAINING_DATA = 'training_data'¶
- HYPERPARAMETERS = 'hyperparameters'¶
- PAYLOAD_SAMPLES = 'payload_samples'¶
- CUSTOM_PROPERTY = 'custom_property'¶
- class NodeType(*values)[source]¶
Bases:
EnumTypes of nodes in the pipeline based on their dependency/output characteristics.
- SOURCE = 'source'¶
- INTERNAL = 'internal'¶
- SINK = 'sink'¶
- SINGULAR = 'singular'¶
- class PropertyReference(*, step_name, output_spec)[source]¶
Bases:
BaseModelLazy evaluation reference bridging definition-time and runtime.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- to_runtime_property(step_instances)[source]¶
Create an actual SageMaker property reference using step instances.
This method navigates the property path to create a proper SageMaker Properties object that can be used at runtime.
- Parameters:
step_instances (Dict[str, Any]) – Dictionary mapping step names to step instances
- Returns:
SageMaker Properties object for the referenced property
- Raises:
ValueError – If the step is not found or property path is invalid
AttributeError – If any part of the property path is invalid
- Return type:
- to_sagemaker_property()[source]¶
Convert to SageMaker Properties dictionary format at pipeline definition time.
- output_spec: OutputDecl¶
- class SpecificationRegistry(context_name='default')[source]¶
Bases:
objectContext-aware registry for managing step specifications with isolation.
- class RegistryManager(workspace_context=None)[source]¶
Bases:
objectManager for context-scoped registries with complete isolation and workspace awareness.
This enhanced registry manager now supports: 1. Workspace-aware registry resolution 2. Integration with hybrid registry system 3. Backward compatibility with existing code 4. Thread-local workspace context management
- get_registry(context_name='default', create_if_missing=True)[source]¶
Get the registry for a specific context with workspace awareness.
This enhanced method now supports: 1. Workspace-aware context naming 2. Integration with hybrid registry system 3. Automatic registry population from hybrid sources 4. Backward compatibility with existing code
- Parameters:
- Returns:
Context-specific registry or None if not found and create_if_missing is False
- Return type:
- get_registry(manager=None, context_name='default')[source]¶
Get the registry for a specific context.
- Parameters:
manager (RegistryManager | None) – Registry manager instance
context_name (str) – Name of the context (e.g., pipeline name, environment)
- Returns:
Context-specific registry
- Return type:
- get_pipeline_registry(manager, pipeline_name)[source]¶
Get registry for a pipeline (backward compatibility).
- Parameters:
manager (RegistryManager) – Registry manager instance
pipeline_name (str) – Name of the pipeline
- Returns:
Pipeline-specific registry
- Return type:
- get_default_registry(manager)[source]¶
Get the default registry (backward compatibility).
- Parameters:
manager (RegistryManager) – Registry manager instance
- Returns:
Default registry
- Return type:
- integrate_with_pipeline_builder(pipeline_builder_cls, manager=None)[source]¶
Decorator to integrate context-scoped registries with a pipeline builder class.
This decorator modifies a pipeline builder class to use context-scoped registries.
- Parameters:
pipeline_builder_cls (Any) – Pipeline builder class to modify
manager (RegistryManager | None) – Registry manager instance (if None, a new instance will be created)
- Returns:
Modified pipeline builder class
- Return type:
- list_contexts(manager)[source]¶
Get list of all registered context names.
- Parameters:
manager (RegistryManager) – Registry manager instance
- Returns:
List of context names with registries
- Return type:
- clear_context(manager, context_name)[source]¶
Clear the registry for a specific context.
- Parameters:
manager (RegistryManager) – Registry manager instance
context_name (str) – Name of the context to clear
- Returns:
True if the registry was cleared, False if it didn’t exist
- Return type:
- class UnifiedDependencyResolver(registry, semantic_matcher)[source]¶
Bases:
objectIntelligent dependency resolver using declarative specifications.
- get_resolution_report(available_steps)[source]¶
Generate a detailed resolution report for debugging.
- resolve_step_dependencies(consumer_step, available_steps)[source]¶
Resolve dependencies for a single step.
- exception DependencyResolutionError[source]¶
Bases:
ExceptionRaised when dependencies cannot be resolved.
- create_dependency_resolver(registry=None, semantic_matcher=None)[source]¶
Create a properly configured dependency resolver.
- Parameters:
registry (SpecificationRegistry | None) – Optional specification registry. If None, creates a new one.
semantic_matcher (SemanticMatcher | None) – Optional semantic matcher. If None, creates a new one.
- Returns:
Configured UnifiedDependencyResolver instance
- Return type:
- class SemanticMatcher[source]¶
Bases:
objectSemantic similarity matching for dependency resolution.
- calculate_similarity_with_aliases(name, output_spec)[source]¶
Calculate semantic similarity between a name and an output specification, considering both logical_name and all aliases.
- create_pipeline_components(context_name=None)[source]¶
Create all necessary pipeline components with proper dependencies.
Modules
Unified dependency resolver for intelligent pipeline dependency management. |
|
Factory functions for creating pipeline dependency components. |
|
Property Reference module for SageMaker property path handling. |
|
Registry manager for coordinating multiple isolated specification registries. |
|
Semantic matching utilities for intelligent dependency resolution. |
|
Specification registry for managing step specifications with context isolation. |