tracdap-runtime 0.6.2__py3-none-any.whl → 0.6.4__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.
- tracdap/rt/_exec/actors.py +87 -10
- tracdap/rt/_exec/context.py +207 -100
- tracdap/rt/_exec/dev_mode.py +52 -20
- tracdap/rt/_exec/engine.py +79 -14
- tracdap/rt/_exec/functions.py +14 -17
- tracdap/rt/_exec/runtime.py +83 -40
- tracdap/rt/_exec/server.py +306 -29
- tracdap/rt/_impl/config_parser.py +219 -49
- tracdap/rt/_impl/data.py +70 -5
- tracdap/rt/_impl/grpc/codec.py +60 -5
- tracdap/rt/_impl/grpc/tracdap/api/internal/runtime_pb2.py +19 -19
- tracdap/rt/_impl/grpc/tracdap/api/internal/runtime_pb2.pyi +11 -9
- tracdap/rt/_impl/grpc/tracdap/api/internal/runtime_pb2_grpc.py +25 -25
- tracdap/rt/_impl/grpc/tracdap/metadata/data_pb2.py +18 -18
- tracdap/rt/_impl/grpc/tracdap/metadata/model_pb2.py +28 -16
- tracdap/rt/_impl/grpc/tracdap/metadata/model_pb2.pyi +37 -6
- tracdap/rt/_impl/grpc/tracdap/metadata/object_pb2.py +8 -3
- tracdap/rt/_impl/grpc/tracdap/metadata/object_pb2.pyi +13 -2
- tracdap/rt/_impl/guard_rails.py +21 -0
- tracdap/rt/_impl/models.py +25 -0
- tracdap/rt/_impl/static_api.py +43 -13
- tracdap/rt/_impl/type_system.py +17 -0
- tracdap/rt/_impl/validation.py +47 -4
- tracdap/rt/_plugins/config_local.py +49 -0
- tracdap/rt/_version.py +1 -1
- tracdap/rt/api/hook.py +6 -5
- tracdap/rt/api/model_api.py +50 -7
- tracdap/rt/api/static_api.py +81 -23
- tracdap/rt/config/__init__.py +4 -4
- tracdap/rt/config/common.py +25 -15
- tracdap/rt/config/job.py +2 -2
- tracdap/rt/config/platform.py +25 -35
- tracdap/rt/config/result.py +2 -2
- tracdap/rt/config/runtime.py +4 -2
- tracdap/rt/ext/config.py +34 -0
- tracdap/rt/ext/embed.py +1 -3
- tracdap/rt/ext/plugins.py +47 -6
- tracdap/rt/launch/cli.py +11 -4
- tracdap/rt/launch/launch.py +53 -12
- tracdap/rt/metadata/__init__.py +17 -17
- tracdap/rt/metadata/common.py +2 -2
- tracdap/rt/metadata/custom.py +3 -3
- tracdap/rt/metadata/data.py +12 -12
- tracdap/rt/metadata/file.py +6 -6
- tracdap/rt/metadata/flow.py +6 -6
- tracdap/rt/metadata/job.py +8 -8
- tracdap/rt/metadata/model.py +21 -11
- tracdap/rt/metadata/object.py +3 -0
- tracdap/rt/metadata/object_id.py +8 -8
- tracdap/rt/metadata/search.py +5 -5
- tracdap/rt/metadata/stoarge.py +6 -6
- tracdap/rt/metadata/tag.py +1 -1
- tracdap/rt/metadata/tag_update.py +1 -1
- tracdap/rt/metadata/type.py +4 -4
- {tracdap_runtime-0.6.2.dist-info → tracdap_runtime-0.6.4.dist-info}/METADATA +4 -4
- tracdap_runtime-0.6.4.dist-info/RECORD +112 -0
- {tracdap_runtime-0.6.2.dist-info → tracdap_runtime-0.6.4.dist-info}/WHEEL +1 -1
- tracdap/rt/_impl/grpc/tracdap/config/common_pb2.py +0 -55
- tracdap/rt/_impl/grpc/tracdap/config/common_pb2.pyi +0 -103
- tracdap/rt/_impl/grpc/tracdap/config/job_pb2.py +0 -42
- tracdap/rt/_impl/grpc/tracdap/config/job_pb2.pyi +0 -44
- tracdap/rt/_impl/grpc/tracdap/config/platform_pb2.py +0 -71
- tracdap/rt/_impl/grpc/tracdap/config/platform_pb2.pyi +0 -197
- tracdap/rt/_impl/grpc/tracdap/config/result_pb2.py +0 -37
- tracdap/rt/_impl/grpc/tracdap/config/result_pb2.pyi +0 -35
- tracdap/rt/_impl/grpc/tracdap/config/runtime_pb2.py +0 -42
- tracdap/rt/_impl/grpc/tracdap/config/runtime_pb2.pyi +0 -46
- tracdap/rt/ext/_guard.py +0 -37
- tracdap_runtime-0.6.2.dist-info/RECORD +0 -121
- {tracdap_runtime-0.6.2.dist-info → tracdap_runtime-0.6.4.dist-info}/LICENSE +0 -0
- {tracdap_runtime-0.6.2.dist-info → tracdap_runtime-0.6.4.dist-info}/top_level.txt +0 -0
tracdap/rt/ext/plugins.py
CHANGED
@@ -19,7 +19,8 @@ import importlib as _il
|
|
19
19
|
|
20
20
|
import tracdap.rt.config as _cfg
|
21
21
|
import tracdap.rt.exceptions as _ex
|
22
|
-
import tracdap.rt.
|
22
|
+
import tracdap.rt._impl.guard_rails as _guard # noqa
|
23
|
+
from tracdap.rt.exceptions import EStartup
|
23
24
|
|
24
25
|
|
25
26
|
class PluginManager:
|
@@ -29,6 +30,8 @@ class PluginManager:
|
|
29
30
|
__log = _log.getLogger(f"{__name__}.PluginManager")
|
30
31
|
|
31
32
|
__core_registered = False
|
33
|
+
__3rd_party_registered = list()
|
34
|
+
|
32
35
|
__plugins = {}
|
33
36
|
|
34
37
|
@classmethod
|
@@ -40,17 +43,42 @@ class PluginManager:
|
|
40
43
|
return
|
41
44
|
|
42
45
|
cls.__log.info("Register core plugins...")
|
46
|
+
cls.__register_plugin_package("tracdap.rt._plugins")
|
47
|
+
|
48
|
+
cls.__core_registered = True
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def register_plugin_package(cls, plugin_package_name: str):
|
52
|
+
|
53
|
+
_guard.run_model_guard()
|
43
54
|
|
44
|
-
|
55
|
+
if plugin_package_name in cls.__3rd_party_registered:
|
56
|
+
return
|
57
|
+
|
58
|
+
if plugin_package_name.startswith("tracdap."):
|
59
|
+
raise EStartup("3rd party plugins cannot be registered from the tracdap namespace")
|
60
|
+
|
61
|
+
cls.__log.info(f"Register plugins from package [{plugin_package_name}]...")
|
62
|
+
cls.__register_plugin_package(plugin_package_name)
|
63
|
+
|
64
|
+
cls.__3rd_party_registered.append(plugin_package_name)
|
65
|
+
|
66
|
+
@classmethod
|
67
|
+
def __register_plugin_package(cls, plugin_package_name: str):
|
68
|
+
|
69
|
+
_guard.run_model_guard()
|
70
|
+
|
71
|
+
plugins_package = _il.import_module(plugin_package_name)
|
45
72
|
|
46
73
|
for module in _pkg.iter_modules(plugins_package.__path__):
|
74
|
+
|
75
|
+
module_name = f"{plugin_package_name}.{module.name}"
|
76
|
+
|
47
77
|
try:
|
48
|
-
module_name = f"tracdap.rt._plugins.{module.name}"
|
49
78
|
_il.import_module(module_name)
|
50
79
|
except ImportError:
|
51
|
-
|
52
|
-
|
53
|
-
cls.__core_registered = True
|
80
|
+
# It is not a fatal error if some plugins fail to load
|
81
|
+
cls.__log.warning(f"Failed to load plugins from module [{module_name}]")
|
54
82
|
|
55
83
|
@classmethod
|
56
84
|
def register_plugin(
|
@@ -94,3 +122,16 @@ class PluginManager:
|
|
94
122
|
plugin = plugin_class(config.properties)
|
95
123
|
|
96
124
|
return plugin
|
125
|
+
|
126
|
+
@classmethod
|
127
|
+
def load_config_plugin(cls,
|
128
|
+
service_type: _tp.Type[T_SERVICE],
|
129
|
+
config: _cfg.PluginConfig) \
|
130
|
+
-> T_SERVICE:
|
131
|
+
|
132
|
+
# Currently config plugins are loaded the same way as regular plugins
|
133
|
+
# However, regular plugins can be modified to take ConfigManager as an init parameter
|
134
|
+
# This is useful for loading secondary config files needed in particularly plugins
|
135
|
+
# Config plugins can never do this, because the config manager is not yet initialized
|
136
|
+
|
137
|
+
return cls.load_plugin(service_type, config)
|
tracdap/rt/launch/cli.py
CHANGED
@@ -16,18 +16,18 @@ import argparse
|
|
16
16
|
import pathlib
|
17
17
|
|
18
18
|
|
19
|
-
def _cli_args():
|
19
|
+
def _cli_args(programmatic_args = None):
|
20
20
|
|
21
21
|
parser = argparse.ArgumentParser(
|
22
22
|
prog="python -m tracdap.rt.launch",
|
23
23
|
description="TRAC D.A.P. Runtime for Python")
|
24
24
|
|
25
25
|
parser.add_argument(
|
26
|
-
"--sys-config", dest="sys_config", type=
|
26
|
+
"--sys-config", dest="sys_config", type=str, required=True,
|
27
27
|
help="Path to the system configuration file for the TRAC runtime")
|
28
28
|
|
29
29
|
parser.add_argument(
|
30
|
-
"--job-config", dest="job_config", type=
|
30
|
+
"--job-config", dest="job_config", type=str, required=True,
|
31
31
|
help="Path to the job configuration for the job to be executed")
|
32
32
|
|
33
33
|
parser.add_argument(
|
@@ -51,4 +51,11 @@ def _cli_args():
|
|
51
51
|
"--scratch-dir-persist", dest="scratch_dir_persist", default=False, action="store_true",
|
52
52
|
help="Do not clean up the scratch location on exit")
|
53
53
|
|
54
|
-
|
54
|
+
parser.add_argument(
|
55
|
+
"--plugin-package", dest="plugin_packages", type=str, action="append",
|
56
|
+
help="Do not clean up the scratch location on exit")
|
57
|
+
|
58
|
+
if programmatic_args:
|
59
|
+
return parser.parse_args(programmatic_args)
|
60
|
+
else:
|
61
|
+
return parser.parse_args()
|
tracdap/rt/launch/launch.py
CHANGED
@@ -29,7 +29,15 @@ from .cli import _cli_args
|
|
29
29
|
def _resolve_config_file(
|
30
30
|
config_path: _tp.Union[str, _pathlib.Path],
|
31
31
|
model_dir: _tp.Optional[_pathlib.Path] = None) \
|
32
|
-
-> _pathlib.Path:
|
32
|
+
-> _tp.Union[_pathlib.Path, str]:
|
33
|
+
|
34
|
+
# If the config path is a URL, do not convert it into a path
|
35
|
+
if isinstance(config_path, str):
|
36
|
+
scheme_sep = config_path.find(":")
|
37
|
+
# Single letter scheme is a Windows file path (C:\...)
|
38
|
+
scheme = scheme = config_path[:scheme_sep] if scheme_sep > 1 else "file"
|
39
|
+
if scheme != "file":
|
40
|
+
return config_path
|
33
41
|
|
34
42
|
if _pathlib.Path(config_path).is_absolute():
|
35
43
|
return config_path
|
@@ -53,10 +61,16 @@ def _resolve_config_file(
|
|
53
61
|
return _pathlib.Path(config_path)
|
54
62
|
|
55
63
|
|
64
|
+
def _optional_arg(launch_args: _tp.Dict[str, _tp.Any], arg_name: str) -> _tp.Any:
|
65
|
+
|
66
|
+
return launch_args.get(arg_name, None)
|
67
|
+
|
68
|
+
|
56
69
|
def launch_model(
|
57
70
|
model_class: _api.TracModel.__class__,
|
58
71
|
job_config: _tp.Union[str, _pathlib.Path],
|
59
|
-
sys_config: _tp.Union[str, _pathlib.Path]
|
72
|
+
sys_config: _tp.Union[str, _pathlib.Path],
|
73
|
+
**launch_args):
|
60
74
|
|
61
75
|
"""
|
62
76
|
Launch an individual model using its Python class
|
@@ -77,6 +91,7 @@ def launch_model(
|
|
77
91
|
:param model_class: The model class that will be launched
|
78
92
|
:param job_config: Path to the job configuration file
|
79
93
|
:param sys_config: Path to the system configuration file
|
94
|
+
:param launch_args: Additional keyword args to control behavior of the TRAC runtime (not normally required)
|
80
95
|
"""
|
81
96
|
|
82
97
|
model_file = _inspect.getfile(model_class)
|
@@ -85,7 +100,10 @@ def launch_model(
|
|
85
100
|
_sys_config = _resolve_config_file(sys_config, model_dir)
|
86
101
|
_job_config = _resolve_config_file(job_config, model_dir)
|
87
102
|
|
88
|
-
|
103
|
+
plugin_package = _optional_arg(launch_args, 'plugin_package')
|
104
|
+
plugin_packages = [plugin_package] if plugin_package else None
|
105
|
+
|
106
|
+
runtime_instance = _runtime.TracRuntime(_sys_config, dev_mode=True, plugin_packages=plugin_packages)
|
89
107
|
runtime_instance.pre_start()
|
90
108
|
|
91
109
|
job = runtime_instance.load_job_config(_job_config, model_class=model_class)
|
@@ -98,7 +116,8 @@ def launch_model(
|
|
98
116
|
def launch_job(
|
99
117
|
job_config: _tp.Union[str, _pathlib.Path],
|
100
118
|
sys_config: _tp.Union[str, _pathlib.Path],
|
101
|
-
dev_mode: bool = False
|
119
|
+
dev_mode: bool = False,
|
120
|
+
**launch_args):
|
102
121
|
|
103
122
|
"""
|
104
123
|
Launch a TRAC job using external configuration files
|
@@ -106,12 +125,16 @@ def launch_job(
|
|
106
125
|
:param job_config: Path to the job configuration file
|
107
126
|
:param sys_config: Path to the system configuration file
|
108
127
|
:param dev_mode: Whether to launch in dev mode (applies dev mode translation to the job inputs)
|
128
|
+
:param launch_args: Additional keyword args to control behavior of the TRAC runtime (not normally required)
|
109
129
|
"""
|
110
130
|
|
111
131
|
_sys_config = _resolve_config_file(sys_config, None)
|
112
132
|
_job_config = _resolve_config_file(job_config, None)
|
113
133
|
|
114
|
-
|
134
|
+
plugin_package = _optional_arg(launch_args, 'plugin_package')
|
135
|
+
plugin_packages = [plugin_package] if plugin_package else None
|
136
|
+
|
137
|
+
runtime_instance = _runtime.TracRuntime(_sys_config, dev_mode=dev_mode, plugin_packages=plugin_packages)
|
115
138
|
runtime_instance.pre_start()
|
116
139
|
|
117
140
|
job = runtime_instance.load_job_config(_job_config)
|
@@ -121,16 +144,23 @@ def launch_job(
|
|
121
144
|
rt.wait_for_job(job.jobId)
|
122
145
|
|
123
146
|
|
124
|
-
def launch_cli():
|
147
|
+
def launch_cli(programmatic_args: _tp.Optional[_tp.List[str]] = None):
|
125
148
|
|
126
149
|
"""
|
127
150
|
Launch the TRAC runtime using the command line interface
|
151
|
+
|
152
|
+
CLI arguments are read from the process command line by default. To pass CLI args
|
153
|
+
explicitly, provide the list of arguments using the programmatic_args parameter.
|
154
|
+
|
155
|
+
:param programmatic_args: Optional parameter to pass CLI args explicitly in code
|
128
156
|
"""
|
129
157
|
|
130
|
-
|
158
|
+
if programmatic_args:
|
159
|
+
launch_args = _cli_args(programmatic_args)
|
160
|
+
else:
|
161
|
+
launch_args = _cli_args()
|
131
162
|
|
132
163
|
_sys_config = _resolve_config_file(launch_args.sys_config, None)
|
133
|
-
_job_config = _resolve_config_file(launch_args.job_config, None)
|
134
164
|
|
135
165
|
runtime_instance = _runtime.TracRuntime(
|
136
166
|
_sys_config,
|
@@ -138,12 +168,23 @@ def launch_cli():
|
|
138
168
|
job_result_dir=launch_args.job_result_dir,
|
139
169
|
job_result_format=launch_args.job_result_format,
|
140
170
|
scratch_dir=launch_args.scratch_dir,
|
141
|
-
scratch_dir_persist=launch_args.scratch_dir_persist
|
171
|
+
scratch_dir_persist=launch_args.scratch_dir_persist,
|
172
|
+
plugin_packages=launch_args.plugin_packages)
|
142
173
|
|
143
174
|
runtime_instance.pre_start()
|
144
175
|
|
145
|
-
|
176
|
+
if launch_args.job_config is not None:
|
177
|
+
_job_config = _resolve_config_file(launch_args.job_config, None)
|
178
|
+
job = runtime_instance.load_job_config(_job_config)
|
179
|
+
else:
|
180
|
+
job = None
|
146
181
|
|
147
182
|
with runtime_instance as rt:
|
148
|
-
|
149
|
-
|
183
|
+
|
184
|
+
if job is not None:
|
185
|
+
rt.submit_job(job)
|
186
|
+
|
187
|
+
if rt.is_oneshot():
|
188
|
+
rt.wait_for_job(job.jobId)
|
189
|
+
else:
|
190
|
+
rt.run_until_done()
|
tracdap/rt/metadata/__init__.py
CHANGED
@@ -13,10 +13,6 @@ from .object_id import ObjectType
|
|
13
13
|
from .object_id import TagHeader
|
14
14
|
from .object_id import TagSelector
|
15
15
|
|
16
|
-
from .file import FileDefinition
|
17
|
-
|
18
|
-
from .custom import CustomDefinition
|
19
|
-
|
20
16
|
from .data import SchemaType
|
21
17
|
from .data import PartType
|
22
18
|
from .data import FieldSchema
|
@@ -25,6 +21,13 @@ from .data import SchemaDefinition
|
|
25
21
|
from .data import PartKey
|
26
22
|
from .data import DataDefinition
|
27
23
|
|
24
|
+
from .stoarge import CopyStatus
|
25
|
+
from .stoarge import IncarnationStatus
|
26
|
+
from .stoarge import StorageCopy
|
27
|
+
from .stoarge import StorageIncarnation
|
28
|
+
from .stoarge import StorageItem
|
29
|
+
from .stoarge import StorageDefinition
|
30
|
+
|
28
31
|
from .model import ModelParameter
|
29
32
|
from .model import ModelInputSchema
|
30
33
|
from .model import ModelOutputSchema
|
@@ -33,6 +36,15 @@ from .model import ModelDefinition
|
|
33
36
|
from .tag_update import TagOperation
|
34
37
|
from .tag_update import TagUpdate
|
35
38
|
|
39
|
+
from .job import JobType
|
40
|
+
from .job import JobStatusCode
|
41
|
+
from .job import JobDefinition
|
42
|
+
from .job import RunModelJob
|
43
|
+
from .job import RunFlowJob
|
44
|
+
from .job import ImportModelJob
|
45
|
+
|
46
|
+
from .file import FileDefinition
|
47
|
+
|
36
48
|
from .search import SearchOperator
|
37
49
|
from .search import LogicalOperator
|
38
50
|
from .search import SearchTerm
|
@@ -46,19 +58,7 @@ from .flow import FlowSocket
|
|
46
58
|
from .flow import FlowEdge
|
47
59
|
from .flow import FlowDefinition
|
48
60
|
|
49
|
-
from .
|
50
|
-
from .job import JobStatusCode
|
51
|
-
from .job import JobDefinition
|
52
|
-
from .job import RunModelJob
|
53
|
-
from .job import RunFlowJob
|
54
|
-
from .job import ImportModelJob
|
55
|
-
|
56
|
-
from .stoarge import CopyStatus
|
57
|
-
from .stoarge import IncarnationStatus
|
58
|
-
from .stoarge import StorageCopy
|
59
|
-
from .stoarge import StorageIncarnation
|
60
|
-
from .stoarge import StorageItem
|
61
|
-
from .stoarge import StorageDefinition
|
61
|
+
from .custom import CustomDefinition
|
62
62
|
|
63
63
|
from .object import ObjectDefinition
|
64
64
|
|
tracdap/rt/metadata/common.py
CHANGED
@@ -49,10 +49,10 @@ class TenantInfo:
|
|
49
49
|
|
50
50
|
"""Information about a tenant that is set up on the TRAC platform."""
|
51
51
|
|
52
|
-
tenantCode: str =
|
52
|
+
tenantCode: str = ""
|
53
53
|
|
54
54
|
"""* Unique code used to identify the tenant, required by most API calls."""
|
55
55
|
|
56
|
-
description: str =
|
56
|
+
description: str = ""
|
57
57
|
|
58
58
|
"""* A short description of the tenant, suitable for displaying to users in lists."""
|
tracdap/rt/metadata/custom.py
CHANGED
@@ -11,8 +11,8 @@ class CustomDefinition:
|
|
11
11
|
|
12
12
|
"""Define a custom object that can be stored and managed in the TRAC metadata store"""
|
13
13
|
|
14
|
-
customSchemaType: str =
|
14
|
+
customSchemaType: str = ""
|
15
15
|
|
16
|
-
customSchemaVersion: int =
|
16
|
+
customSchemaVersion: int = 0
|
17
17
|
|
18
|
-
customData: bytes =
|
18
|
+
customData: bytes = b""
|
tracdap/rt/metadata/data.py
CHANGED
@@ -54,17 +54,17 @@ class FieldSchema:
|
|
54
54
|
:class:`TableSchema <TableSchema>`
|
55
55
|
"""
|
56
56
|
|
57
|
-
fieldName: str =
|
57
|
+
fieldName: str = ""
|
58
58
|
|
59
|
-
fieldOrder: int =
|
59
|
+
fieldOrder: int = 0
|
60
60
|
|
61
61
|
fieldType: BasicType = BasicType.BASIC_TYPE_NOT_SET
|
62
62
|
|
63
|
-
label: str =
|
63
|
+
label: str = ""
|
64
64
|
|
65
|
-
businessKey: bool =
|
65
|
+
businessKey: bool = False
|
66
66
|
|
67
|
-
categorical: bool =
|
67
|
+
categorical: bool = False
|
68
68
|
|
69
69
|
notNull: _tp.Optional[bool] = None
|
70
70
|
|
@@ -110,7 +110,7 @@ class PartKey:
|
|
110
110
|
|
111
111
|
"""Partition key for tabular datasets"""
|
112
112
|
|
113
|
-
opaqueKey: str =
|
113
|
+
opaqueKey: str = ""
|
114
114
|
|
115
115
|
partType: PartType = PartType.PART_ROOT
|
116
116
|
|
@@ -129,23 +129,23 @@ class DataDefinition:
|
|
129
129
|
@_dc.dataclass
|
130
130
|
class Delta:
|
131
131
|
|
132
|
-
deltaIndex: int =
|
132
|
+
deltaIndex: int = 0
|
133
133
|
|
134
|
-
dataItem: str =
|
134
|
+
dataItem: str = ""
|
135
135
|
|
136
136
|
@_dc.dataclass
|
137
137
|
class Snap:
|
138
138
|
|
139
|
-
snapIndex: int =
|
139
|
+
snapIndex: int = 0
|
140
140
|
|
141
141
|
deltas: _tp.List[DataDefinition.Delta] = _dc.field(default_factory=list)
|
142
142
|
|
143
143
|
@_dc.dataclass
|
144
144
|
class Part:
|
145
145
|
|
146
|
-
partKey: PartKey =
|
146
|
+
partKey: PartKey = _dc.field(default_factory=lambda: PartKey())
|
147
147
|
|
148
|
-
snap: DataDefinition.Snap =
|
148
|
+
snap: DataDefinition.Snap = _dc.field(default_factory=lambda: DataDefinition.Snap())
|
149
149
|
|
150
150
|
schemaId: _tp.Optional[TagSelector] = None
|
151
151
|
|
@@ -153,4 +153,4 @@ class DataDefinition:
|
|
153
153
|
|
154
154
|
parts: _tp.Dict[str, DataDefinition.Part] = _dc.field(default_factory=dict)
|
155
155
|
|
156
|
-
storageId: TagSelector =
|
156
|
+
storageId: TagSelector = _dc.field(default_factory=lambda: TagSelector())
|
tracdap/rt/metadata/file.py
CHANGED
@@ -14,14 +14,14 @@ class FileDefinition:
|
|
14
14
|
|
15
15
|
"""Describes a file object stored in the TRAC platform"""
|
16
16
|
|
17
|
-
name: str =
|
17
|
+
name: str = ""
|
18
18
|
|
19
|
-
extension: str =
|
19
|
+
extension: str = ""
|
20
20
|
|
21
|
-
mimeType: str =
|
21
|
+
mimeType: str = ""
|
22
22
|
|
23
|
-
size: int =
|
23
|
+
size: int = 0
|
24
24
|
|
25
|
-
storageId: TagSelector =
|
25
|
+
storageId: TagSelector = _dc.field(default_factory=lambda: TagSelector())
|
26
26
|
|
27
|
-
dataItem: str =
|
27
|
+
dataItem: str = ""
|
tracdap/rt/metadata/flow.py
CHANGED
@@ -59,13 +59,13 @@ class FlowNode:
|
|
59
59
|
|
60
60
|
outputs: _tp.List[str] = _dc.field(default_factory=list)
|
61
61
|
|
62
|
-
nodeSearch: SearchExpression =
|
62
|
+
nodeSearch: SearchExpression = _dc.field(default_factory=lambda: SearchExpression())
|
63
63
|
|
64
64
|
nodeAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
|
65
65
|
|
66
66
|
nodeProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
67
67
|
|
68
|
-
label: str =
|
68
|
+
label: str = ""
|
69
69
|
|
70
70
|
|
71
71
|
@_dc.dataclass
|
@@ -85,9 +85,9 @@ class FlowSocket:
|
|
85
85
|
:class:`FlowEdge <FlowEdge>`
|
86
86
|
"""
|
87
87
|
|
88
|
-
node: str =
|
88
|
+
node: str = ""
|
89
89
|
|
90
|
-
socket: str =
|
90
|
+
socket: str = ""
|
91
91
|
|
92
92
|
|
93
93
|
@_dc.dataclass
|
@@ -100,9 +100,9 @@ class FlowEdge:
|
|
100
100
|
:class:`FlowSocket <FlowSocket>`
|
101
101
|
"""
|
102
102
|
|
103
|
-
source: FlowSocket =
|
103
|
+
source: FlowSocket = _dc.field(default_factory=lambda: FlowSocket())
|
104
104
|
|
105
|
-
target: FlowSocket =
|
105
|
+
target: FlowSocket = _dc.field(default_factory=lambda: FlowSocket())
|
106
106
|
|
107
107
|
|
108
108
|
@_dc.dataclass
|
tracdap/rt/metadata/job.py
CHANGED
@@ -99,7 +99,7 @@ class RunModelJob:
|
|
99
99
|
|
100
100
|
"""Specification for a RuN_MODEL job"""
|
101
101
|
|
102
|
-
model: TagSelector =
|
102
|
+
model: TagSelector = _dc.field(default_factory=lambda: TagSelector())
|
103
103
|
|
104
104
|
parameters: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
105
105
|
|
@@ -117,7 +117,7 @@ class RunFlowJob:
|
|
117
117
|
|
118
118
|
"""Specification for a RUN_FLOW job"""
|
119
119
|
|
120
|
-
flow: TagSelector =
|
120
|
+
flow: TagSelector = _dc.field(default_factory=lambda: TagSelector())
|
121
121
|
|
122
122
|
parameters: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
123
123
|
|
@@ -137,18 +137,18 @@ class ImportModelJob:
|
|
137
137
|
|
138
138
|
"""Specification for an IMPORT_MODEL job"""
|
139
139
|
|
140
|
-
language: str =
|
140
|
+
language: str = ""
|
141
141
|
|
142
|
-
repository: str =
|
142
|
+
repository: str = ""
|
143
143
|
|
144
144
|
packageGroup: _tp.Optional[str] = None
|
145
145
|
|
146
|
-
package: str =
|
146
|
+
package: str = ""
|
147
147
|
|
148
|
-
version: str =
|
148
|
+
version: str = ""
|
149
149
|
|
150
|
-
entryPoint: str =
|
150
|
+
entryPoint: str = ""
|
151
151
|
|
152
|
-
path: str =
|
152
|
+
path: str = ""
|
153
153
|
|
154
154
|
modelAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
|
tracdap/rt/metadata/model.py
CHANGED
@@ -15,12 +15,14 @@ class ModelParameter:
|
|
15
15
|
|
16
16
|
"""Describes an individual parameter of a model"""
|
17
17
|
|
18
|
-
paramType: TypeDescriptor =
|
18
|
+
paramType: TypeDescriptor = _dc.field(default_factory=lambda: TypeDescriptor())
|
19
19
|
|
20
|
-
label: str =
|
20
|
+
label: str = ""
|
21
21
|
|
22
22
|
defaultValue: _tp.Optional[Value] = None
|
23
23
|
|
24
|
+
paramProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
25
|
+
|
24
26
|
|
25
27
|
@_dc.dataclass
|
26
28
|
class ModelInputSchema:
|
@@ -37,11 +39,15 @@ class ModelInputSchema:
|
|
37
39
|
other options may be required. These capabilities may be added in future releases.
|
38
40
|
"""
|
39
41
|
|
40
|
-
schema: SchemaDefinition =
|
42
|
+
schema: SchemaDefinition = _dc.field(default_factory=lambda: SchemaDefinition())
|
41
43
|
|
42
44
|
label: _tp.Optional[str] = None
|
43
45
|
|
44
|
-
optional: bool =
|
46
|
+
optional: bool = False
|
47
|
+
|
48
|
+
dynamic: bool = False
|
49
|
+
|
50
|
+
inputProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
45
51
|
|
46
52
|
|
47
53
|
@_dc.dataclass
|
@@ -60,11 +66,15 @@ class ModelOutputSchema:
|
|
60
66
|
added in future releases.
|
61
67
|
"""
|
62
68
|
|
63
|
-
schema: SchemaDefinition =
|
69
|
+
schema: SchemaDefinition = _dc.field(default_factory=lambda: SchemaDefinition())
|
64
70
|
|
65
71
|
label: _tp.Optional[str] = None
|
66
72
|
|
67
|
-
optional: bool =
|
73
|
+
optional: bool = False
|
74
|
+
|
75
|
+
dynamic: bool = False
|
76
|
+
|
77
|
+
outputProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
68
78
|
|
69
79
|
|
70
80
|
@_dc.dataclass
|
@@ -72,17 +82,17 @@ class ModelDefinition:
|
|
72
82
|
|
73
83
|
"""Define a model for execution on the TRAC platform"""
|
74
84
|
|
75
|
-
language: str =
|
85
|
+
language: str = ""
|
76
86
|
|
77
|
-
repository: str =
|
87
|
+
repository: str = ""
|
78
88
|
|
79
89
|
packageGroup: _tp.Optional[str] = None
|
80
90
|
|
81
|
-
package: str =
|
91
|
+
package: str = ""
|
82
92
|
|
83
|
-
version: str =
|
93
|
+
version: str = ""
|
84
94
|
|
85
|
-
entryPoint: str =
|
95
|
+
entryPoint: str = ""
|
86
96
|
|
87
97
|
path: _tp.Optional[str] = None
|
88
98
|
|
tracdap/rt/metadata/object.py
CHANGED
@@ -6,6 +6,7 @@ import dataclasses as _dc # noqa
|
|
6
6
|
import enum as _enum # noqa
|
7
7
|
|
8
8
|
from .object_id import * # noqa
|
9
|
+
from .type import * # noqa
|
9
10
|
from .data import * # noqa
|
10
11
|
from .model import * # noqa
|
11
12
|
from .flow import * # noqa
|
@@ -69,3 +70,5 @@ class ObjectDefinition:
|
|
69
70
|
storage: _tp.Optional[StorageDefinition] = None
|
70
71
|
|
71
72
|
schema: _tp.Optional[SchemaDefinition] = None
|
73
|
+
|
74
|
+
objectProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
|
tracdap/rt/metadata/object_id.py
CHANGED
@@ -56,7 +56,7 @@ class TagHeader:
|
|
56
56
|
:class:`ObjectType <ObjectType>`
|
57
57
|
"""
|
58
58
|
|
59
|
-
objectId: str =
|
59
|
+
objectId: str = ""
|
60
60
|
|
61
61
|
"""
|
62
62
|
Object ID of the object this tag is associated with.
|
@@ -64,27 +64,27 @@ class TagHeader:
|
|
64
64
|
Object IDs are UUIDs (RFC4122, https://www.ietf.org/rfc/rfc4122.txt)
|
65
65
|
"""
|
66
66
|
|
67
|
-
objectVersion: int =
|
67
|
+
objectVersion: int = 0
|
68
68
|
|
69
69
|
"""Version of the object this tag is associated with."""
|
70
70
|
|
71
|
-
objectTimestamp: DatetimeValue =
|
71
|
+
objectTimestamp: DatetimeValue = _dc.field(default_factory=lambda: DatetimeValue())
|
72
72
|
|
73
73
|
"""Timestamp for when this version of the object was created."""
|
74
74
|
|
75
|
-
tagVersion: int =
|
75
|
+
tagVersion: int = 0
|
76
76
|
|
77
77
|
"""Version of this tag."""
|
78
78
|
|
79
|
-
tagTimestamp: DatetimeValue =
|
79
|
+
tagTimestamp: DatetimeValue = _dc.field(default_factory=lambda: DatetimeValue())
|
80
80
|
|
81
81
|
"""Timestamp for when this version of the tag was created."""
|
82
82
|
|
83
|
-
isLatestObject: bool =
|
83
|
+
isLatestObject: bool = False
|
84
84
|
|
85
85
|
"""isLatest flag for the object the tag is associated with."""
|
86
86
|
|
87
|
-
isLatestTag: bool =
|
87
|
+
isLatestTag: bool = False
|
88
88
|
|
89
89
|
"""isLatest flag for the tag."""
|
90
90
|
|
@@ -132,7 +132,7 @@ class TagSelector:
|
|
132
132
|
:class:`ObjectType <ObjectType>`
|
133
133
|
"""
|
134
134
|
|
135
|
-
objectId: str =
|
135
|
+
objectId: str = ""
|
136
136
|
|
137
137
|
"""
|
138
138
|
Object ID of the tag being selected.
|