saturnin.component.recipe¶
Saturnin recipe definitions and management.
This module defines the structure and types associated with Saturnin recipes.
Recipes are configuration files that describe how to run services or bundles,
including their type, execution mode, executor, and associated application.
It provides enums for recipe types and execution modes, a configuration
class (SaturninRecipe) for parsing recipe files, a dataclass (RecipeInfo)
for representing loaded recipes, and a RecipeRegistry to manage them.
Enums¶
Globals¶
- saturnin.component.recipe.recipe_registry: RecipeRegistry¶
Global RecipeRegistryinstance, automatically populated from the
directory_scheme.recipesdirectory upon module import if it exists.
Classes¶
- class saturnin.component.recipe.SaturninRecipe[source]¶
Bases:
ConfigSaturnin recipe descriptor - configuration section.
- application: DataclassOption¶
Application specification (if any) associated with this recipe.
- execution_mode: EnumOption¶
Recipe execution mode -
RecipeExecutionModeenum.
- executor: PathOption¶
Recipe executor (container). If not provided, the default executor according to recipe type is used.
- recipe_type: EnumOption¶
Recipe type -
RecipeTypeenum.
- class saturnin.component.recipe.RecipeInfo(name: str, recipe_type: RecipeType, execution_mode: RecipeExecutionMode, executor: Path, application: ComponentSpecification, description: str, filename: Path)[source]¶
Bases:
DistinctDataclass recipe information record stored in recipe registry.
- Parameters:
name (str) – Recipe name
recipe_type (RecipeType) – Recipe type
execution_mode (RecipeExecutionMode) – Recipe execution mode
executor (Path) – Recipe executor
application (ComponentSpecification) – Application to be used
description (str) – Recipe description
filename (Path) – Path to recipe file
- get_key() Hashable[source]¶
Returns the recipe name, which serves as its unique key in the registry.
- Return type:
- application: ComponentSpecification¶
Application to be used
- execution_mode: RecipeExecutionMode¶
Recipe execution mode
- recipe_type: RecipeType¶
Recipe type
- class saturnin.component.recipe.RecipeRegistry(data: Mapping[Any, Distinct] | Sequence[Distinct] | Registry = None)[source]¶
Bases:
RegistrySaturnin recipe registry.
Holds
RecipeInfoinstances.- Parameters:
data (Mapping[Any, Distinct] | Sequence[Distinct] | Registry)
- app_is_used(app_uid: UUID) bool[source]¶
Returns True if application is used in any installed recipe.