From c02fff82cf34c0513c798047cf2e559aa0623383 Mon Sep 17 00:00:00 2001 From: tchaton Date: Thu, 9 May 2024 11:35:15 +0100 Subject: [PATCH] update --- src/lightning/app/core/constants.py | 1 + src/lightning/app/runners/multiprocess.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lightning/app/core/constants.py b/src/lightning/app/core/constants.py index 4f92b7b1269e9..64b159e57fea8 100644 --- a/src/lightning/app/core/constants.py +++ b/src/lightning/app/core/constants.py @@ -70,6 +70,7 @@ def get_lightning_cloud_url() -> str: LIGHTNING_COMPONENT_PUBLIC_REGISTRY = "https://lightning.ai/v1/components" LIGHTNING_APPS_PUBLIC_REGISTRY = "https://lightning.ai/v1/apps" LIGHTNING_MODELS_PUBLIC_REGISTRY = "https://lightning.ai/v1/models" +ENABLE_ORCHESTRATOR = bool(int(os.getenv("ENABLE_ORCHESTRATOR", "1"))) LIGHTNING_CLOUDSPACE_HOST = os.getenv("LIGHTNING_CLOUDSPACE_HOST") LIGHTNING_CLOUDSPACE_EXPOSED_PORT_COUNT = int(os.getenv("LIGHTNING_CLOUDSPACE_EXPOSED_PORT_COUNT", "0")) diff --git a/src/lightning/app/runners/multiprocess.py b/src/lightning/app/runners/multiprocess.py index c3217197a6a33..94d627e95fc7b 100644 --- a/src/lightning/app/runners/multiprocess.py +++ b/src/lightning/app/runners/multiprocess.py @@ -81,16 +81,17 @@ def dispatch(self, *args: Any, open_ui: bool = True, **kwargs: Any): _set_flow_context() - storage_orchestrator = StorageOrchestrator( - self.app, - self.app.request_queues, - self.app.response_queues, - self.app.copy_request_queues, - self.app.copy_response_queues, - ) - self.threads.append(storage_orchestrator) - storage_orchestrator.setDaemon(True) - storage_orchestrator.start() + if constants.ENABLE_ORCHESTRATOR: + storage_orchestrator = StorageOrchestrator( + self.app, + self.app.request_queues, + self.app.response_queues, + self.app.copy_request_queues, + self.app.copy_response_queues, + ) + self.threads.append(storage_orchestrator) + storage_orchestrator.setDaemon(True) + storage_orchestrator.start() if self.start_server: self.app.should_publish_changes_to_api = True