diff --git a/chimerapy/orchestrator/cli/__main__.py b/chimerapy/orchestrator/cli/__main__.py index 658cb28..b7b8e86 100644 --- a/chimerapy/orchestrator/cli/__main__.py +++ b/chimerapy/orchestrator/cli/__main__.py @@ -115,7 +115,8 @@ async def aorchestrate(config: ChimeraPyPipelineConfig) -> None: "manager.timeout.worker-shutdown", config.timeouts.shutdown_timeout ) - await manager.async_shutdown() + await manager.async_reset() + await manager.async_shutdown(shutdown_workers=config.keep_remote_workers) print("Shutting down local workers...") for worker in local_workers: await worker.async_shutdown() diff --git a/chimerapy/orchestrator/models/pipeline_config.py b/chimerapy/orchestrator/models/pipeline_config.py index f7d8c4a..e10f592 100644 --- a/chimerapy/orchestrator/models/pipeline_config.py +++ b/chimerapy/orchestrator/models/pipeline_config.py @@ -148,6 +148,11 @@ class ChimeraPyPipelineConfig(BaseModel): description="The timeouts for the pipeline operation.", ) + keep_remote_workers: bool = Field( + default=True, + description="If true, keep remote workers after pipeline has finished collection.", + ) + def instantiate_manager(self) -> cpe.Manager: m = cpe.Manager( **self.manager_config.model_dump(