Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.7.7] - 10-09-2025

### Changed

- The version of Orca core to use.

## [v0.7.6] - 10-09-2025

### Fixed

- Fixed gRPC connection to ORCA CORE as SSL instead of insecure, when in production

## [v0.7.5] - 09-09-2025

### Fixed
Expand Down Expand Up @@ -94,7 +106,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

[unreleased]: https://github.com/Predixus/Orca/compare/v0.7.5...HEAD
[unreleased]: https://github.com/Predixus/Orca/compare/v0.7.6...HEAD
[v0.7.6]: https://github.com/Predixus/Orca/compare/v0.7.5...v0.7.6
[v0.7.5]: https://github.com/Predixus/Orca/compare/v0.7.4...v0.7.5
[v0.7.4]: https://github.com/Predixus/Orca/compare/v0.7.3...v0.7.4
[v0.7.3]: https://github.com/Predixus/Orca/compare/v0.7.2...v0.7.3
Expand Down
2 changes: 1 addition & 1 deletion orca
Submodule orca updated from 6b70e7 to 5b994c
12 changes: 9 additions & 3 deletions orca_python/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from orca_python.exceptions import MissingDependency


def getenvs() -> Tuple[str, ...]:
def getenvs() -> Tuple[bool, str, str, str]:
orcaserver = os.getenv("ORCA_CORE", "")
if orcaserver == "":
raise MissingDependency("ORCA_CORE is required")
Expand All @@ -18,7 +18,13 @@ def getenvs() -> Tuple[str, ...]:
if host == "":
raise MissingDependency("PROCESSOR_ADDRESS is required")

return orcaserver, port, host
env = os.getenv("ENV", "")
if env == "production":
is_production = True
else:
is_production = False

return is_production, orcaserver, port, host

ORCASERVER, PORT, HOST = getenvs()

is_production, ORCASERVER, PORT, HOST = getenvs()
36 changes: 28 additions & 8 deletions orca_python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,20 @@ def EmitWindow(window: Window) -> None:
json_format.ParseDict(window.metadata, struct_value)
window_pb.metadata = struct_value

with grpc.insecure_channel(envs.ORCASERVER) as channel:
stub = service_pb2_grpc.OrcaCoreStub(channel)
response = stub.EmitWindow(window_pb)
LOGGER.info(f"Window emitted: {response}")
if envs.is_production:
# secure channel with TLS
with grpc.secure_channel(
envs.ORCASERVER, grpc.ssl_channel_credentials()
) as channel:
stub = service_pb2_grpc.OrcaCoreStub(channel)
response = stub.EmitWindow(window_pb)
LOGGER.info(f"Window emitted: {response}")
else:
# insecure channel for local development
with grpc.insecure_channel(envs.ORCASERVER) as channel:
stub = service_pb2_grpc.OrcaCoreStub(channel)
response = stub.EmitWindow(window_pb)
LOGGER.info(f"Window emitted: {response}")


@dataclass
Expand Down Expand Up @@ -641,10 +651,20 @@ def Register(self) -> None:
dep_msg.processor_name = dep.processor
dep_msg.processor_runtime = dep.runtime

with grpc.insecure_channel(envs.ORCASERVER) as channel:
stub = service_pb2_grpc.OrcaCoreStub(channel)
response = stub.RegisterProcessor(registration_request)
LOGGER.info(f"Algorithm registration response recieved: {response}")
if envs.is_production:
# secure channel with TLS
with grpc.secure_channel(
envs.ORCASERVER, grpc.ssl_channel_credentials()
) as channel:
stub = service_pb2_grpc.OrcaCoreStub(channel)
response = stub.RegisterProcessor(registration_request)
LOGGER.info(f"Algorithm registration response received: {response}")
else:
# insecure channel for local development
with grpc.insecure_channel(envs.ORCASERVER) as channel:
stub = service_pb2_grpc.OrcaCoreStub(channel)
response = stub.RegisterProcessor(registration_request)
LOGGER.info(f"Algorithm registration response received: {response}")

def Start(self) -> None:
"""
Expand Down
Loading