orca-python 0.7.5__tar.gz → 0.7.6__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.7.5 → orca_python-0.7.6}/PKG-INFO +1 -1
- {orca_python-0.7.5 → orca_python-0.7.6}/orca_python/envs.py +9 -3
- {orca_python-0.7.5 → orca_python-0.7.6}/orca_python/main.py +28 -8
- {orca_python-0.7.5 → orca_python-0.7.6}/pyproject.toml +1 -1
- {orca_python-0.7.5 → orca_python-0.7.6}/LICENSE +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/README.md +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/__init__.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/service_pb2.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/service_pb2.pyi +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/service_pb2_grpc.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/vendor/__init__.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/vendor/validate_pb2.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/vendor/validate_pb2.pyi +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/vendor/validate_pb2_grpc.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca_python/__init__.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca_python/exceptions.py +0 -0
- {orca_python-0.7.5 → orca_python-0.7.6}/orca_python/py.typed +0 -0
@@ -4,7 +4,7 @@ from typing import Tuple
|
|
4
4
|
from orca_python.exceptions import MissingDependency
|
5
5
|
|
6
6
|
|
7
|
-
def getenvs() -> Tuple[str,
|
7
|
+
def getenvs() -> Tuple[bool, str, str, str]:
|
8
8
|
orcaserver = os.getenv("ORCA_CORE", "")
|
9
9
|
if orcaserver == "":
|
10
10
|
raise MissingDependency("ORCA_CORE is required")
|
@@ -18,7 +18,13 @@ def getenvs() -> Tuple[str, ...]:
|
|
18
18
|
if host == "":
|
19
19
|
raise MissingDependency("PROCESSOR_ADDRESS is required")
|
20
20
|
|
21
|
-
|
21
|
+
env = os.getenv("ENV", "")
|
22
|
+
if env == "production":
|
23
|
+
is_production = True
|
24
|
+
else:
|
25
|
+
is_production = False
|
22
26
|
|
27
|
+
return is_production, orcaserver, port, host
|
23
28
|
|
24
|
-
|
29
|
+
|
30
|
+
is_production, ORCASERVER, PORT, HOST = getenvs()
|
@@ -209,10 +209,20 @@ def EmitWindow(window: Window) -> None:
|
|
209
209
|
json_format.ParseDict(window.metadata, struct_value)
|
210
210
|
window_pb.metadata = struct_value
|
211
211
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
212
|
+
if envs.is_production:
|
213
|
+
# secure channel with TLS
|
214
|
+
with grpc.secure_channel(
|
215
|
+
envs.ORCASERVER, grpc.ssl_channel_credentials()
|
216
|
+
) as channel:
|
217
|
+
stub = service_pb2_grpc.OrcaCoreStub(channel)
|
218
|
+
response = stub.EmitWindow(window_pb)
|
219
|
+
LOGGER.info(f"Window emitted: {response}")
|
220
|
+
else:
|
221
|
+
# insecure channel for local development
|
222
|
+
with grpc.insecure_channel(envs.ORCASERVER) as channel:
|
223
|
+
stub = service_pb2_grpc.OrcaCoreStub(channel)
|
224
|
+
response = stub.EmitWindow(window_pb)
|
225
|
+
LOGGER.info(f"Window emitted: {response}")
|
216
226
|
|
217
227
|
|
218
228
|
@dataclass
|
@@ -641,10 +651,20 @@ class Processor(OrcaProcessorServicer): # type: ignore
|
|
641
651
|
dep_msg.processor_name = dep.processor
|
642
652
|
dep_msg.processor_runtime = dep.runtime
|
643
653
|
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
654
|
+
if envs.is_production:
|
655
|
+
# secure channel with TLS
|
656
|
+
with grpc.secure_channel(
|
657
|
+
envs.ORCASERVER, grpc.ssl_channel_credentials()
|
658
|
+
) as channel:
|
659
|
+
stub = service_pb2_grpc.OrcaCoreStub(channel)
|
660
|
+
response = stub.RegisterProcessor(registration_request)
|
661
|
+
LOGGER.info(f"Algorithm registration response received: {response}")
|
662
|
+
else:
|
663
|
+
# insecure channel for local development
|
664
|
+
with grpc.insecure_channel(envs.ORCASERVER) as channel:
|
665
|
+
stub = service_pb2_grpc.OrcaCoreStub(channel)
|
666
|
+
response = stub.RegisterProcessor(registration_request)
|
667
|
+
LOGGER.info(f"Algorithm registration response received: {response}")
|
648
668
|
|
649
669
|
def Start(self) -> None:
|
650
670
|
"""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{orca_python-0.7.5 → orca_python-0.7.6}/orca/core/protobufs/python/vendor/validate_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|