orca-python 0.3.0__tar.gz → 0.5.0__tar.gz
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.
- {orca_python-0.3.0 → orca_python-0.5.0}/PKG-INFO +1 -1
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/service_pb2.py +60 -58
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/service_pb2.pyi +4 -2
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/service_pb2_grpc.py +3 -9
- orca_python-0.5.0/orca_python/__init__.py +3 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca_python/main.py +74 -55
- {orca_python-0.3.0 → orca_python-0.5.0}/pyproject.toml +1 -1
- orca_python-0.3.0/orca_python/__init__.py +0 -3
- {orca_python-0.3.0 → orca_python-0.5.0}/LICENSE +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/README.md +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/__init__.py +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/vendor/__init__.py +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/vendor/validate_pb2.py +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/vendor/validate_pb2.pyi +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/vendor/validate_pb2_grpc.py +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca_python/envs.py +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca_python/exceptions.py +0 -0
- {orca_python-0.3.0 → orca_python-0.5.0}/orca_python/py.typed +0 -0
@@ -26,7 +26,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
26
26
|
from vendor import validate_pb2 as vendor_dot_validate__pb2
|
27
27
|
|
28
28
|
|
29
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rservice.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x15vendor/validate.proto\"\xb9\x02\n\x06Window\x12\x1d\n\ttime_from\x18\x01 \x01(\x04\x42\n\xbaH\x07\x32\x02 \x00\xc8\x01\x01\x12\x17\n\x07time_to\x18\x02 \x01(\x04\x42\x06\xbaH\x03\xc8\x01\x01\x12 \n\x10window_type_name\x18\x03 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12#\n\x13window_type_version\x18\x04 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x16\n\x06origin\x18\x05 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12)\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct:m\xbaHj\x1ah\n\x0ewindow.time_to\x12\x36`time_to` must be greater than or equal to `time_from`\x1a\x1ethis.time_to >= this.time_from\"
|
29
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rservice.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x15vendor/validate.proto\"\xb9\x02\n\x06Window\x12\x1d\n\ttime_from\x18\x01 \x01(\x04\x42\n\xbaH\x07\x32\x02 \x00\xc8\x01\x01\x12\x17\n\x07time_to\x18\x02 \x01(\x04\x42\x06\xbaH\x03\xc8\x01\x01\x12 \n\x10window_type_name\x18\x03 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12#\n\x13window_type_version\x18\x04 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x16\n\x06origin\x18\x05 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12)\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct:m\xbaHj\x1ah\n\x0ewindow.time_to\x12\x36`time_to` must be greater than or equal to `time_from`\x1a\x1ethis.time_to >= this.time_from\"X\n\nWindowType\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x17\n\x07version\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x1b\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\"\xa4\x01\n\x10WindowEmitStatus\x12\x34\n\x06status\x18\x01 \x01(\x0e\x32\x1c.WindowEmitStatus.StatusEnumB\x06\xbaH\x03\xc8\x01\x01\"Z\n\nStatusEnum\x12\x1b\n\x17NO_TRIGGERED_ALGORITHMS\x10\x00\x12\x18\n\x14PROCESSING_TRIGGERED\x10\x01\x12\x15\n\x11TRIGGERING_FAILED\x10\x02\"\x87\x01\n\x13\x41lgorithmDependency\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x17\n\x07version\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x1e\n\x0eprocessor_name\x18\x03 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12!\n\x11processor_runtime\x18\x04 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\"\x90\x01\n\tAlgorithm\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x17\n\x07version\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12(\n\x0bwindow_type\x18\x03 \x01(\x0b\x32\x0b.WindowTypeB\x06\xbaH\x03\xc8\x01\x01\x12*\n\x0c\x64\x65pendencies\x18\x04 \x03(\x0b\x32\x14.AlgorithmDependency\"\x1c\n\nFloatArray\x12\x0e\n\x06values\x18\x01 \x03(\x02\"\xc7\x01\n\x06Result\x12%\n\x06status\x18\x01 \x01(\x0e\x32\r.ResultStatusB\x06\xbaH\x03\xc8\x01\x01\x12\x16\n\x0csingle_value\x18\x02 \x01(\x02H\x00\x12#\n\x0c\x66loat_values\x18\x03 \x01(\x0b\x32\x0b.FloatArrayH\x00\x12/\n\x0cstruct_value\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x19\n\ttimestamp\x18\x05 \x01(\x03\x42\x06\xbaH\x03\xc8\x01\x01\x42\r\n\x0bresult_data\"\x98\x01\n\x15ProcessorRegistration\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x17\n\x07runtime\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x1e\n\x0e\x63onnection_str\x18\x03 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x30\n\x14supported_algorithms\x18\x04 \x03(\x0b\x32\n.AlgorithmB\x06\xbaH\x03\xc8\x01\x01\"\x96\x01\n\x0eProcessingTask\x12\x17\n\x07task_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12%\n\talgorithm\x18\x02 \x01(\x0b\x32\n.AlgorithmB\x06\xbaH\x03\xc8\x01\x01\x12\x1f\n\x06window\x18\x03 \x01(\x0b\x32\x07.WindowB\x06\xbaH\x03\xc8\x01\x01\x12#\n\x12\x64\x65pendency_results\x18\x04 \x03(\x0b\x32\x07.Result\"\x99\x01\n\x10\x45xecutionRequest\x12\x17\n\x07\x65xec_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x1f\n\x06window\x18\x02 \x01(\x0b\x32\x07.WindowB\x06\xbaH\x03\xc8\x01\x01\x12+\n\x11\x61lgorithm_results\x18\x03 \x03(\x0b\x32\x10.AlgorithmResult\x12\x1e\n\nalgorithms\x18\x04 \x03(\x0b\x32\n.Algorithm\"^\n\x0f\x45xecutionResult\x12\x17\n\x07\x65xec_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01\x12\x32\n\x10\x61lgorithm_result\x18\x03 \x01(\x0b\x32\x10.AlgorithmResultB\x06\xbaH\x03\xc8\x01\x01\"Y\n\x0f\x41lgorithmResult\x12%\n\talgorithm\x18\x01 \x01(\x0b\x32\n.AlgorithmB\x06\xbaH\x03\xc8\x01\x01\x12\x1f\n\x06result\x18\x02 \x01(\x0b\x32\x07.ResultB\x06\xbaH\x03\xc8\x01\x01\"+\n\x06Status\x12\x10\n\x08received\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"/\n\x12HealthCheckRequest\x12\x19\n\ttimestamp\x18\x01 \x01(\x03\x42\x06\xbaH\x03\xc8\x01\x01\"\xe3\x01\n\x13HealthCheckResponse\x12\x33\n\x06status\x18\x01 \x01(\x0e\x32\x1b.HealthCheckResponse.StatusB\x06\xbaH\x03\xc8\x01\x01\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\"\n\x07metrics\x18\x03 \x01(\x0b\x32\x11.ProcessorMetrics\"b\n\x06Status\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x00\x12\x12\n\x0eSTATUS_SERVING\x10\x01\x12\x18\n\x14STATUS_TRANSITIONING\x10\x02\x12\x16\n\x12STATUS_NOT_SERVING\x10\x03\"k\n\x10ProcessorMetrics\x12\x14\n\x0c\x61\x63tive_tasks\x18\x01 \x01(\x05\x12\x14\n\x0cmemory_bytes\x18\x02 \x01(\x03\x12\x13\n\x0b\x63pu_percent\x18\x03 \x01(\x02\x12\x16\n\x0euptime_seconds\x18\x04 \x01(\x03\"\x10\n\x0eWindowTypeRead\"+\n\x0bWindowTypes\x12\x1c\n\x07windows\x18\x01 \x03(\x0b\x32\x0b.WindowType\"\x10\n\x0e\x41lgorithmsRead\"+\n\nAlgorithms\x12\x1d\n\talgorithm\x18\x01 \x03(\x0b\x32\n.Algorithm\"\x10\n\x0eProcessorsRead\"b\n\nProcessors\x12(\n\tprocessor\x18\x01 \x03(\x0b\x32\x15.Processors.Processor\x1a*\n\tProcessor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07runtime\x18\x02 \x01(\t\"\x12\n\x10ResultsStatsRead\"\x1d\n\x0cResultsStats\x12\r\n\x05\x43ount\x18\x01 \x01(\x03*p\n\x0cResultStatus\x12 \n\x1cRESULT_STATUS_HANDLED_FAILED\x10\x00\x12\"\n\x1eRESULT_STATUS_UNHANDLED_FAILED\x10\x01\x12\x1a\n\x16RESULT_STATUS_SUCEEDED\x10\x02\x32\xb2\x02\n\x08OrcaCore\x12\x34\n\x11RegisterProcessor\x12\x16.ProcessorRegistration\x1a\x07.Status\x12(\n\nEmitWindow\x12\x07.Window\x1a\x11.WindowEmitStatus\x12\x30\n\x0fReadWindowTypes\x12\x0f.WindowTypeRead\x1a\x0c.WindowTypes\x12.\n\x0eReadAlgorithms\x12\x0f.AlgorithmsRead\x1a\x0b.Algorithms\x12.\n\x0eReadProcessors\x12\x0f.ProcessorsRead\x1a\x0b.Processors\x12\x34\n\x10ReadResultsStats\x12\x11.ResultsStatsRead\x1a\r.ResultsStats2\x82\x01\n\rOrcaProcessor\x12\x37\n\x0e\x45xecuteDagPart\x12\x11.ExecutionRequest\x1a\x10.ExecutionResult0\x01\x12\x38\n\x0bHealthCheck\x12\x13.HealthCheckRequest\x1a\x14.HealthCheckResponseB\'Z%github.com/predixus/orca/protobufs/gob\x06proto3')
|
30
30
|
|
31
31
|
_globals = globals()
|
32
32
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -50,6 +50,8 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
50
50
|
_globals['_WINDOWTYPE'].fields_by_name['name']._serialized_options = b'\272H\003\310\001\001'
|
51
51
|
_globals['_WINDOWTYPE'].fields_by_name['version']._loaded_options = None
|
52
52
|
_globals['_WINDOWTYPE'].fields_by_name['version']._serialized_options = b'\272H\003\310\001\001'
|
53
|
+
_globals['_WINDOWTYPE'].fields_by_name['description']._loaded_options = None
|
54
|
+
_globals['_WINDOWTYPE'].fields_by_name['description']._serialized_options = b'\272H\003\310\001\001'
|
53
55
|
_globals['_WINDOWEMITSTATUS'].fields_by_name['status']._loaded_options = None
|
54
56
|
_globals['_WINDOWEMITSTATUS'].fields_by_name['status']._serialized_options = b'\272H\003\310\001\001'
|
55
57
|
_globals['_ALGORITHMDEPENDENCY'].fields_by_name['name']._loaded_options = None
|
@@ -100,64 +102,64 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
100
102
|
_globals['_HEALTHCHECKREQUEST'].fields_by_name['timestamp']._serialized_options = b'\272H\003\310\001\001'
|
101
103
|
_globals['_HEALTHCHECKRESPONSE'].fields_by_name['status']._loaded_options = None
|
102
104
|
_globals['_HEALTHCHECKRESPONSE'].fields_by_name['status']._serialized_options = b'\272H\003\310\001\001'
|
103
|
-
_globals['_RESULTSTATUS']._serialized_start=
|
104
|
-
_globals['_RESULTSTATUS']._serialized_end=
|
105
|
+
_globals['_RESULTSTATUS']._serialized_start=2539
|
106
|
+
_globals['_RESULTSTATUS']._serialized_end=2651
|
105
107
|
_globals['_WINDOW']._serialized_start=71
|
106
108
|
_globals['_WINDOW']._serialized_end=384
|
107
109
|
_globals['_WINDOWTYPE']._serialized_start=386
|
108
|
-
_globals['_WINDOWTYPE']._serialized_end=
|
109
|
-
_globals['_WINDOWEMITSTATUS']._serialized_start=
|
110
|
-
_globals['_WINDOWEMITSTATUS']._serialized_end=
|
111
|
-
_globals['_WINDOWEMITSTATUS_STATUSENUM']._serialized_start=
|
112
|
-
_globals['_WINDOWEMITSTATUS_STATUSENUM']._serialized_end=
|
113
|
-
_globals['_ALGORITHMDEPENDENCY']._serialized_start=
|
114
|
-
_globals['_ALGORITHMDEPENDENCY']._serialized_end=
|
115
|
-
_globals['_ALGORITHM']._serialized_start=
|
116
|
-
_globals['_ALGORITHM']._serialized_end=
|
117
|
-
_globals['_FLOATARRAY']._serialized_start=
|
118
|
-
_globals['_FLOATARRAY']._serialized_end=
|
119
|
-
_globals['_RESULT']._serialized_start=
|
120
|
-
_globals['_RESULT']._serialized_end=
|
121
|
-
_globals['_PROCESSORREGISTRATION']._serialized_start=
|
122
|
-
_globals['_PROCESSORREGISTRATION']._serialized_end=
|
123
|
-
_globals['_PROCESSINGTASK']._serialized_start=
|
124
|
-
_globals['_PROCESSINGTASK']._serialized_end=
|
125
|
-
_globals['_EXECUTIONREQUEST']._serialized_start=
|
126
|
-
_globals['_EXECUTIONREQUEST']._serialized_end=
|
127
|
-
_globals['_EXECUTIONRESULT']._serialized_start=
|
128
|
-
_globals['_EXECUTIONRESULT']._serialized_end=
|
129
|
-
_globals['_ALGORITHMRESULT']._serialized_start=
|
130
|
-
_globals['_ALGORITHMRESULT']._serialized_end=
|
131
|
-
_globals['_STATUS']._serialized_start=
|
132
|
-
_globals['_STATUS']._serialized_end=
|
133
|
-
_globals['_HEALTHCHECKREQUEST']._serialized_start=
|
134
|
-
_globals['_HEALTHCHECKREQUEST']._serialized_end=
|
135
|
-
_globals['_HEALTHCHECKRESPONSE']._serialized_start=
|
136
|
-
_globals['_HEALTHCHECKRESPONSE']._serialized_end=
|
137
|
-
_globals['_HEALTHCHECKRESPONSE_STATUS']._serialized_start=
|
138
|
-
_globals['_HEALTHCHECKRESPONSE_STATUS']._serialized_end=
|
139
|
-
_globals['_PROCESSORMETRICS']._serialized_start=
|
140
|
-
_globals['_PROCESSORMETRICS']._serialized_end=
|
141
|
-
_globals['_WINDOWTYPEREAD']._serialized_start=
|
142
|
-
_globals['_WINDOWTYPEREAD']._serialized_end=
|
143
|
-
_globals['_WINDOWTYPES']._serialized_start=
|
144
|
-
_globals['_WINDOWTYPES']._serialized_end=
|
145
|
-
_globals['_ALGORITHMSREAD']._serialized_start=
|
146
|
-
_globals['_ALGORITHMSREAD']._serialized_end=
|
147
|
-
_globals['_ALGORITHMS']._serialized_start=
|
148
|
-
_globals['_ALGORITHMS']._serialized_end=
|
149
|
-
_globals['_PROCESSORSREAD']._serialized_start=
|
150
|
-
_globals['_PROCESSORSREAD']._serialized_end=
|
151
|
-
_globals['_PROCESSORS']._serialized_start=
|
152
|
-
_globals['_PROCESSORS']._serialized_end=
|
153
|
-
_globals['_PROCESSORS_PROCESSOR']._serialized_start=
|
154
|
-
_globals['_PROCESSORS_PROCESSOR']._serialized_end=
|
155
|
-
_globals['_RESULTSSTATSREAD']._serialized_start=
|
156
|
-
_globals['_RESULTSSTATSREAD']._serialized_end=
|
157
|
-
_globals['_RESULTSSTATS']._serialized_start=
|
158
|
-
_globals['_RESULTSSTATS']._serialized_end=
|
159
|
-
_globals['_ORCACORE']._serialized_start=
|
160
|
-
_globals['_ORCACORE']._serialized_end=
|
161
|
-
_globals['_ORCAPROCESSOR']._serialized_start=
|
162
|
-
_globals['_ORCAPROCESSOR']._serialized_end=
|
110
|
+
_globals['_WINDOWTYPE']._serialized_end=474
|
111
|
+
_globals['_WINDOWEMITSTATUS']._serialized_start=477
|
112
|
+
_globals['_WINDOWEMITSTATUS']._serialized_end=641
|
113
|
+
_globals['_WINDOWEMITSTATUS_STATUSENUM']._serialized_start=551
|
114
|
+
_globals['_WINDOWEMITSTATUS_STATUSENUM']._serialized_end=641
|
115
|
+
_globals['_ALGORITHMDEPENDENCY']._serialized_start=644
|
116
|
+
_globals['_ALGORITHMDEPENDENCY']._serialized_end=779
|
117
|
+
_globals['_ALGORITHM']._serialized_start=782
|
118
|
+
_globals['_ALGORITHM']._serialized_end=926
|
119
|
+
_globals['_FLOATARRAY']._serialized_start=928
|
120
|
+
_globals['_FLOATARRAY']._serialized_end=956
|
121
|
+
_globals['_RESULT']._serialized_start=959
|
122
|
+
_globals['_RESULT']._serialized_end=1158
|
123
|
+
_globals['_PROCESSORREGISTRATION']._serialized_start=1161
|
124
|
+
_globals['_PROCESSORREGISTRATION']._serialized_end=1313
|
125
|
+
_globals['_PROCESSINGTASK']._serialized_start=1316
|
126
|
+
_globals['_PROCESSINGTASK']._serialized_end=1466
|
127
|
+
_globals['_EXECUTIONREQUEST']._serialized_start=1469
|
128
|
+
_globals['_EXECUTIONREQUEST']._serialized_end=1622
|
129
|
+
_globals['_EXECUTIONRESULT']._serialized_start=1624
|
130
|
+
_globals['_EXECUTIONRESULT']._serialized_end=1718
|
131
|
+
_globals['_ALGORITHMRESULT']._serialized_start=1720
|
132
|
+
_globals['_ALGORITHMRESULT']._serialized_end=1809
|
133
|
+
_globals['_STATUS']._serialized_start=1811
|
134
|
+
_globals['_STATUS']._serialized_end=1854
|
135
|
+
_globals['_HEALTHCHECKREQUEST']._serialized_start=1856
|
136
|
+
_globals['_HEALTHCHECKREQUEST']._serialized_end=1903
|
137
|
+
_globals['_HEALTHCHECKRESPONSE']._serialized_start=1906
|
138
|
+
_globals['_HEALTHCHECKRESPONSE']._serialized_end=2133
|
139
|
+
_globals['_HEALTHCHECKRESPONSE_STATUS']._serialized_start=2035
|
140
|
+
_globals['_HEALTHCHECKRESPONSE_STATUS']._serialized_end=2133
|
141
|
+
_globals['_PROCESSORMETRICS']._serialized_start=2135
|
142
|
+
_globals['_PROCESSORMETRICS']._serialized_end=2242
|
143
|
+
_globals['_WINDOWTYPEREAD']._serialized_start=2244
|
144
|
+
_globals['_WINDOWTYPEREAD']._serialized_end=2260
|
145
|
+
_globals['_WINDOWTYPES']._serialized_start=2262
|
146
|
+
_globals['_WINDOWTYPES']._serialized_end=2305
|
147
|
+
_globals['_ALGORITHMSREAD']._serialized_start=2307
|
148
|
+
_globals['_ALGORITHMSREAD']._serialized_end=2323
|
149
|
+
_globals['_ALGORITHMS']._serialized_start=2325
|
150
|
+
_globals['_ALGORITHMS']._serialized_end=2368
|
151
|
+
_globals['_PROCESSORSREAD']._serialized_start=2370
|
152
|
+
_globals['_PROCESSORSREAD']._serialized_end=2386
|
153
|
+
_globals['_PROCESSORS']._serialized_start=2388
|
154
|
+
_globals['_PROCESSORS']._serialized_end=2486
|
155
|
+
_globals['_PROCESSORS_PROCESSOR']._serialized_start=2444
|
156
|
+
_globals['_PROCESSORS_PROCESSOR']._serialized_end=2486
|
157
|
+
_globals['_RESULTSSTATSREAD']._serialized_start=2488
|
158
|
+
_globals['_RESULTSSTATSREAD']._serialized_end=2506
|
159
|
+
_globals['_RESULTSSTATS']._serialized_start=2508
|
160
|
+
_globals['_RESULTSSTATS']._serialized_end=2537
|
161
|
+
_globals['_ORCACORE']._serialized_start=2654
|
162
|
+
_globals['_ORCACORE']._serialized_end=2960
|
163
|
+
_globals['_ORCAPROCESSOR']._serialized_start=2963
|
164
|
+
_globals['_ORCAPROCESSOR']._serialized_end=3093
|
163
165
|
# @@protoc_insertion_point(module_scope)
|
@@ -34,12 +34,14 @@ class Window(_message.Message):
|
|
34
34
|
def __init__(self, time_from: _Optional[int] = ..., time_to: _Optional[int] = ..., window_type_name: _Optional[str] = ..., window_type_version: _Optional[str] = ..., origin: _Optional[str] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
35
35
|
|
36
36
|
class WindowType(_message.Message):
|
37
|
-
__slots__ = ("name", "version")
|
37
|
+
__slots__ = ("name", "version", "description")
|
38
38
|
NAME_FIELD_NUMBER: _ClassVar[int]
|
39
39
|
VERSION_FIELD_NUMBER: _ClassVar[int]
|
40
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
40
41
|
name: str
|
41
42
|
version: str
|
42
|
-
|
43
|
+
description: str
|
44
|
+
def __init__(self, name: _Optional[str] = ..., version: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ...
|
43
45
|
|
44
46
|
class WindowEmitStatus(_message.Message):
|
45
47
|
__slots__ = ("status",)
|
@@ -334,9 +334,7 @@ class OrcaCore(object):
|
|
334
334
|
|
335
335
|
|
336
336
|
class OrcaProcessorStub(object):
|
337
|
-
"""
|
338
|
-
|
339
|
-
OrcaProcessor defines the interface that each processing node must implement.
|
337
|
+
"""OrcaProcessor defines the interface that each processing node must implement.
|
340
338
|
Processors are language-agnostic services that:
|
341
339
|
- Execute individual algorithms
|
342
340
|
- Handle their own internal state
|
@@ -363,9 +361,7 @@ class OrcaProcessorStub(object):
|
|
363
361
|
|
364
362
|
|
365
363
|
class OrcaProcessorServicer(object):
|
366
|
-
"""
|
367
|
-
|
368
|
-
OrcaProcessor defines the interface that each processing node must implement.
|
364
|
+
"""OrcaProcessor defines the interface that each processing node must implement.
|
369
365
|
Processors are language-agnostic services that:
|
370
366
|
- Execute individual algorithms
|
371
367
|
- Handle their own internal state
|
@@ -410,9 +406,7 @@ def add_OrcaProcessorServicer_to_server(servicer, server):
|
|
410
406
|
|
411
407
|
# This class is part of an EXPERIMENTAL API.
|
412
408
|
class OrcaProcessor(object):
|
413
|
-
"""
|
414
|
-
|
415
|
-
OrcaProcessor defines the interface that each processing node must implement.
|
409
|
+
"""OrcaProcessor defines the interface that each processing node must implement.
|
416
410
|
Processors are language-agnostic services that:
|
417
411
|
- Execute individual algorithms
|
418
412
|
- Handle their own internal state
|
@@ -26,8 +26,9 @@ from typing import (
|
|
26
26
|
TypeVar,
|
27
27
|
Callable,
|
28
28
|
Iterable,
|
29
|
+
Optional,
|
30
|
+
Protocol,
|
29
31
|
Generator,
|
30
|
-
TypeAlias,
|
31
32
|
AsyncGenerator,
|
32
33
|
)
|
33
34
|
from concurrent import futures
|
@@ -48,13 +49,41 @@ ALGORITHM_NAME = r"^[A-Z][a-zA-Z0-9]*$"
|
|
48
49
|
SEMVER_PATTERN = r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$"
|
49
50
|
WINDOW_NAME = r"^[A-Z][a-zA-Z0-9]*$"
|
50
51
|
|
51
|
-
|
52
|
+
|
53
|
+
@dataclass
|
54
|
+
class ExecutionParams:
|
55
|
+
window: pb.Window
|
56
|
+
dependencies: Optional[Iterable[pb.AlgorithmResult]] = None
|
57
|
+
|
58
|
+
|
59
|
+
class AlgorithmFn(Protocol):
|
60
|
+
def __call__(self, params: ExecutionParams, *args: Any, **kwargs: Any) -> Any: ...
|
61
|
+
|
52
62
|
|
53
63
|
T = TypeVar("T", bound=AlgorithmFn)
|
54
64
|
|
55
65
|
LOGGER = logging.getLogger(__name__)
|
56
66
|
|
57
67
|
|
68
|
+
@dataclass
|
69
|
+
class WindowType:
|
70
|
+
name: str
|
71
|
+
version: str
|
72
|
+
description: str
|
73
|
+
|
74
|
+
def __post__init__(self) -> None:
|
75
|
+
if not re.match(WINDOW_NAME, self.name):
|
76
|
+
raise InvalidAlgorithmArgument(
|
77
|
+
f"Window name '{self.name}' must be in PascalCase"
|
78
|
+
)
|
79
|
+
|
80
|
+
if not re.match(SEMVER_PATTERN, self.version):
|
81
|
+
raise InvalidAlgorithmArgument(
|
82
|
+
f"Window version '{self.version}' must follow basic semantic "
|
83
|
+
"versioning (e.g., '1.0.0') without release portions"
|
84
|
+
)
|
85
|
+
|
86
|
+
|
58
87
|
@dataclass
|
59
88
|
class Window:
|
60
89
|
time_from: int
|
@@ -111,6 +140,7 @@ class Algorithm:
|
|
111
140
|
version: str
|
112
141
|
window_name: str
|
113
142
|
window_version: str
|
143
|
+
window_description: str
|
114
144
|
exec_fn: AlgorithmFn
|
115
145
|
processor: str
|
116
146
|
runtime: str
|
@@ -180,12 +210,11 @@ class Algorithms:
|
|
180
210
|
break
|
181
211
|
|
182
212
|
if not dependencyAlgo:
|
213
|
+
dep_name = getattr(dependency, "__name__", "<unknown>")
|
183
214
|
LOGGER.error(
|
184
|
-
f"Failed to find registered algorithm for dependency: {
|
185
|
-
)
|
186
|
-
raise ValueError(
|
187
|
-
f"Dependency {dependency.__name__} not found in registered algorithms"
|
215
|
+
f"Failed to find registered algorithm for dependency: {dep_name}"
|
188
216
|
)
|
217
|
+
raise ValueError(f"Dependency {dep_name} not found in reg=ms")
|
189
218
|
|
190
219
|
if algorithm not in self._dependencyFns:
|
191
220
|
self._dependencyFns[algorithm] = [dependency]
|
@@ -245,7 +274,7 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
245
274
|
self,
|
246
275
|
exec_id: str,
|
247
276
|
algorithm: pb.Algorithm,
|
248
|
-
|
277
|
+
params: ExecutionParams,
|
249
278
|
) -> pb.ExecutionResult:
|
250
279
|
"""
|
251
280
|
Executes a single algorithm with resolved dependencies.
|
@@ -253,7 +282,7 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
253
282
|
Args:
|
254
283
|
exec_id (str): Unique execution ID.
|
255
284
|
algorithm (pb.Algorithm): The algorithm to execute.
|
256
|
-
|
285
|
+
params (ExecutionParams): The execution params object, which contains the triggering window and dependency results.
|
257
286
|
|
258
287
|
Returns:
|
259
288
|
pb.ExecutionResult: The result of the execution.
|
@@ -268,27 +297,28 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
268
297
|
|
269
298
|
# convert dependency results into a dict of name -> value
|
270
299
|
dependency_values = {}
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
300
|
+
if params.dependencies:
|
301
|
+
for dep_result in params.dependencies:
|
302
|
+
# extract value based on which oneof field is set
|
303
|
+
dep_value = None
|
304
|
+
if dep_result.result.HasField("single_value"):
|
305
|
+
dep_value = dep_result.result.single_value
|
306
|
+
elif dep_result.result.HasField("float_values"):
|
307
|
+
dep_value = list(dep_result.result.float_values.values)
|
308
|
+
elif dep_result.result.HasField("struct_value"):
|
309
|
+
dep_value = json_format.MessageToDict(
|
310
|
+
dep_result.result.struct_value
|
311
|
+
)
|
312
|
+
|
313
|
+
dep_name = (
|
314
|
+
f"{dep_result.algorithm.name}_{dep_result.algorithm.version}"
|
281
315
|
)
|
282
|
-
|
283
|
-
dep_name = f"{dep_result.algorithm.name}_{dep_result.algorithm.version}"
|
284
|
-
dependency_values[dep_name] = dep_value
|
316
|
+
dependency_values[dep_name] = dep_value
|
285
317
|
|
286
318
|
# execute in thread pool since algo.exec_fn is synchronous
|
287
319
|
loop = asyncio.get_event_loop()
|
288
320
|
|
289
|
-
algoResult = await loop.run_in_executor(
|
290
|
-
None, algo.exec_fn, dependency_values
|
291
|
-
)
|
321
|
+
algoResult = await loop.run_in_executor(None, algo.exec_fn, params)
|
292
322
|
|
293
323
|
# create result based on the return type
|
294
324
|
current_time = int(time.time()) # Current timestamp in seconds
|
@@ -390,13 +420,13 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
390
420
|
return pb.ExecutionResult(exec_id=exec_id, algorithm_result=algo_result)
|
391
421
|
|
392
422
|
def ExecuteDagPart(
|
393
|
-
self,
|
423
|
+
self, executionRequest: pb.ExecutionRequest, context: grpc.ServicerContext
|
394
424
|
) -> Generator[pb.ExecutionResult, None, None]:
|
395
425
|
"""
|
396
426
|
Executes part of a DAG (Directed Acyclic Graph) of algorithms.
|
397
427
|
|
398
428
|
Args:
|
399
|
-
|
429
|
+
executionRequest (pb.ExecutionRequest): The DAG execution request.
|
400
430
|
context (grpc.ServicerContext): gRPC context for the request.
|
401
431
|
|
402
432
|
Yields:
|
@@ -408,8 +438,8 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
408
438
|
|
409
439
|
LOGGER.info(
|
410
440
|
(
|
411
|
-
f"Received DAG execution request with {len(
|
412
|
-
f"algorithms and ExecId: {
|
441
|
+
f"Received DAG execution request with {len(executionRequest.algorithms)} "
|
442
|
+
f"algorithms and ExecId: {executionRequest.exec_id}"
|
413
443
|
)
|
414
444
|
)
|
415
445
|
|
@@ -424,11 +454,14 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
424
454
|
# create tasks for all algorithms
|
425
455
|
tasks = [
|
426
456
|
self.execute_algorithm(
|
427
|
-
|
457
|
+
executionRequest.exec_id,
|
428
458
|
algorithm,
|
429
|
-
|
459
|
+
ExecutionParams(
|
460
|
+
window=executionRequest.window,
|
461
|
+
dependencies=executionRequest.algorithm_results,
|
462
|
+
),
|
430
463
|
)
|
431
|
-
for algorithm in
|
464
|
+
for algorithm in executionRequest.algorithms
|
432
465
|
]
|
433
466
|
|
434
467
|
# execute all tasks concurrently and yield results as they complete
|
@@ -509,6 +542,7 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
509
542
|
# Add window type
|
510
543
|
algo_msg.window_type.name = algorithm.window_name
|
511
544
|
algo_msg.window_type.version = algorithm.window_version
|
545
|
+
algo_msg.window_type.description = algorithm.window_description
|
512
546
|
|
513
547
|
# Add dependencies if they exist
|
514
548
|
if algorithm.full_name in self._algorithmsSingleton._dependencies:
|
@@ -585,8 +619,7 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
585
619
|
self,
|
586
620
|
name: str,
|
587
621
|
version: str,
|
588
|
-
|
589
|
-
window_version: str,
|
622
|
+
window_type: WindowType,
|
590
623
|
depends_on: List[Callable[..., Any]] = [],
|
591
624
|
) -> Callable[[T], T]:
|
592
625
|
"""
|
@@ -595,10 +628,8 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
595
628
|
Args:
|
596
629
|
name (str): Algorithm name (PascalCase).
|
597
630
|
version (str): Semantic version (e.g., "1.0.0").
|
598
|
-
|
599
|
-
window_version (str): Semantic version of the window.
|
631
|
+
window_type (WindowType): Triggering window type
|
600
632
|
depends_on (List[Callable]): List of dependent algorithm functions.
|
601
|
-
|
602
633
|
Returns:
|
603
634
|
Callable[[T], T]: The decorated function.
|
604
635
|
|
@@ -617,31 +648,18 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
617
648
|
"versioning (e.g., '1.0.0') without release portions"
|
618
649
|
)
|
619
650
|
|
620
|
-
if not re.match(WINDOW_NAME, window_name):
|
621
|
-
raise InvalidAlgorithmArgument(
|
622
|
-
f"Window name '{window_name}' must be in PascalCase"
|
623
|
-
)
|
624
|
-
|
625
|
-
if not re.match(SEMVER_PATTERN, window_version):
|
626
|
-
raise InvalidAlgorithmArgument(
|
627
|
-
f"Window version '{window_version}' must follow basic semantic "
|
628
|
-
"versioning (e.g., '1.0.0') without release portions"
|
629
|
-
)
|
630
|
-
|
631
651
|
def inner(algo: T) -> T:
|
632
652
|
def wrapper(
|
633
|
-
|
653
|
+
params: ExecutionParams,
|
634
654
|
*args: Any,
|
635
655
|
**kwargs: Any,
|
636
656
|
) -> Any:
|
637
657
|
LOGGER.debug(f"Executing algorithm {name}_{version}")
|
638
658
|
try:
|
639
659
|
# setup ready for the algo
|
640
|
-
#
|
641
|
-
|
642
|
-
kwargs["dependencies"] = dependency_values
|
660
|
+
# pack the params into the kwargs - user can decide if they want it
|
661
|
+
kwargs["params"] = params
|
643
662
|
LOGGER.debug(f"Algorithm {name}_{version} setup complete")
|
644
|
-
# TODO
|
645
663
|
|
646
664
|
# run the algo
|
647
665
|
LOGGER.info(f"Running algorithm {name}_{version}")
|
@@ -660,8 +678,9 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
660
678
|
algorithm = Algorithm(
|
661
679
|
name=name,
|
662
680
|
version=version,
|
663
|
-
window_name=
|
664
|
-
window_version=
|
681
|
+
window_name=window_type.name,
|
682
|
+
window_version=window_type.version,
|
683
|
+
window_description=window_type.description,
|
665
684
|
exec_fn=wrapper,
|
666
685
|
processor=self._name,
|
667
686
|
runtime=sys.version,
|
@@ -687,6 +706,6 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
687
706
|
# needs to be defined before a dependency can be created, and you can only register depencenies
|
688
707
|
# once. But when dependencies are grabbed from a server, circular dependencies will be possible
|
689
708
|
|
690
|
-
return wrapper # type: ignore
|
709
|
+
return wrapper # type: ignore[return-value]
|
691
710
|
|
692
711
|
return inner
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{orca_python-0.3.0 → orca_python-0.5.0}/orca/core/protobufs/python/vendor/validate_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|