Project Utilities¶
Utility functions for CDK projects.
utils
¶
Classes¶
Functions¶
resolve_repo_root
¶
Find the root of the git repository
Returns:
| Type | Description |
|---|---|
str
|
Absolute root path |
Source code in src/aibs_informatics_cdk_lib/project/utils.py
get_package_root
¶
Find the root package
ASSUMPTION: the infrastructure package name is "aibs-informatics-cdk-lib"
Returns:
| Type | Description |
|---|---|
str
|
Absolute root path |
Source code in src/aibs_informatics_cdk_lib/project/utils.py
get_env_base
¶
Resolves EnvBase from cdk context or environment
Order of resolution
- CDK context value (specifying -c K=V)
- look for EnvBase
- look for EnvType/EnvLabel
- env variable
- Look for EnvBase
- Look for EnvType/EnvLabel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Node
|
cdk construct node |
required |
Returns:
| Type | Description |
|---|---|
EnvBase
|
Environment base |
Source code in src/aibs_informatics_cdk_lib/project/utils.py
set_env_base
¶
Set the environment base
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env_base
|
EnvBase
|
environment base |
required |
Source code in src/aibs_informatics_cdk_lib/project/utils.py
get_project_config_and_env_base
¶
get_project_config_and_env_base(
node: Node, project_config_cls: type[P] | None = None
) -> tuple[P, EnvBase]
Get the project configuration and environment base for a given node.
Source code in src/aibs_informatics_cdk_lib/project/utils.py
get_config
¶
get_config(
node: Node,
project_config_cls: type[
BaseProjectConfig[G, S]
] = ProjectConfig,
) -> S
Retrieves the stage configuration for a given node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Node
|
The node for which to retrieve the configuration. |
required |
project_config_cls
|
Type[BaseProjectConfig[G, S]]
|
The project configuration class to use. Defaults to ProjectConfig. |
ProjectConfig
|
Returns:
| Type | Description |
|---|---|
S
|
The stage configuration object. |