setup
setup
¶
Shared execution setup — pure functions with no UI dependencies.
Consolidates the component creation logic that was duplicated between
cli/commands/_shared.py and daemon/job_service.py. Both paths
now call these functions:
- CLI wraps them with Rich console output for verbosity.
- Daemon calls them directly (no console).
This eliminates the "mirrors _shared.py" comments in job_service.py and ensures that adding a new backend type only requires updating one place.
Classes¶
Functions:¶
setup_learning
¶
Setup outcome store and global learning store if learning is enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Job configuration with learning settings. |
required |
global_learning_store_override
|
GlobalLearningStore | None
|
If provided, use this store instead of the module-level singleton. The daemon injects its shared LearningHub store here to avoid opening a second SQLite connection. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[OutcomeStore | None, GlobalLearningStore | None]
|
Tuple of (outcome_store, global_learning_store), either may be None. |
Source code in src/marianne/execution/setup.py
setup_notifications
¶
Setup notification manager from config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Job configuration with notification settings. |
required |
Returns:
| Type | Description |
|---|---|
NotificationManager | None
|
NotificationManager if notifications configured, else None. |
Source code in src/marianne/execution/setup.py
create_state_backend
¶
Create state persistence backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
Path
|
Workspace directory for state files. |
required |
backend_type
|
str
|
"json" or "sqlite". |
'json'
|
Returns:
| Type | Description |
|---|---|
StateBackend
|
Configured StateBackend instance. |