digitalhub 0.14.0b1__py3-none-any.whl → 0.14.0b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of digitalhub might be problematic. Click here for more details.
- digitalhub/context/builder.py +0 -4
- digitalhub/context/context.py +12 -8
- digitalhub/entities/_base/_base/entity.py +0 -4
- digitalhub/entities/_base/context/entity.py +1 -1
- digitalhub/entities/_base/entity/entity.py +0 -8
- digitalhub/entities/_base/executable/entity.py +9 -21
- digitalhub/entities/_base/material/entity.py +5 -21
- digitalhub/entities/_base/unversioned/entity.py +1 -1
- digitalhub/entities/_base/versioned/entity.py +1 -1
- digitalhub/entities/_processors/base/__init__.py +3 -0
- digitalhub/entities/_processors/{base.py → base/crud.py} +12 -232
- digitalhub/entities/_processors/base/import_export.py +122 -0
- digitalhub/entities/_processors/base/processor.py +302 -0
- digitalhub/entities/_processors/base/special_ops.py +108 -0
- digitalhub/entities/_processors/context/__init__.py +3 -0
- digitalhub/entities/_processors/context/crud.py +654 -0
- digitalhub/entities/_processors/context/import_export.py +242 -0
- digitalhub/entities/_processors/context/material.py +123 -0
- digitalhub/entities/_processors/context/processor.py +400 -0
- digitalhub/entities/_processors/context/special_ops.py +476 -0
- digitalhub/entities/_processors/processors.py +12 -0
- digitalhub/entities/_processors/utils.py +2 -2
- digitalhub/entities/artifact/crud.py +1 -1
- digitalhub/entities/dataitem/crud.py +6 -3
- digitalhub/entities/dataitem/table/entity.py +24 -1
- digitalhub/entities/dataitem/utils.py +4 -0
- digitalhub/entities/function/_base/entity.py +3 -3
- digitalhub/entities/function/crud.py +1 -1
- digitalhub/entities/model/_base/entity.py +46 -24
- digitalhub/entities/model/crud.py +1 -1
- digitalhub/entities/project/_base/entity.py +3 -12
- digitalhub/entities/project/crud.py +1 -2
- digitalhub/entities/run/_base/builder.py +0 -4
- digitalhub/entities/run/_base/entity.py +53 -66
- digitalhub/entities/run/crud.py +5 -2
- digitalhub/entities/secret/_base/entity.py +1 -5
- digitalhub/entities/secret/crud.py +1 -1
- digitalhub/entities/task/_base/builder.py +0 -4
- digitalhub/entities/task/_base/entity.py +5 -5
- digitalhub/entities/task/crud.py +1 -1
- digitalhub/entities/trigger/_base/entity.py +1 -5
- digitalhub/entities/trigger/crud.py +1 -1
- digitalhub/entities/workflow/_base/entity.py +3 -3
- digitalhub/entities/workflow/crud.py +1 -1
- digitalhub/factory/entity.py +283 -0
- digitalhub/factory/registry.py +197 -0
- digitalhub/factory/runtime.py +44 -0
- digitalhub/runtimes/_base.py +2 -2
- digitalhub/stores/client/dhcore/client.py +0 -14
- digitalhub/stores/client/dhcore/configurator.py +5 -28
- digitalhub/stores/client/dhcore/error_parser.py +0 -4
- digitalhub/stores/credentials/configurator.py +4 -29
- digitalhub/stores/credentials/handler.py +0 -12
- digitalhub/stores/credentials/store.py +0 -4
- digitalhub/stores/data/_base/store.py +0 -16
- digitalhub/stores/data/builder.py +0 -4
- digitalhub/stores/data/remote/store.py +0 -4
- digitalhub/stores/data/s3/configurator.py +2 -10
- digitalhub/stores/data/s3/store.py +0 -12
- digitalhub/stores/data/sql/configurator.py +0 -8
- digitalhub/stores/data/sql/store.py +0 -4
- digitalhub/stores/readers/data/factory.py +0 -8
- digitalhub/stores/readers/data/pandas/reader.py +9 -19
- digitalhub/utils/io_utils.py +0 -4
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/METADATA +1 -1
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/RECORD +69 -57
- digitalhub/entities/_processors/context.py +0 -1499
- digitalhub/factory/factory.py +0 -460
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/WHEEL +0 -0
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/licenses/AUTHORS +0 -0
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b3.dist-info}/licenses/LICENSE +0 -0
digitalhub/factory/factory.py
DELETED
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
|
-
import typing
|
|
8
|
-
|
|
9
|
-
from digitalhub.factory.enums import FactoryEnum
|
|
10
|
-
from digitalhub.factory.utils import import_module, list_runtimes
|
|
11
|
-
from digitalhub.utils.exceptions import BuilderError
|
|
12
|
-
|
|
13
|
-
if typing.TYPE_CHECKING:
|
|
14
|
-
from digitalhub.entities._base.entity.builder import EntityBuilder
|
|
15
|
-
from digitalhub.entities._base.entity.entity import Entity
|
|
16
|
-
from digitalhub.entities._base.entity.metadata import Metadata
|
|
17
|
-
from digitalhub.entities._base.entity.spec import Spec, SpecValidator
|
|
18
|
-
from digitalhub.entities._base.entity.status import Status
|
|
19
|
-
from digitalhub.entities._base.runtime_entity.builder import RuntimeEntityBuilder
|
|
20
|
-
from digitalhub.runtimes._base import Runtime
|
|
21
|
-
from digitalhub.runtimes.builder import RuntimeBuilder
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class Factory:
|
|
25
|
-
"""
|
|
26
|
-
Factory for creating and managing entity and runtime builders.
|
|
27
|
-
|
|
28
|
-
This class implements the Factory pattern to manage the creation of
|
|
29
|
-
entities and runtimes through their respective builders. It maintains
|
|
30
|
-
separate registries for entity and runtime builders.
|
|
31
|
-
|
|
32
|
-
Many function arguments are called kind_to_build_from to avoid overwriting
|
|
33
|
-
kind in kwargs.
|
|
34
|
-
|
|
35
|
-
Attributes
|
|
36
|
-
----------
|
|
37
|
-
_entity_builders : dict[str, EntityBuilder | RuntimeEntityBuilder]
|
|
38
|
-
Registry of instantiated entity builders indexed by kind.
|
|
39
|
-
_runtime_builders : dict[str, RuntimeBuilder]
|
|
40
|
-
Registry of instantiated runtime builders indexed by kind.
|
|
41
|
-
|
|
42
|
-
Notes
|
|
43
|
-
-----
|
|
44
|
-
All builder methods may raise BuilderError if the requested kind
|
|
45
|
-
is not found in the registry.
|
|
46
|
-
"""
|
|
47
|
-
|
|
48
|
-
def __init__(self):
|
|
49
|
-
self._entity_builders: dict[str, EntityBuilder | RuntimeEntityBuilder] = {}
|
|
50
|
-
self._runtime_builders: dict[str, RuntimeBuilder] = {}
|
|
51
|
-
self._entities_registered = False
|
|
52
|
-
self._runtimes_registered = False
|
|
53
|
-
|
|
54
|
-
def add_entity_builder(self, name: str, builder: type[EntityBuilder | RuntimeEntityBuilder]) -> None:
|
|
55
|
-
"""
|
|
56
|
-
Register an entity builder.
|
|
57
|
-
|
|
58
|
-
Parameters
|
|
59
|
-
----------
|
|
60
|
-
name : str
|
|
61
|
-
The unique identifier for the builder.
|
|
62
|
-
builder : type[EntityBuilder] | type[RuntimeEntityBuilder]
|
|
63
|
-
The builder class to register. It will be instantiated immediately.
|
|
64
|
-
|
|
65
|
-
Returns
|
|
66
|
-
-------
|
|
67
|
-
None
|
|
68
|
-
|
|
69
|
-
Raises
|
|
70
|
-
------
|
|
71
|
-
BuilderError
|
|
72
|
-
If a builder with the same name already exists.
|
|
73
|
-
"""
|
|
74
|
-
if name in self._entity_builders:
|
|
75
|
-
raise BuilderError(f"Builder {name} already exists.")
|
|
76
|
-
self._entity_builders[name] = builder()
|
|
77
|
-
|
|
78
|
-
def add_runtime_builder(self, name: str, builder: type[RuntimeBuilder]) -> None:
|
|
79
|
-
"""
|
|
80
|
-
Register a runtime builder.
|
|
81
|
-
|
|
82
|
-
Parameters
|
|
83
|
-
----------
|
|
84
|
-
name : str
|
|
85
|
-
The unique identifier for the builder.
|
|
86
|
-
builder : type[RuntimeBuilder]
|
|
87
|
-
The builder class to register. It will be instantiated immediately.
|
|
88
|
-
|
|
89
|
-
Returns
|
|
90
|
-
-------
|
|
91
|
-
None
|
|
92
|
-
|
|
93
|
-
Raises
|
|
94
|
-
------
|
|
95
|
-
BuilderError
|
|
96
|
-
If a builder with the same name already exists.
|
|
97
|
-
"""
|
|
98
|
-
if name in self._runtime_builders:
|
|
99
|
-
raise BuilderError(f"Builder {name} already exists.")
|
|
100
|
-
self._runtime_builders[name] = builder()
|
|
101
|
-
|
|
102
|
-
def build_entity_from_params(self, **kwargs) -> Entity:
|
|
103
|
-
"""
|
|
104
|
-
Build an entity from parameters.
|
|
105
|
-
|
|
106
|
-
Parameters
|
|
107
|
-
----------
|
|
108
|
-
**kwargs
|
|
109
|
-
Entity parameters.
|
|
110
|
-
|
|
111
|
-
Returns
|
|
112
|
-
-------
|
|
113
|
-
Entity
|
|
114
|
-
Entity object.
|
|
115
|
-
"""
|
|
116
|
-
try:
|
|
117
|
-
kind = kwargs["kind"]
|
|
118
|
-
except KeyError:
|
|
119
|
-
raise BuilderError("Missing 'kind' parameter.")
|
|
120
|
-
builder = self._get_entity_builder(kind)
|
|
121
|
-
return builder.build(**kwargs)
|
|
122
|
-
|
|
123
|
-
def build_entity_from_dict(self, obj: dict) -> Entity:
|
|
124
|
-
"""
|
|
125
|
-
Build an entity from a dictionary.
|
|
126
|
-
|
|
127
|
-
Parameters
|
|
128
|
-
----------
|
|
129
|
-
obj : dict
|
|
130
|
-
Dictionary with entity data.
|
|
131
|
-
|
|
132
|
-
Returns
|
|
133
|
-
-------
|
|
134
|
-
Entity
|
|
135
|
-
Entity object.
|
|
136
|
-
"""
|
|
137
|
-
try:
|
|
138
|
-
kind = obj["kind"]
|
|
139
|
-
except KeyError:
|
|
140
|
-
raise BuilderError("Missing 'kind' parameter.")
|
|
141
|
-
builder = self._get_entity_builder(kind)
|
|
142
|
-
return builder.from_dict(obj)
|
|
143
|
-
|
|
144
|
-
def build_spec(self, kind_to_build_from: str, **kwargs) -> Spec:
|
|
145
|
-
"""
|
|
146
|
-
Build an entity spec.
|
|
147
|
-
|
|
148
|
-
Parameters
|
|
149
|
-
----------
|
|
150
|
-
kind_to_build_from : str
|
|
151
|
-
Entity type.
|
|
152
|
-
**kwargs
|
|
153
|
-
Additional spec parameters.
|
|
154
|
-
|
|
155
|
-
Returns
|
|
156
|
-
-------
|
|
157
|
-
Spec
|
|
158
|
-
Spec object.
|
|
159
|
-
"""
|
|
160
|
-
builder = self._get_entity_builder(kind_to_build_from)
|
|
161
|
-
return builder.build_spec(**kwargs)
|
|
162
|
-
|
|
163
|
-
def build_metadata(self, kind_to_build_from: str, **kwargs) -> Metadata:
|
|
164
|
-
"""
|
|
165
|
-
Build an entity metadata.
|
|
166
|
-
|
|
167
|
-
Parameters
|
|
168
|
-
----------
|
|
169
|
-
kind_to_build_from : str
|
|
170
|
-
Entity type.
|
|
171
|
-
**kwargs
|
|
172
|
-
Additional metadata parameters.
|
|
173
|
-
|
|
174
|
-
Returns
|
|
175
|
-
-------
|
|
176
|
-
Metadata
|
|
177
|
-
Metadata object.
|
|
178
|
-
"""
|
|
179
|
-
builder = self._get_entity_builder(kind_to_build_from)
|
|
180
|
-
return builder.build_metadata(**kwargs)
|
|
181
|
-
|
|
182
|
-
def build_status(self, kind_to_build_from: str, **kwargs) -> Status:
|
|
183
|
-
"""
|
|
184
|
-
Build an entity status.
|
|
185
|
-
|
|
186
|
-
Parameters
|
|
187
|
-
----------
|
|
188
|
-
kind_to_build_from : str
|
|
189
|
-
Entity type.
|
|
190
|
-
**kwargs
|
|
191
|
-
Additional status parameters.
|
|
192
|
-
|
|
193
|
-
Returns
|
|
194
|
-
-------
|
|
195
|
-
Status
|
|
196
|
-
Status object.
|
|
197
|
-
"""
|
|
198
|
-
builder = self._get_entity_builder(kind_to_build_from)
|
|
199
|
-
return builder.build_status(**kwargs)
|
|
200
|
-
|
|
201
|
-
def build_runtime(self, kind_to_build_from: str, project: str) -> Runtime:
|
|
202
|
-
"""
|
|
203
|
-
Build a runtime.
|
|
204
|
-
|
|
205
|
-
Parameters
|
|
206
|
-
----------
|
|
207
|
-
kind_to_build_from : str
|
|
208
|
-
Runtime type.
|
|
209
|
-
project : str
|
|
210
|
-
Project name.
|
|
211
|
-
|
|
212
|
-
Returns
|
|
213
|
-
-------
|
|
214
|
-
Runtime
|
|
215
|
-
Runtime object.
|
|
216
|
-
"""
|
|
217
|
-
builder = self._get_runtime_builder(kind_to_build_from)
|
|
218
|
-
return builder.build(project=project)
|
|
219
|
-
|
|
220
|
-
def get_entity_type_from_kind(self, kind: str) -> str:
|
|
221
|
-
"""
|
|
222
|
-
Get entity type from builder.
|
|
223
|
-
|
|
224
|
-
Parameters
|
|
225
|
-
----------
|
|
226
|
-
kind : str
|
|
227
|
-
Entity type.
|
|
228
|
-
|
|
229
|
-
Returns
|
|
230
|
-
-------
|
|
231
|
-
str
|
|
232
|
-
Entity type.
|
|
233
|
-
"""
|
|
234
|
-
builder = self._get_entity_builder(kind)
|
|
235
|
-
return builder.get_entity_type()
|
|
236
|
-
|
|
237
|
-
def get_executable_kind(self, kind: str) -> str:
|
|
238
|
-
"""
|
|
239
|
-
Get executable kind.
|
|
240
|
-
|
|
241
|
-
Parameters
|
|
242
|
-
----------
|
|
243
|
-
kind : str
|
|
244
|
-
Kind.
|
|
245
|
-
|
|
246
|
-
Returns
|
|
247
|
-
-------
|
|
248
|
-
str
|
|
249
|
-
Executable kind.
|
|
250
|
-
"""
|
|
251
|
-
builder = self._get_entity_builder(kind)
|
|
252
|
-
return builder.get_executable_kind()
|
|
253
|
-
|
|
254
|
-
def get_action_from_task_kind(self, kind: str, task_kind: str) -> str:
|
|
255
|
-
"""
|
|
256
|
-
Get action from task.
|
|
257
|
-
|
|
258
|
-
Parameters
|
|
259
|
-
----------
|
|
260
|
-
kind : str
|
|
261
|
-
Kind.
|
|
262
|
-
task_kind : str
|
|
263
|
-
Task kind.
|
|
264
|
-
|
|
265
|
-
Returns
|
|
266
|
-
-------
|
|
267
|
-
str
|
|
268
|
-
Action.
|
|
269
|
-
"""
|
|
270
|
-
builder = self._get_entity_builder(kind)
|
|
271
|
-
return builder.get_action_from_task_kind(task_kind)
|
|
272
|
-
|
|
273
|
-
def get_task_kind_from_action(self, kind: str, action: str) -> list[str]:
|
|
274
|
-
"""
|
|
275
|
-
Get task kinds from action.
|
|
276
|
-
|
|
277
|
-
Parameters
|
|
278
|
-
----------
|
|
279
|
-
kind : str
|
|
280
|
-
Kind.
|
|
281
|
-
action : str
|
|
282
|
-
Action.
|
|
283
|
-
|
|
284
|
-
Returns
|
|
285
|
-
-------
|
|
286
|
-
list of str
|
|
287
|
-
Task kinds.
|
|
288
|
-
"""
|
|
289
|
-
builder = self._get_entity_builder(kind)
|
|
290
|
-
return builder.get_task_kind_from_action(action)
|
|
291
|
-
|
|
292
|
-
def get_run_kind_from_action(self, kind: str, action: str) -> str:
|
|
293
|
-
"""
|
|
294
|
-
Get run kind.
|
|
295
|
-
|
|
296
|
-
Parameters
|
|
297
|
-
----------
|
|
298
|
-
kind : str
|
|
299
|
-
Kind.
|
|
300
|
-
|
|
301
|
-
Returns
|
|
302
|
-
-------
|
|
303
|
-
str
|
|
304
|
-
Run kind.
|
|
305
|
-
"""
|
|
306
|
-
builder = self._get_entity_builder(kind)
|
|
307
|
-
return builder.get_run_kind_from_action(action)
|
|
308
|
-
|
|
309
|
-
def get_all_kinds(self, kind: str) -> list[str]:
|
|
310
|
-
"""
|
|
311
|
-
Get all kinds.
|
|
312
|
-
|
|
313
|
-
Parameters
|
|
314
|
-
----------
|
|
315
|
-
kind : str
|
|
316
|
-
Kind.
|
|
317
|
-
|
|
318
|
-
Returns
|
|
319
|
-
-------
|
|
320
|
-
list of str
|
|
321
|
-
All kinds.
|
|
322
|
-
"""
|
|
323
|
-
builder = self._get_entity_builder(kind)
|
|
324
|
-
return builder.get_all_kinds()
|
|
325
|
-
|
|
326
|
-
def get_spec_validator(self, kind: str) -> SpecValidator:
|
|
327
|
-
"""
|
|
328
|
-
Get spec validators.
|
|
329
|
-
|
|
330
|
-
Parameters
|
|
331
|
-
----------
|
|
332
|
-
kind : str
|
|
333
|
-
Kind.
|
|
334
|
-
|
|
335
|
-
Returns
|
|
336
|
-
-------
|
|
337
|
-
SpecValidator
|
|
338
|
-
Spec validator.
|
|
339
|
-
"""
|
|
340
|
-
builder = self._get_entity_builder(kind)
|
|
341
|
-
return builder.get_spec_validator()
|
|
342
|
-
|
|
343
|
-
def _get_entity_builder(self, kind: str) -> EntityBuilder | RuntimeEntityBuilder:
|
|
344
|
-
"""
|
|
345
|
-
Return the entity builder for the given kind, ensuring lazy runtime registration.
|
|
346
|
-
|
|
347
|
-
Raises
|
|
348
|
-
------
|
|
349
|
-
BuilderError
|
|
350
|
-
If no builder exists for the specified kind.
|
|
351
|
-
"""
|
|
352
|
-
if not self._entities_registered:
|
|
353
|
-
self._ensure_entities_registered()
|
|
354
|
-
if kind not in self._entity_builders:
|
|
355
|
-
if not self._runtimes_registered:
|
|
356
|
-
self._ensure_runtimes_registered()
|
|
357
|
-
if kind not in self._entity_builders:
|
|
358
|
-
raise BuilderError(f"Entity builder for kind '{kind}' not found.")
|
|
359
|
-
return self._entity_builders[kind]
|
|
360
|
-
|
|
361
|
-
def _get_runtime_builder(self, kind: str) -> RuntimeBuilder:
|
|
362
|
-
"""
|
|
363
|
-
Return the runtime builder for the given kind, ensuring lazy runtime registration.
|
|
364
|
-
|
|
365
|
-
Raises
|
|
366
|
-
------
|
|
367
|
-
BuilderError
|
|
368
|
-
If no builder exists for the specified kind.
|
|
369
|
-
"""
|
|
370
|
-
if kind not in self._runtime_builders:
|
|
371
|
-
if not self._runtimes_registered:
|
|
372
|
-
self._ensure_runtimes_registered()
|
|
373
|
-
if kind not in self._runtime_builders:
|
|
374
|
-
raise BuilderError(f"Runtime builder for kind '{kind}' not found.")
|
|
375
|
-
return self._runtime_builders[kind]
|
|
376
|
-
|
|
377
|
-
def _ensure_entities_registered(self) -> None:
|
|
378
|
-
"""
|
|
379
|
-
Ensure core entities are registered on-demand.
|
|
380
|
-
|
|
381
|
-
Returns
|
|
382
|
-
-------
|
|
383
|
-
None
|
|
384
|
-
"""
|
|
385
|
-
if self._entities_registered:
|
|
386
|
-
return
|
|
387
|
-
try:
|
|
388
|
-
self._register_entities()
|
|
389
|
-
self._entities_registered = True
|
|
390
|
-
except Exception as e:
|
|
391
|
-
# Avoid repeated attempts; surface as BuilderError for consistency
|
|
392
|
-
self._entities_registered = True
|
|
393
|
-
raise BuilderError(f"Failed to register core entities: {e}")
|
|
394
|
-
|
|
395
|
-
def _register_entities(self) -> None:
|
|
396
|
-
"""
|
|
397
|
-
Register core entity builders into the factory.
|
|
398
|
-
|
|
399
|
-
Imports the core entities module and registers all entity
|
|
400
|
-
builders with the global factory instance.
|
|
401
|
-
|
|
402
|
-
Returns
|
|
403
|
-
-------
|
|
404
|
-
None
|
|
405
|
-
"""
|
|
406
|
-
try:
|
|
407
|
-
module = import_module(FactoryEnum.REG_ENTITIES.value)
|
|
408
|
-
|
|
409
|
-
# Register core entities
|
|
410
|
-
for k, b in getattr(module, FactoryEnum.REG_ENTITIES_VAR.value, []):
|
|
411
|
-
self.add_entity_builder(k, b)
|
|
412
|
-
|
|
413
|
-
except Exception as e:
|
|
414
|
-
raise RuntimeError("Error registering core entities.") from e
|
|
415
|
-
|
|
416
|
-
def _ensure_runtimes_registered(self) -> None:
|
|
417
|
-
"""
|
|
418
|
-
Ensure runtime entities are registered on-demand.
|
|
419
|
-
|
|
420
|
-
Returns
|
|
421
|
-
-------
|
|
422
|
-
None
|
|
423
|
-
"""
|
|
424
|
-
if self._runtimes_registered:
|
|
425
|
-
return
|
|
426
|
-
try:
|
|
427
|
-
self._register_runtimes_entities()
|
|
428
|
-
self._runtimes_registered = True
|
|
429
|
-
except Exception as e:
|
|
430
|
-
# If registration fails, mark as attempted to avoid infinite loops
|
|
431
|
-
self._runtimes_registered = True
|
|
432
|
-
raise BuilderError(f"Failed to register runtime entities: {e}")
|
|
433
|
-
|
|
434
|
-
def _register_runtimes_entities(self) -> None:
|
|
435
|
-
"""
|
|
436
|
-
Register all runtime builders and their entities into the factory.
|
|
437
|
-
|
|
438
|
-
Imports each runtime package and registers its entity and runtime
|
|
439
|
-
builders with the global factory instance.
|
|
440
|
-
|
|
441
|
-
Returns
|
|
442
|
-
-------
|
|
443
|
-
None
|
|
444
|
-
"""
|
|
445
|
-
try:
|
|
446
|
-
for package in list_runtimes():
|
|
447
|
-
module = import_module(package)
|
|
448
|
-
|
|
449
|
-
# Register workflows, functions, tasks and runs entities builders
|
|
450
|
-
for k, b in getattr(module, FactoryEnum.REG_ENTITIES_VAR.value, []):
|
|
451
|
-
self.add_entity_builder(k, b)
|
|
452
|
-
|
|
453
|
-
# Register runtime builders
|
|
454
|
-
for k, b in getattr(module, FactoryEnum.REG_RUNTIME_VAR.value, []):
|
|
455
|
-
self.add_runtime_builder(k, b)
|
|
456
|
-
except Exception as e:
|
|
457
|
-
raise RuntimeError("Error registering runtime entities.") from e
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
factory = Factory()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|