dagster
What it is
- A Dagster integration module that bootstraps the
naas_abi_coreEngine, discovers orchestrations that subclassDagsterOrchestration, collects their DagsterDefinitions, and exposes a mergeddefinitionsobject for Dagster to load.
Public API
- Module-level variable:
definitions- A
dagster.Definitionsinstance. - Built by merging
Definitionsgathered from all discoveredDagsterOrchestrationsubclasses. - If none are found, defaults to an empty
Definitions().
- A
Configuration/Dependencies
- Dependencies
dagster.Definitionsnaas_abi_core.engine.Engine.Enginenaas_abi_core.orchestrations.DagsterOrchestration.DagsterOrchestration
- Runtime behavior
- Instantiates
Engine()and immediately callsengine.load()on import. - Iterates
engine.modules.values()and each module’sorchestrationslist to find subclasses ofDagsterOrchestration. - For each match:
- Calls
DagsterOrchestrationSubclass.New()to create an instance. - Reads
.definitionsfrom the instance. - Merges all collected definitions via
Definitions.merge(*all_definitions).
- Calls
- Instantiates
Usage
Minimal example (importing the definitions symbol that Dagster expects):
# In your Dagster repository module (e.g., repository.py)
from naas_abi_core.apps.dagster.dagster import definitions
Caveats
- Importing this module triggers
Engine.load()and orchestration discovery at import time (side effects). - Only orchestrations that are subclasses of
DagsterOrchestrationare included. - If no qualifying orchestrations are discovered,
definitionswill be an emptydagster.Definitions().