digitalhub 0.8.0b5__py3-none-any.whl → 0.8.0b6__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/entities/{_builders/entity.py → _base/entity/builder.py} +27 -5
- digitalhub/entities/_base/entity/entity.py +2 -2
- digitalhub/entities/_base/runtime_entity/__init__.py +0 -0
- digitalhub/entities/_base/runtime_entity/builder.py +95 -0
- digitalhub/entities/_base/unversioned/builder.py +1 -1
- digitalhub/entities/_base/versioned/builder.py +1 -1
- digitalhub/entities/artifact/crud.py +1 -1
- digitalhub/entities/dataitem/crud.py +1 -1
- digitalhub/entities/function/_base/builder.py +2 -1
- digitalhub/entities/function/_base/entity.py +3 -6
- digitalhub/entities/model/crud.py +1 -1
- digitalhub/entities/project/_base/builder.py +1 -1
- digitalhub/entities/run/_base/builder.py +2 -1
- digitalhub/entities/run/_base/entity.py +22 -28
- digitalhub/entities/task/_base/builder.py +2 -8
- digitalhub/entities/workflow/_base/builder.py +2 -1
- digitalhub/entities/workflow/_base/entity.py +3 -6
- digitalhub/factory/api.py +271 -0
- digitalhub/factory/factory.py +80 -18
- digitalhub/runtimes/_base.py +3 -65
- digitalhub/runtimes/builder.py +2 -6
- {digitalhub-0.8.0b5.dist-info → digitalhub-0.8.0b6.dist-info}/METADATA +1 -1
- {digitalhub-0.8.0b5.dist-info → digitalhub-0.8.0b6.dist-info}/RECORD +32 -31
- digitalhub/runtimes/kind_registry.py +0 -184
- digitalhub/runtimes/utils.py +0 -28
- /digitalhub/entities/{_builders → _base/entity/_constructors}/__init__.py +0 -0
- /digitalhub/entities/{_builders → _base/entity/_constructors}/metadata.py +0 -0
- /digitalhub/entities/{_builders → _base/entity/_constructors}/name.py +0 -0
- /digitalhub/entities/{_builders → _base/entity/_constructors}/spec.py +0 -0
- /digitalhub/entities/{_builders → _base/entity/_constructors}/status.py +0 -0
- /digitalhub/entities/{_builders → _base/entity/_constructors}/uuid.py +0 -0
- {digitalhub-0.8.0b5.dist-info → digitalhub-0.8.0b6.dist-info}/LICENSE.txt +0 -0
- {digitalhub-0.8.0b5.dist-info → digitalhub-0.8.0b6.dist-info}/WHEEL +0 -0
- {digitalhub-0.8.0b5.dist-info → digitalhub-0.8.0b6.dist-info}/top_level.txt +0 -0
|
@@ -3,11 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
import typing
|
|
4
4
|
from abc import abstractmethod
|
|
5
5
|
|
|
6
|
-
from digitalhub.entities.
|
|
7
|
-
from digitalhub.entities.
|
|
8
|
-
from digitalhub.entities.
|
|
9
|
-
from digitalhub.entities.
|
|
10
|
-
from digitalhub.entities.
|
|
6
|
+
from digitalhub.entities._base.entity._constructors.metadata import build_metadata
|
|
7
|
+
from digitalhub.entities._base.entity._constructors.name import build_name
|
|
8
|
+
from digitalhub.entities._base.entity._constructors.spec import build_spec
|
|
9
|
+
from digitalhub.entities._base.entity._constructors.status import build_status
|
|
10
|
+
from digitalhub.entities._base.entity._constructors.uuid import build_uuid
|
|
11
11
|
from digitalhub.utils.exceptions import BuilderError
|
|
12
12
|
|
|
13
13
|
if typing.TYPE_CHECKING:
|
|
@@ -151,3 +151,25 @@ class EntityBuilder:
|
|
|
151
151
|
"""
|
|
152
152
|
Build entity object from dictionary.
|
|
153
153
|
"""
|
|
154
|
+
|
|
155
|
+
def get_entity_type(self) -> str:
|
|
156
|
+
"""
|
|
157
|
+
Get entity type.
|
|
158
|
+
|
|
159
|
+
Returns
|
|
160
|
+
-------
|
|
161
|
+
str
|
|
162
|
+
Entity type.
|
|
163
|
+
"""
|
|
164
|
+
return self.ENTITY_TYPE
|
|
165
|
+
|
|
166
|
+
def get_kind(self) -> str:
|
|
167
|
+
"""
|
|
168
|
+
Get entity kind.
|
|
169
|
+
|
|
170
|
+
Returns
|
|
171
|
+
-------
|
|
172
|
+
str
|
|
173
|
+
Entity kind.
|
|
174
|
+
"""
|
|
175
|
+
return self.ENTITY_KIND
|
|
@@ -4,7 +4,7 @@ import typing
|
|
|
4
4
|
from abc import ABCMeta, abstractmethod
|
|
5
5
|
|
|
6
6
|
from digitalhub.entities._base._base.entity import Base
|
|
7
|
-
from digitalhub.factory.
|
|
7
|
+
from digitalhub.factory.api import build_entity_from_dict
|
|
8
8
|
|
|
9
9
|
if typing.TYPE_CHECKING:
|
|
10
10
|
from digitalhub.entities._base.entity.metadata import Metadata
|
|
@@ -69,7 +69,7 @@ class Entity(Base, metaclass=ABCMeta):
|
|
|
69
69
|
-------
|
|
70
70
|
None
|
|
71
71
|
"""
|
|
72
|
-
new_obj =
|
|
72
|
+
new_obj = build_entity_from_dict(self.kind, obj)
|
|
73
73
|
self.metadata = new_obj.metadata
|
|
74
74
|
self.spec = new_obj.spec
|
|
75
75
|
self.status = new_obj.status
|
|
File without changes
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from digitalhub.utils.exceptions import EntityError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class RuntimeEntityBuilder:
|
|
7
|
+
"""
|
|
8
|
+
RuntimeEntity builder.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
EXECUTABLE_KIND: str = None
|
|
12
|
+
TASKS_KINDS: dict = None
|
|
13
|
+
RUN_KIND: str = None
|
|
14
|
+
|
|
15
|
+
def __init__(self) -> None:
|
|
16
|
+
if self.EXECUTABLE_KIND is None:
|
|
17
|
+
raise EntityError("EXECUTABLE_KIND must be set")
|
|
18
|
+
if self.TASKS_KINDS is None:
|
|
19
|
+
raise EntityError("TASKS_KINDS must be set")
|
|
20
|
+
if self.RUN_KIND is None:
|
|
21
|
+
raise EntityError("RUN_KIND must be set")
|
|
22
|
+
|
|
23
|
+
def get_action_from_task_kind(self, task_kind: str) -> str:
|
|
24
|
+
"""
|
|
25
|
+
Get action from task kind.
|
|
26
|
+
|
|
27
|
+
Parameters
|
|
28
|
+
----------
|
|
29
|
+
task_kind : str
|
|
30
|
+
Task kind.
|
|
31
|
+
|
|
32
|
+
Returns
|
|
33
|
+
-------
|
|
34
|
+
str
|
|
35
|
+
Action.
|
|
36
|
+
"""
|
|
37
|
+
for task in self.TASKS_KINDS:
|
|
38
|
+
if task["kind"] == task_kind:
|
|
39
|
+
return task["action"]
|
|
40
|
+
msg = f"Task kind {task_kind} not allowed."
|
|
41
|
+
raise EntityError(msg)
|
|
42
|
+
|
|
43
|
+
def get_task_kind_from_action(self, action: str) -> list[str]:
|
|
44
|
+
"""
|
|
45
|
+
Get task kinds from action.
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
action : str
|
|
50
|
+
Action.
|
|
51
|
+
|
|
52
|
+
Returns
|
|
53
|
+
-------
|
|
54
|
+
list[str]
|
|
55
|
+
Task kinds.
|
|
56
|
+
"""
|
|
57
|
+
for task in self.TASKS_KINDS:
|
|
58
|
+
if task["action"] == action:
|
|
59
|
+
return task["kind"]
|
|
60
|
+
msg = f"Action {action} not allowed."
|
|
61
|
+
raise EntityError(msg)
|
|
62
|
+
|
|
63
|
+
def get_run_kind(self) -> str:
|
|
64
|
+
"""
|
|
65
|
+
Get run kind.
|
|
66
|
+
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
str
|
|
70
|
+
Run kind.
|
|
71
|
+
"""
|
|
72
|
+
return self.RUN_KIND
|
|
73
|
+
|
|
74
|
+
def get_executable_kind(self) -> str:
|
|
75
|
+
"""
|
|
76
|
+
Get executable kind.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
str
|
|
81
|
+
Executable kind.
|
|
82
|
+
"""
|
|
83
|
+
return self.EXECUTABLE_KIND
|
|
84
|
+
|
|
85
|
+
def get_all_kinds(self) -> list[str]:
|
|
86
|
+
"""
|
|
87
|
+
Get all kinds.
|
|
88
|
+
|
|
89
|
+
Returns
|
|
90
|
+
-------
|
|
91
|
+
list[str]
|
|
92
|
+
All kinds.
|
|
93
|
+
"""
|
|
94
|
+
task_kinds = [i["kind"] for i in self.TASKS_KINDS]
|
|
95
|
+
return [self.EXECUTABLE_KIND, self.RUN_KIND, *task_kinds]
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
-
from digitalhub.entities.
|
|
5
|
+
from digitalhub.entities._base.entity.builder import EntityBuilder
|
|
6
6
|
|
|
7
7
|
if typing.TYPE_CHECKING:
|
|
8
8
|
from digitalhub.entities._base.unversioned.entity import UnversionedEntity
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
-
from digitalhub.entities.
|
|
5
|
+
from digitalhub.entities._base.entity.builder import EntityBuilder
|
|
6
6
|
|
|
7
7
|
if typing.TYPE_CHECKING:
|
|
8
8
|
from digitalhub.entities._base.versioned.entity import VersionedEntity
|
|
@@ -9,7 +9,7 @@ from digitalhub.entities._base.crud import (
|
|
|
9
9
|
read_entity_api_ctx,
|
|
10
10
|
read_entity_api_ctx_versions,
|
|
11
11
|
)
|
|
12
|
-
from digitalhub.entities.
|
|
12
|
+
from digitalhub.entities._base.entity._constructors.uuid import build_uuid
|
|
13
13
|
from digitalhub.entities.artifact.builder import artifact_from_dict, artifact_from_parameters
|
|
14
14
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
15
15
|
from digitalhub.entities.utils.utils import build_log_path_from_source, eval_local_source
|
|
@@ -12,7 +12,7 @@ from digitalhub.entities._base.crud import (
|
|
|
12
12
|
read_entity_api_ctx,
|
|
13
13
|
read_entity_api_ctx_versions,
|
|
14
14
|
)
|
|
15
|
-
from digitalhub.entities.
|
|
15
|
+
from digitalhub.entities._base.entity._constructors.uuid import build_uuid
|
|
16
16
|
from digitalhub.entities.dataitem.builder import dataitem_from_dict, dataitem_from_parameters
|
|
17
17
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
18
18
|
from digitalhub.entities.utils.utils import build_log_path_from_filename, build_log_path_from_source, eval_local_source
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
+
from digitalhub.entities._base.runtime_entity.builder import RuntimeEntityBuilder
|
|
5
6
|
from digitalhub.entities._base.versioned.builder import VersionedBuilder
|
|
6
7
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ if typing.TYPE_CHECKING:
|
|
|
9
10
|
from digitalhub.entities.function._base.entity import Function
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
class FunctionBuilder(VersionedBuilder):
|
|
13
|
+
class FunctionBuilder(VersionedBuilder, RuntimeEntityBuilder):
|
|
13
14
|
"""
|
|
14
15
|
Function builder.
|
|
15
16
|
"""
|
|
@@ -5,7 +5,7 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
5
5
|
|
|
6
6
|
from digitalhub.entities._base.executable.entity import ExecutableEntity
|
|
7
7
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
8
|
-
from digitalhub.
|
|
8
|
+
from digitalhub.factory.api import get_run_kind, get_task_kind_from_action
|
|
9
9
|
from digitalhub.utils.exceptions import BackendError
|
|
10
10
|
|
|
11
11
|
if typing.TYPE_CHECKING:
|
|
@@ -71,12 +71,9 @@ class Function(ExecutableEntity):
|
|
|
71
71
|
Run
|
|
72
72
|
Run instance.
|
|
73
73
|
"""
|
|
74
|
-
# Get kind registry
|
|
75
|
-
kind_reg = get_kind_registry(self.kind, self.project)
|
|
76
|
-
|
|
77
74
|
# Get task and run kind
|
|
78
|
-
task_kind =
|
|
79
|
-
run_kind =
|
|
75
|
+
task_kind = get_task_kind_from_action(self.kind, action)
|
|
76
|
+
run_kind = get_run_kind(self.kind)
|
|
80
77
|
|
|
81
78
|
# Create or update new task
|
|
82
79
|
task = self._get_or_create_task(task_kind)
|
|
@@ -9,7 +9,7 @@ from digitalhub.entities._base.crud import (
|
|
|
9
9
|
read_entity_api_ctx,
|
|
10
10
|
read_entity_api_ctx_versions,
|
|
11
11
|
)
|
|
12
|
-
from digitalhub.entities.
|
|
12
|
+
from digitalhub.entities._base.entity._constructors.uuid import build_uuid
|
|
13
13
|
from digitalhub.entities.model.builder import model_from_dict, model_from_parameters
|
|
14
14
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
15
15
|
from digitalhub.entities.utils.utils import build_log_path_from_source, eval_local_source
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from digitalhub.entities.
|
|
3
|
+
from digitalhub.entities._base.entity.builder import EntityBuilder
|
|
4
4
|
from digitalhub.entities.project._base.entity import Project
|
|
5
5
|
from digitalhub.entities.project._base.spec import ProjectSpec, ProjectValidator
|
|
6
6
|
from digitalhub.entities.project._base.status import ProjectStatus
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
+
from digitalhub.entities._base.runtime_entity.builder import RuntimeEntityBuilder
|
|
5
6
|
from digitalhub.entities._base.unversioned.builder import UnversionedBuilder
|
|
6
7
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ if typing.TYPE_CHECKING:
|
|
|
9
10
|
from digitalhub.entities.run._base.entity import Run
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
class RunBuilder(UnversionedBuilder):
|
|
13
|
+
class RunBuilder(UnversionedBuilder, RuntimeEntityBuilder):
|
|
13
14
|
"""
|
|
14
15
|
Run builder.
|
|
15
16
|
"""
|
|
@@ -14,7 +14,13 @@ from digitalhub.entities._base.crud import (
|
|
|
14
14
|
from digitalhub.entities._base.unversioned.entity import UnversionedEntity
|
|
15
15
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
16
16
|
from digitalhub.entities.utils.state import State
|
|
17
|
-
from digitalhub.factory.
|
|
17
|
+
from digitalhub.factory.api import (
|
|
18
|
+
build_runtime,
|
|
19
|
+
build_spec,
|
|
20
|
+
build_status,
|
|
21
|
+
get_entity_type_from_kind,
|
|
22
|
+
get_executable_kind,
|
|
23
|
+
)
|
|
18
24
|
from digitalhub.utils.exceptions import EntityError
|
|
19
25
|
from digitalhub.utils.logger import LOGGER
|
|
20
26
|
|
|
@@ -59,11 +65,10 @@ class Run(UnversionedEntity):
|
|
|
59
65
|
-------
|
|
60
66
|
None
|
|
61
67
|
"""
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
self.spec = factory.build_spec(
|
|
68
|
+
executable = self._get_executable()
|
|
69
|
+
task = self._get_task()
|
|
70
|
+
new_spec = self._get_runtime().build(executable, task, self.to_dict())
|
|
71
|
+
self.spec = build_spec(
|
|
67
72
|
self.kind,
|
|
68
73
|
**new_spec,
|
|
69
74
|
)
|
|
@@ -92,9 +97,6 @@ class Run(UnversionedEntity):
|
|
|
92
97
|
status = self._get_runtime().run(self.to_dict())
|
|
93
98
|
except Exception as e:
|
|
94
99
|
self.refresh()
|
|
95
|
-
import pdb
|
|
96
|
-
|
|
97
|
-
pdb.set_trace()
|
|
98
100
|
if self.spec.local_execution:
|
|
99
101
|
self._set_state(State.ERROR.value)
|
|
100
102
|
self._set_message(str(e))
|
|
@@ -226,7 +228,7 @@ class Run(UnversionedEntity):
|
|
|
226
228
|
-------
|
|
227
229
|
None
|
|
228
230
|
"""
|
|
229
|
-
self.status: RunStatus =
|
|
231
|
+
self.status: RunStatus = build_status(self.kind, **status)
|
|
230
232
|
|
|
231
233
|
def _set_state(self, state: str) -> None:
|
|
232
234
|
"""
|
|
@@ -267,24 +269,20 @@ class Run(UnversionedEntity):
|
|
|
267
269
|
Runtime
|
|
268
270
|
Runtime object.
|
|
269
271
|
"""
|
|
270
|
-
return
|
|
272
|
+
return build_runtime(self.kind, self.project)
|
|
271
273
|
|
|
272
|
-
def _get_executable(self
|
|
274
|
+
def _get_executable(self) -> dict:
|
|
273
275
|
"""
|
|
274
|
-
Get object from backend. Reimplemented to avoid
|
|
275
|
-
|
|
276
|
-
Parameters
|
|
277
|
-
----------
|
|
278
|
-
runtime : Runtime
|
|
279
|
-
Runtime object.
|
|
276
|
+
Get executable object from backend. Reimplemented to avoid
|
|
277
|
+
circular imports.
|
|
280
278
|
|
|
281
279
|
Returns
|
|
282
280
|
-------
|
|
283
281
|
dict
|
|
284
282
|
Executable (function or workflow) from backend.
|
|
285
283
|
"""
|
|
286
|
-
exec_kind =
|
|
287
|
-
entity_type =
|
|
284
|
+
exec_kind = get_executable_kind(self.kind)
|
|
285
|
+
entity_type = get_entity_type_from_kind(exec_kind)
|
|
288
286
|
splitted = self.spec.task.split("/")
|
|
289
287
|
exec_name = splitted[-1].split(":")[0]
|
|
290
288
|
exec_id = splitted[-1].split(":")[1]
|
|
@@ -295,21 +293,17 @@ class Run(UnversionedEntity):
|
|
|
295
293
|
entity_id=exec_id,
|
|
296
294
|
)
|
|
297
295
|
|
|
298
|
-
def _get_task(self
|
|
296
|
+
def _get_task(self) -> dict:
|
|
299
297
|
"""
|
|
300
|
-
Get object from backend. Reimplemented to avoid
|
|
301
|
-
|
|
302
|
-
Parameters
|
|
303
|
-
----------
|
|
304
|
-
runtime : Runtime
|
|
305
|
-
Runtime object.
|
|
298
|
+
Get object from backend. Reimplemented to avoid
|
|
299
|
+
circular imports.
|
|
306
300
|
|
|
307
301
|
Returns
|
|
308
302
|
-------
|
|
309
303
|
dict
|
|
310
304
|
Task from backend.
|
|
311
305
|
"""
|
|
312
|
-
executable_kind =
|
|
306
|
+
executable_kind = get_executable_kind(self.kind)
|
|
313
307
|
exec_string = f"{executable_kind}://{self.spec.task.split('://')[1]}"
|
|
314
308
|
|
|
315
309
|
# Local backend
|
|
@@ -2,27 +2,21 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
+
from digitalhub.entities._base.runtime_entity.builder import RuntimeEntityBuilder
|
|
5
6
|
from digitalhub.entities._base.unversioned.builder import UnversionedBuilder
|
|
6
7
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
7
|
-
from digitalhub.utils.exceptions import BuilderError
|
|
8
8
|
|
|
9
9
|
if typing.TYPE_CHECKING:
|
|
10
10
|
from digitalhub.entities.task._base.entity import Task
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class TaskBuilder(UnversionedBuilder):
|
|
13
|
+
class TaskBuilder(UnversionedBuilder, RuntimeEntityBuilder):
|
|
14
14
|
"""
|
|
15
15
|
Task builder.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
ACTION: str = None
|
|
19
18
|
ENTITY_TYPE = EntityTypes.TASK.value
|
|
20
19
|
|
|
21
|
-
def __init__(self) -> None:
|
|
22
|
-
super().__init__()
|
|
23
|
-
if self.ACTION is None:
|
|
24
|
-
raise BuilderError("ACTION must be set")
|
|
25
|
-
|
|
26
20
|
def build(
|
|
27
21
|
self,
|
|
28
22
|
project: str,
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
+
from digitalhub.entities._base.runtime_entity.builder import RuntimeEntityBuilder
|
|
5
6
|
from digitalhub.entities._base.versioned.builder import VersionedBuilder
|
|
6
7
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ if typing.TYPE_CHECKING:
|
|
|
9
10
|
from digitalhub.entities.workflow._base.entity import Workflow
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
class WorkflowBuilder(VersionedBuilder):
|
|
13
|
+
class WorkflowBuilder(VersionedBuilder, RuntimeEntityBuilder):
|
|
13
14
|
"""
|
|
14
15
|
Workflow builder.
|
|
15
16
|
"""
|
|
@@ -4,7 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from digitalhub.entities._base.executable.entity import ExecutableEntity
|
|
6
6
|
from digitalhub.entities.utils.entity_types import EntityTypes
|
|
7
|
-
from digitalhub.
|
|
7
|
+
from digitalhub.factory.api import get_run_kind, get_task_kind_from_action
|
|
8
8
|
from digitalhub.utils.exceptions import BackendError
|
|
9
9
|
|
|
10
10
|
if typing.TYPE_CHECKING:
|
|
@@ -60,12 +60,9 @@ class Workflow(ExecutableEntity):
|
|
|
60
60
|
if action is None:
|
|
61
61
|
action = "pipeline"
|
|
62
62
|
|
|
63
|
-
# Get kind registry
|
|
64
|
-
kind_reg = get_kind_registry(self.kind, self.project)
|
|
65
|
-
|
|
66
63
|
# Get task and run kind
|
|
67
|
-
task_kind =
|
|
68
|
-
run_kind =
|
|
64
|
+
task_kind = get_task_kind_from_action(self.kind, action)
|
|
65
|
+
run_kind = get_run_kind(self.kind)
|
|
69
66
|
|
|
70
67
|
# Create or update new task
|
|
71
68
|
task = self._get_or_create_task(task_kind)
|