tracdap-runtime 0.6.1.dev3__py3-none-any.whl → 0.6.2__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/context.py +25 -1
- tracdap/rt/_exec/dev_mode.py +277 -213
- tracdap/rt/_exec/functions.py +37 -8
- tracdap/rt/_exec/graph.py +2 -0
- tracdap/rt/_exec/graph_builder.py +118 -56
- tracdap/rt/_exec/runtime.py +28 -0
- tracdap/rt/_exec/server.py +68 -0
- tracdap/rt/_impl/data.py +14 -0
- tracdap/rt/_impl/grpc/__init__.py +13 -0
- tracdap/rt/_impl/grpc/codec.py +44 -0
- tracdap/rt/_impl/grpc/tracdap/api/internal/runtime_pb2.py +51 -0
- tracdap/rt/_impl/grpc/tracdap/api/internal/runtime_pb2.pyi +59 -0
- tracdap/rt/_impl/grpc/tracdap/api/internal/runtime_pb2_grpc.py +183 -0
- tracdap/rt/_impl/grpc/tracdap/config/common_pb2.py +55 -0
- tracdap/rt/_impl/grpc/tracdap/config/common_pb2.pyi +103 -0
- tracdap/rt/_impl/grpc/tracdap/config/job_pb2.py +42 -0
- tracdap/rt/_impl/grpc/tracdap/config/job_pb2.pyi +44 -0
- tracdap/rt/_impl/grpc/tracdap/config/platform_pb2.py +71 -0
- tracdap/rt/_impl/grpc/tracdap/config/platform_pb2.pyi +197 -0
- tracdap/rt/_impl/grpc/tracdap/config/result_pb2.py +37 -0
- tracdap/rt/_impl/grpc/tracdap/config/result_pb2.pyi +35 -0
- tracdap/rt/_impl/grpc/tracdap/config/runtime_pb2.py +42 -0
- tracdap/rt/_impl/grpc/tracdap/config/runtime_pb2.pyi +46 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/common_pb2.py +33 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/common_pb2.pyi +34 -0
- tracdap/rt/{metadata → _impl/grpc/tracdap/metadata}/custom_pb2.py +5 -5
- tracdap/rt/_impl/grpc/tracdap/metadata/custom_pb2.pyi +15 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/data_pb2.py +51 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/data_pb2.pyi +115 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/file_pb2.py +28 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/file_pb2.pyi +22 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/flow_pb2.py +59 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/flow_pb2.pyi +109 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.py +76 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.pyi +177 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/model_pb2.py +51 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/model_pb2.pyi +92 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/object_id_pb2.py +32 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/object_id_pb2.pyi +68 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/object_pb2.py +35 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/object_pb2.pyi +35 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/search_pb2.py +39 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/search_pb2.pyi +83 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/stoarge_pb2.py +50 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/stoarge_pb2.pyi +89 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/tag_pb2.py +34 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/tag_pb2.pyi +26 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/tag_update_pb2.py +30 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/tag_update_pb2.pyi +34 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/type_pb2.py +47 -0
- tracdap/rt/_impl/grpc/tracdap/metadata/type_pb2.pyi +101 -0
- tracdap/rt/_impl/guard_rails.py +5 -6
- tracdap/rt/_impl/static_api.py +10 -6
- tracdap/rt/_version.py +1 -1
- tracdap/rt/api/hook.py +6 -2
- tracdap/rt/api/model_api.py +22 -0
- tracdap/rt/api/static_api.py +14 -4
- tracdap/rt/config/__init__.py +3 -3
- tracdap/rt/config/platform.py +9 -9
- tracdap/rt/launch/cli.py +3 -5
- tracdap/rt/launch/launch.py +15 -3
- tracdap/rt/metadata/__init__.py +15 -15
- tracdap/rt/metadata/common.py +7 -7
- tracdap/rt/metadata/custom.py +2 -0
- tracdap/rt/metadata/data.py +28 -5
- tracdap/rt/metadata/file.py +2 -0
- tracdap/rt/metadata/flow.py +66 -4
- tracdap/rt/metadata/job.py +56 -16
- tracdap/rt/metadata/model.py +4 -0
- tracdap/rt/metadata/object_id.py +9 -9
- tracdap/rt/metadata/search.py +35 -13
- tracdap/rt/metadata/stoarge.py +64 -6
- tracdap/rt/metadata/tag_update.py +21 -7
- tracdap/rt/metadata/type.py +28 -13
- {tracdap_runtime-0.6.1.dev3.dist-info → tracdap_runtime-0.6.2.dist-info}/METADATA +22 -19
- tracdap_runtime-0.6.2.dist-info/RECORD +121 -0
- {tracdap_runtime-0.6.1.dev3.dist-info → tracdap_runtime-0.6.2.dist-info}/WHEEL +1 -1
- tracdap/rt/config/common_pb2.py +0 -55
- tracdap/rt/config/job_pb2.py +0 -42
- tracdap/rt/config/platform_pb2.py +0 -71
- tracdap/rt/config/result_pb2.py +0 -37
- tracdap/rt/config/runtime_pb2.py +0 -42
- tracdap/rt/metadata/common_pb2.py +0 -33
- tracdap/rt/metadata/data_pb2.py +0 -51
- tracdap/rt/metadata/file_pb2.py +0 -28
- tracdap/rt/metadata/flow_pb2.py +0 -55
- tracdap/rt/metadata/job_pb2.py +0 -76
- tracdap/rt/metadata/model_pb2.py +0 -51
- tracdap/rt/metadata/object_id_pb2.py +0 -32
- tracdap/rt/metadata/object_pb2.py +0 -35
- tracdap/rt/metadata/search_pb2.py +0 -39
- tracdap/rt/metadata/stoarge_pb2.py +0 -50
- tracdap/rt/metadata/tag_pb2.py +0 -34
- tracdap/rt/metadata/tag_update_pb2.py +0 -30
- tracdap/rt/metadata/type_pb2.py +0 -48
- tracdap_runtime-0.6.1.dev3.dist-info/RECORD +0 -96
- {tracdap_runtime-0.6.1.dev3.dist-info → tracdap_runtime-0.6.2.dist-info}/LICENSE +0 -0
- {tracdap_runtime-0.6.1.dev3.dist-info → tracdap_runtime-0.6.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
from google.protobuf.internal import containers as _containers
|
2
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
4
|
+
from google.protobuf import message as _message
|
5
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
6
|
+
|
7
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
8
|
+
|
9
|
+
class BasicType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
10
|
+
__slots__ = ()
|
11
|
+
BASIC_TYPE_NOT_SET: _ClassVar[BasicType]
|
12
|
+
BOOLEAN: _ClassVar[BasicType]
|
13
|
+
INTEGER: _ClassVar[BasicType]
|
14
|
+
FLOAT: _ClassVar[BasicType]
|
15
|
+
STRING: _ClassVar[BasicType]
|
16
|
+
DECIMAL: _ClassVar[BasicType]
|
17
|
+
DATE: _ClassVar[BasicType]
|
18
|
+
DATETIME: _ClassVar[BasicType]
|
19
|
+
ARRAY: _ClassVar[BasicType]
|
20
|
+
MAP: _ClassVar[BasicType]
|
21
|
+
BASIC_TYPE_NOT_SET: BasicType
|
22
|
+
BOOLEAN: BasicType
|
23
|
+
INTEGER: BasicType
|
24
|
+
FLOAT: BasicType
|
25
|
+
STRING: BasicType
|
26
|
+
DECIMAL: BasicType
|
27
|
+
DATE: BasicType
|
28
|
+
DATETIME: BasicType
|
29
|
+
ARRAY: BasicType
|
30
|
+
MAP: BasicType
|
31
|
+
|
32
|
+
class TypeDescriptor(_message.Message):
|
33
|
+
__slots__ = ("basicType", "arrayType", "mapType")
|
34
|
+
BASICTYPE_FIELD_NUMBER: _ClassVar[int]
|
35
|
+
ARRAYTYPE_FIELD_NUMBER: _ClassVar[int]
|
36
|
+
MAPTYPE_FIELD_NUMBER: _ClassVar[int]
|
37
|
+
basicType: BasicType
|
38
|
+
arrayType: TypeDescriptor
|
39
|
+
mapType: TypeDescriptor
|
40
|
+
def __init__(self, basicType: _Optional[_Union[BasicType, str]] = ..., arrayType: _Optional[_Union[TypeDescriptor, _Mapping]] = ..., mapType: _Optional[_Union[TypeDescriptor, _Mapping]] = ...) -> None: ...
|
41
|
+
|
42
|
+
class DecimalValue(_message.Message):
|
43
|
+
__slots__ = ("decimal",)
|
44
|
+
DECIMAL_FIELD_NUMBER: _ClassVar[int]
|
45
|
+
decimal: str
|
46
|
+
def __init__(self, decimal: _Optional[str] = ...) -> None: ...
|
47
|
+
|
48
|
+
class DateValue(_message.Message):
|
49
|
+
__slots__ = ("isoDate",)
|
50
|
+
ISODATE_FIELD_NUMBER: _ClassVar[int]
|
51
|
+
isoDate: str
|
52
|
+
def __init__(self, isoDate: _Optional[str] = ...) -> None: ...
|
53
|
+
|
54
|
+
class DatetimeValue(_message.Message):
|
55
|
+
__slots__ = ("isoDatetime",)
|
56
|
+
ISODATETIME_FIELD_NUMBER: _ClassVar[int]
|
57
|
+
isoDatetime: str
|
58
|
+
def __init__(self, isoDatetime: _Optional[str] = ...) -> None: ...
|
59
|
+
|
60
|
+
class Value(_message.Message):
|
61
|
+
__slots__ = ("type", "booleanValue", "integerValue", "floatValue", "stringValue", "decimalValue", "dateValue", "datetimeValue", "arrayValue", "mapValue")
|
62
|
+
TYPE_FIELD_NUMBER: _ClassVar[int]
|
63
|
+
BOOLEANVALUE_FIELD_NUMBER: _ClassVar[int]
|
64
|
+
INTEGERVALUE_FIELD_NUMBER: _ClassVar[int]
|
65
|
+
FLOATVALUE_FIELD_NUMBER: _ClassVar[int]
|
66
|
+
STRINGVALUE_FIELD_NUMBER: _ClassVar[int]
|
67
|
+
DECIMALVALUE_FIELD_NUMBER: _ClassVar[int]
|
68
|
+
DATEVALUE_FIELD_NUMBER: _ClassVar[int]
|
69
|
+
DATETIMEVALUE_FIELD_NUMBER: _ClassVar[int]
|
70
|
+
ARRAYVALUE_FIELD_NUMBER: _ClassVar[int]
|
71
|
+
MAPVALUE_FIELD_NUMBER: _ClassVar[int]
|
72
|
+
type: TypeDescriptor
|
73
|
+
booleanValue: bool
|
74
|
+
integerValue: int
|
75
|
+
floatValue: float
|
76
|
+
stringValue: str
|
77
|
+
decimalValue: DecimalValue
|
78
|
+
dateValue: DateValue
|
79
|
+
datetimeValue: DatetimeValue
|
80
|
+
arrayValue: ArrayValue
|
81
|
+
mapValue: MapValue
|
82
|
+
def __init__(self, type: _Optional[_Union[TypeDescriptor, _Mapping]] = ..., booleanValue: bool = ..., integerValue: _Optional[int] = ..., floatValue: _Optional[float] = ..., stringValue: _Optional[str] = ..., decimalValue: _Optional[_Union[DecimalValue, _Mapping]] = ..., dateValue: _Optional[_Union[DateValue, _Mapping]] = ..., datetimeValue: _Optional[_Union[DatetimeValue, _Mapping]] = ..., arrayValue: _Optional[_Union[ArrayValue, _Mapping]] = ..., mapValue: _Optional[_Union[MapValue, _Mapping]] = ...) -> None: ...
|
83
|
+
|
84
|
+
class ArrayValue(_message.Message):
|
85
|
+
__slots__ = ("items",)
|
86
|
+
ITEMS_FIELD_NUMBER: _ClassVar[int]
|
87
|
+
items: _containers.RepeatedCompositeFieldContainer[Value]
|
88
|
+
def __init__(self, items: _Optional[_Iterable[_Union[Value, _Mapping]]] = ...) -> None: ...
|
89
|
+
|
90
|
+
class MapValue(_message.Message):
|
91
|
+
__slots__ = ("entries",)
|
92
|
+
class EntriesEntry(_message.Message):
|
93
|
+
__slots__ = ("key", "value")
|
94
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
95
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
96
|
+
key: str
|
97
|
+
value: Value
|
98
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Value, _Mapping]] = ...) -> None: ...
|
99
|
+
ENTRIES_FIELD_NUMBER: _ClassVar[int]
|
100
|
+
entries: _containers.MessageMap[str, Value]
|
101
|
+
def __init__(self, entries: _Optional[_Mapping[str, Value]] = ...) -> None: ...
|
tracdap/rt/_impl/guard_rails.py
CHANGED
@@ -258,14 +258,13 @@ class PythonGuardRails:
|
|
258
258
|
@classmethod
|
259
259
|
def is_debug(cls):
|
260
260
|
|
261
|
-
|
261
|
+
has_trace = hasattr(sys, 'gettrace') and sys.gettrace() is not None
|
262
|
+
has_breakpoint = sys.breakpointhook.__module__ != "sys"
|
262
263
|
|
263
|
-
if
|
264
|
-
return
|
264
|
+
if has_trace or has_breakpoint:
|
265
|
+
return True
|
265
266
|
|
266
|
-
|
267
|
-
trace = get_trace_func()
|
268
|
-
return trace is not None
|
267
|
+
return False
|
269
268
|
|
270
269
|
@classmethod
|
271
270
|
def is_import(cls):
|
tracdap/rt/_impl/static_api.py
CHANGED
@@ -147,22 +147,26 @@ class StaticApiImpl(_StaticApiHook):
|
|
147
147
|
return _schemas.SchemaLoader.load_schema(package, schema_file)
|
148
148
|
|
149
149
|
def define_input_table(
|
150
|
-
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
150
|
+
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
151
|
+
label: _tp.Optional[str] = None,
|
152
|
+
optional: bool = False) \
|
151
153
|
-> _meta.ModelInputSchema:
|
152
154
|
|
153
|
-
_val.validate_signature(self.define_input_table, *fields, label=label)
|
155
|
+
_val.validate_signature(self.define_input_table, *fields, label=label, optional=optional)
|
154
156
|
|
155
157
|
schema_def = self.define_schema(*fields, schema_type=_meta.SchemaType.TABLE)
|
156
|
-
return _meta.ModelInputSchema(schema=schema_def, label=label)
|
158
|
+
return _meta.ModelInputSchema(schema=schema_def, label=label, optional=optional)
|
157
159
|
|
158
160
|
def define_output_table(
|
159
|
-
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
161
|
+
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
162
|
+
label: _tp.Optional[str] = None,
|
163
|
+
optional: bool = False) \
|
160
164
|
-> _meta.ModelOutputSchema:
|
161
165
|
|
162
|
-
_val.validate_signature(self.define_output_table, *fields, label=label)
|
166
|
+
_val.validate_signature(self.define_output_table, *fields, label=label, optional=optional)
|
163
167
|
|
164
168
|
schema_def = self.define_schema(*fields, schema_type=_meta.SchemaType.TABLE)
|
165
|
-
return _meta.ModelOutputSchema(schema=schema_def, label=label)
|
169
|
+
return _meta.ModelOutputSchema(schema=schema_def, label=label, optional=optional)
|
166
170
|
|
167
171
|
@staticmethod
|
168
172
|
def _build_named_dict(
|
tracdap/rt/_version.py
CHANGED
tracdap/rt/api/hook.py
CHANGED
@@ -119,14 +119,18 @@ class _StaticApiHook:
|
|
119
119
|
|
120
120
|
@_abc.abstractmethod
|
121
121
|
def define_input_table(
|
122
|
-
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
122
|
+
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
123
|
+
label: _tp.Optional[str] = None,
|
124
|
+
optional: bool = False) \
|
123
125
|
-> _meta.ModelInputSchema:
|
124
126
|
|
125
127
|
pass
|
126
128
|
|
127
129
|
@_abc.abstractmethod
|
128
130
|
def define_output_table(
|
129
|
-
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
131
|
+
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
132
|
+
label: _tp.Optional[str] = None,
|
133
|
+
optional: bool = False) \
|
130
134
|
-> _meta.ModelOutputSchema:
|
131
135
|
|
132
136
|
pass
|
tracdap/rt/api/model_api.py
CHANGED
@@ -72,6 +72,28 @@ class TracContext:
|
|
72
72
|
|
73
73
|
pass
|
74
74
|
|
75
|
+
@_abc.abstractmethod
|
76
|
+
def has_dataset(self, dataset_name: str) -> bool:
|
77
|
+
|
78
|
+
"""
|
79
|
+
Check whether a dataset is available in the current context
|
80
|
+
|
81
|
+
This method can be used to check whether optional model inputs have been supplied or not.
|
82
|
+
Models should use this method before calling get methods on optional inputs.
|
83
|
+
For inputs not marked as optional, this method will always return true. For outputs,
|
84
|
+
this method will return true after the model calls a put method for the dataset.
|
85
|
+
|
86
|
+
A runtime validation error will be raised if the dataset name is not defined
|
87
|
+
as a model input or output.
|
88
|
+
|
89
|
+
:param dataset_name: The name of the dataset to check
|
90
|
+
:return: True if the dataset exists in the current context, False otherwise
|
91
|
+
:rtype: bool
|
92
|
+
:raises: :py:class:`ERuntimeValidation <tracdap.rt.exceptions.ERuntimeValidation>`
|
93
|
+
"""
|
94
|
+
|
95
|
+
pass
|
96
|
+
|
75
97
|
@_abc.abstractmethod
|
76
98
|
def get_schema(self, dataset_name: str) -> SchemaDefinition:
|
77
99
|
|
tracdap/rt/api/static_api.py
CHANGED
@@ -427,7 +427,9 @@ def load_schema(
|
|
427
427
|
|
428
428
|
|
429
429
|
def define_input_table(
|
430
|
-
*fields: _tp.Union[FieldSchema, _tp.List[FieldSchema]],
|
430
|
+
*fields: _tp.Union[FieldSchema, _tp.List[FieldSchema]],
|
431
|
+
label: _tp.Optional[str] = None,
|
432
|
+
optional: bool = False) \
|
431
433
|
-> ModelInputSchema:
|
432
434
|
|
433
435
|
"""
|
@@ -438,15 +440,18 @@ def define_input_table(
|
|
438
440
|
|
439
441
|
:param fields: A set of fields to make up a :py:class:`TableSchema <tracdap.rt.metadata.TableSchema>`
|
440
442
|
:param label: An optional label (of type str) for a model input schema. Default value: None.
|
443
|
+
:param optional: Mark this input as an optional model input
|
441
444
|
:return: A model input schema, suitable for returning from :py:meth:`TracModel.define_inputs`
|
442
445
|
|
443
446
|
:type fields: :py:class:`FieldSchema <tracdap.rt.metadata.FieldSchema>` |
|
444
447
|
List[:py:class:`FieldSchema <tracdap.rt.metadata.FieldSchema>`]
|
448
|
+
:type label: _tp.Optional[str]
|
449
|
+
:type optional: bool
|
445
450
|
:rtype: :py:class:`ModelInputSchema <tracdap.rt.metadata.ModelInputSchema>`
|
446
451
|
"""
|
447
452
|
|
448
453
|
sa = _StaticApiHook.get_instance()
|
449
|
-
return sa.define_input_table(*fields, label=label)
|
454
|
+
return sa.define_input_table(*fields, label=label, optional=optional)
|
450
455
|
|
451
456
|
|
452
457
|
def declare_input_table(
|
@@ -466,7 +471,9 @@ def declare_input_table(
|
|
466
471
|
|
467
472
|
|
468
473
|
def define_output_table(
|
469
|
-
*fields: _tp.Union[FieldSchema, _tp.List[FieldSchema]],
|
474
|
+
*fields: _tp.Union[FieldSchema, _tp.List[FieldSchema]],
|
475
|
+
label: _tp.Optional[str] = None,
|
476
|
+
optional: bool = False) \
|
470
477
|
-> ModelOutputSchema:
|
471
478
|
|
472
479
|
"""
|
@@ -477,15 +484,18 @@ def define_output_table(
|
|
477
484
|
|
478
485
|
:param fields: A set of fields to make up a :py:class:`TableSchema <tracdap.rt.metadata.TableSchema>`
|
479
486
|
:param label: An optional label (of type str) for a model output schema. Default value: None.
|
487
|
+
:param optional: Mark this output as an optional model output
|
480
488
|
:return: A model output schema, suitable for returning from :py:meth:`TracModel.define_outputs`
|
481
489
|
|
482
490
|
:type fields: :py:class:`FieldSchema <tracdap.rt.metadata.FieldSchema>` |
|
483
491
|
List[:py:class:`FieldSchema <tracdap.rt.metadata.FieldSchema>`]
|
492
|
+
:type label: _tp.Optional[str]
|
493
|
+
:type optional: bool
|
484
494
|
:rtype: :py:class:`ModelOutputSchema <tracdap.rt.metadata.ModelOutputSchema>`
|
485
495
|
"""
|
486
496
|
|
487
497
|
sa = _StaticApiHook.get_instance()
|
488
|
-
return sa.define_output_table(*fields, label=label)
|
498
|
+
return sa.define_output_table(*fields, label=label, optional=optional)
|
489
499
|
|
490
500
|
|
491
501
|
def declare_output_table(
|
tracdap/rt/config/__init__.py
CHANGED
@@ -9,6 +9,9 @@ from .common import StorageConfig
|
|
9
9
|
from .runtime import RuntimeConfig
|
10
10
|
from .runtime import SparkSettings
|
11
11
|
|
12
|
+
from .result import TagUpdateList
|
13
|
+
from .result import JobResult
|
14
|
+
|
12
15
|
from .platform import RoutingProtocol
|
13
16
|
from .platform import DeploymentLayout
|
14
17
|
from .platform import PlatformConfig
|
@@ -24,7 +27,4 @@ from .platform import RoutingTarget
|
|
24
27
|
from .platform import ServiceConfig
|
25
28
|
from .platform import DeploymentConfig
|
26
29
|
|
27
|
-
from .result import TagUpdateList
|
28
|
-
from .result import JobResult
|
29
|
-
|
30
30
|
from .job import JobConfig
|
tracdap/rt/config/platform.py
CHANGED
@@ -11,26 +11,26 @@ from .common import * # noqa
|
|
11
11
|
|
12
12
|
class RoutingProtocol(_enum.Enum):
|
13
13
|
|
14
|
-
PROTOCOL_NOT_SET = 0
|
14
|
+
PROTOCOL_NOT_SET = 0
|
15
15
|
|
16
|
-
HTTP = 1
|
16
|
+
HTTP = 1
|
17
17
|
|
18
|
-
GRPC = 2
|
18
|
+
GRPC = 2
|
19
19
|
|
20
|
-
GRPC_WEB = 3
|
20
|
+
GRPC_WEB = 3
|
21
21
|
|
22
|
-
REST = 4
|
22
|
+
REST = 4
|
23
23
|
|
24
24
|
|
25
25
|
class DeploymentLayout(_enum.Enum):
|
26
26
|
|
27
|
-
LAYOUT_NOT_SET = 0
|
27
|
+
LAYOUT_NOT_SET = 0
|
28
28
|
|
29
|
-
SANDBOX = 1
|
29
|
+
SANDBOX = 1
|
30
30
|
|
31
|
-
HOSTED = 2
|
31
|
+
HOSTED = 2
|
32
32
|
|
33
|
-
CUSTOM = 3
|
33
|
+
CUSTOM = 3
|
34
34
|
|
35
35
|
|
36
36
|
@_dc.dataclass
|
tracdap/rt/launch/cli.py
CHANGED
@@ -16,7 +16,7 @@ import argparse
|
|
16
16
|
import pathlib
|
17
17
|
|
18
18
|
|
19
|
-
def
|
19
|
+
def _cli_args():
|
20
20
|
|
21
21
|
parser = argparse.ArgumentParser(
|
22
22
|
prog="python -m tracdap.rt.launch",
|
@@ -45,12 +45,10 @@ def cli_args():
|
|
45
45
|
parser.add_argument(
|
46
46
|
"--scratch-dir", dest="scratch_dir", type=pathlib.Path, required=False,
|
47
47
|
help="Scratch directory for working files" +
|
48
|
-
" (if not supplied the system's temp location will be used)"
|
49
|
-
)
|
48
|
+
" (if not supplied the system's temp location will be used)")
|
50
49
|
|
51
50
|
parser.add_argument(
|
52
51
|
"--scratch-dir-persist", dest="scratch_dir_persist", default=False, action="store_true",
|
53
|
-
help="Do not clean up the scratch location on exit"
|
54
|
-
)
|
52
|
+
help="Do not clean up the scratch location on exit")
|
55
53
|
|
56
54
|
return parser.parse_args()
|
tracdap/rt/launch/launch.py
CHANGED
@@ -23,7 +23,7 @@ import tracdap.rt._impl.config_parser as _cparse # noqa
|
|
23
23
|
import tracdap.rt._impl.util as _util # noqa
|
24
24
|
import tracdap.rt._exec.runtime as _runtime # noqa
|
25
25
|
|
26
|
-
from .cli import
|
26
|
+
from .cli import _cli_args
|
27
27
|
|
28
28
|
|
29
29
|
def _resolve_config_file(
|
@@ -59,7 +59,7 @@ def launch_model(
|
|
59
59
|
sys_config: _tp.Union[str, _pathlib.Path]):
|
60
60
|
|
61
61
|
"""
|
62
|
-
Launch an individual model
|
62
|
+
Launch an individual model using its Python class
|
63
63
|
|
64
64
|
This launch method launches the supplied model class directly, it must be called
|
65
65
|
from the Python codebase containing the model class. The TRAC runtime will launch
|
@@ -100,6 +100,14 @@ def launch_job(
|
|
100
100
|
sys_config: _tp.Union[str, _pathlib.Path],
|
101
101
|
dev_mode: bool = False):
|
102
102
|
|
103
|
+
"""
|
104
|
+
Launch a TRAC job using external configuration files
|
105
|
+
|
106
|
+
:param job_config: Path to the job configuration file
|
107
|
+
:param sys_config: Path to the system configuration file
|
108
|
+
:param dev_mode: Whether to launch in dev mode (applies dev mode translation to the job inputs)
|
109
|
+
"""
|
110
|
+
|
103
111
|
_sys_config = _resolve_config_file(sys_config, None)
|
104
112
|
_job_config = _resolve_config_file(job_config, None)
|
105
113
|
|
@@ -115,7 +123,11 @@ def launch_job(
|
|
115
123
|
|
116
124
|
def launch_cli():
|
117
125
|
|
118
|
-
|
126
|
+
"""
|
127
|
+
Launch the TRAC runtime using the command line interface
|
128
|
+
"""
|
129
|
+
|
130
|
+
launch_args = _cli_args()
|
119
131
|
|
120
132
|
_sys_config = _resolve_config_file(launch_args.sys_config, None)
|
121
133
|
_job_config = _resolve_config_file(launch_args.job_config, None)
|
tracdap/rt/metadata/__init__.py
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
# Code generated by TRAC
|
2
2
|
|
3
|
-
from .custom import CustomDefinition
|
4
|
-
|
5
|
-
from .common import MetadataFormat
|
6
|
-
from .common import MetadataVersion
|
7
|
-
from .common import TenantInfo
|
8
|
-
|
9
3
|
from .type import BasicType
|
10
4
|
from .type import TypeDescriptor
|
11
5
|
from .type import DecimalValue
|
@@ -21,8 +15,7 @@ from .object_id import TagSelector
|
|
21
15
|
|
22
16
|
from .file import FileDefinition
|
23
17
|
|
24
|
-
from .
|
25
|
-
from .tag_update import TagUpdate
|
18
|
+
from .custom import CustomDefinition
|
26
19
|
|
27
20
|
from .data import SchemaType
|
28
21
|
from .data import PartType
|
@@ -37,6 +30,9 @@ from .model import ModelInputSchema
|
|
37
30
|
from .model import ModelOutputSchema
|
38
31
|
from .model import ModelDefinition
|
39
32
|
|
33
|
+
from .tag_update import TagOperation
|
34
|
+
from .tag_update import TagUpdate
|
35
|
+
|
40
36
|
from .search import SearchOperator
|
41
37
|
from .search import LogicalOperator
|
42
38
|
from .search import SearchTerm
|
@@ -50,13 +46,6 @@ from .flow import FlowSocket
|
|
50
46
|
from .flow import FlowEdge
|
51
47
|
from .flow import FlowDefinition
|
52
48
|
|
53
|
-
from .stoarge import CopyStatus
|
54
|
-
from .stoarge import IncarnationStatus
|
55
|
-
from .stoarge import StorageCopy
|
56
|
-
from .stoarge import StorageIncarnation
|
57
|
-
from .stoarge import StorageItem
|
58
|
-
from .stoarge import StorageDefinition
|
59
|
-
|
60
49
|
from .job import JobType
|
61
50
|
from .job import JobStatusCode
|
62
51
|
from .job import JobDefinition
|
@@ -64,6 +53,17 @@ from .job import RunModelJob
|
|
64
53
|
from .job import RunFlowJob
|
65
54
|
from .job import ImportModelJob
|
66
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
|
62
|
+
|
67
63
|
from .object import ObjectDefinition
|
68
64
|
|
69
65
|
from .tag import Tag
|
66
|
+
|
67
|
+
from .common import MetadataFormat
|
68
|
+
from .common import MetadataVersion
|
69
|
+
from .common import TenantInfo
|
tracdap/rt/metadata/common.py
CHANGED
@@ -14,13 +14,13 @@ class MetadataFormat(_enum.Enum):
|
|
14
14
|
metadata stored in the metadata database.
|
15
15
|
"""
|
16
16
|
|
17
|
-
METADATA_FORMAT_NOT_SET = 0
|
17
|
+
METADATA_FORMAT_NOT_SET = 0
|
18
18
|
|
19
|
-
PROTO = 1
|
19
|
+
PROTO = 1
|
20
20
|
|
21
|
-
JSON = 2
|
21
|
+
JSON = 2
|
22
22
|
|
23
|
-
YAML = 3
|
23
|
+
YAML = 3
|
24
24
|
|
25
25
|
|
26
26
|
class MetadataVersion(_enum.Enum):
|
@@ -37,11 +37,11 @@ class MetadataVersion(_enum.Enum):
|
|
37
37
|
or to run upgrades of metadata stored in an older metadata format.
|
38
38
|
"""
|
39
39
|
|
40
|
-
METADATA_VERSION_NOT_SET = 0
|
40
|
+
METADATA_VERSION_NOT_SET = 0
|
41
41
|
|
42
|
-
V1 = 1
|
42
|
+
V1 = 1
|
43
43
|
|
44
|
-
CURRENT = 1
|
44
|
+
CURRENT = 1
|
45
45
|
|
46
46
|
|
47
47
|
@_dc.dataclass
|
tracdap/rt/metadata/custom.py
CHANGED
tracdap/rt/metadata/data.py
CHANGED
@@ -20,23 +20,40 @@ class SchemaType(_enum.Enum):
|
|
20
20
|
:class:`SchemaDefinition <SchemaDefinition>`
|
21
21
|
"""
|
22
22
|
|
23
|
-
SCHEMA_TYPE_NOT_SET = 0
|
23
|
+
SCHEMA_TYPE_NOT_SET = 0
|
24
24
|
|
25
|
-
TABLE = 1
|
25
|
+
TABLE = 1
|
26
|
+
|
27
|
+
"""Tabular data"""
|
26
28
|
|
27
29
|
|
28
30
|
class PartType(_enum.Enum):
|
29
31
|
|
30
|
-
|
32
|
+
"""Partitioning scheme applied to a dataset"""
|
33
|
+
|
34
|
+
PART_ROOT = 0
|
35
|
+
|
36
|
+
"""Dataset has a single partition called the root partition (this is the default)"""
|
37
|
+
|
38
|
+
PART_BY_RANGE = 1
|
31
39
|
|
32
|
-
|
40
|
+
"""Partition by range over an ordered variable (not available yet)"""
|
33
41
|
|
34
|
-
PART_BY_VALUE = 2
|
42
|
+
PART_BY_VALUE = 2
|
43
|
+
|
44
|
+
"""Partition by value over a categorical variable (not available yet)"""
|
35
45
|
|
36
46
|
|
37
47
|
@_dc.dataclass
|
38
48
|
class FieldSchema:
|
39
49
|
|
50
|
+
"""
|
51
|
+
Schema for an individual field in a tabular dataset
|
52
|
+
|
53
|
+
.. seealso::
|
54
|
+
:class:`TableSchema <TableSchema>`
|
55
|
+
"""
|
56
|
+
|
40
57
|
fieldName: str = None
|
41
58
|
|
42
59
|
fieldOrder: int = None
|
@@ -59,6 +76,8 @@ class FieldSchema:
|
|
59
76
|
@_dc.dataclass
|
60
77
|
class TableSchema:
|
61
78
|
|
79
|
+
"""Schema for a tabular dataset"""
|
80
|
+
|
62
81
|
fields: _tp.List[FieldSchema] = _dc.field(default_factory=list)
|
63
82
|
|
64
83
|
|
@@ -89,6 +108,8 @@ class SchemaDefinition:
|
|
89
108
|
@_dc.dataclass
|
90
109
|
class PartKey:
|
91
110
|
|
111
|
+
"""Partition key for tabular datasets"""
|
112
|
+
|
92
113
|
opaqueKey: str = None
|
93
114
|
|
94
115
|
partType: PartType = PartType.PART_ROOT
|
@@ -103,6 +124,8 @@ class PartKey:
|
|
103
124
|
@_dc.dataclass
|
104
125
|
class DataDefinition:
|
105
126
|
|
127
|
+
"""Define a dataset that can be stored and managed in the TRAC platform"""
|
128
|
+
|
106
129
|
@_dc.dataclass
|
107
130
|
class Delta:
|
108
131
|
|