From f21c29e57024547ff28ee0fd0a4c7693d6411b0b Mon Sep 17 00:00:00 2001 From: thejumpman2323 Date: Wed, 27 Dec 2023 23:46:30 +0530 Subject: [PATCH] Add local mode in ray --- superduperdb/backends/ray/compute.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/superduperdb/backends/ray/compute.py b/superduperdb/backends/ray/compute.py index 7a6c231da..645ec2460 100644 --- a/superduperdb/backends/ray/compute.py +++ b/superduperdb/backends/ray/compute.py @@ -11,17 +11,21 @@ class RayComputeBackend(ComputeBackend): A client for interacting with a ray cluster. Initialize the ray client. :param address: The address of the ray cluster. + :param local: Set to True to create a local Dask cluster. (optional) :param **kwargs: Additional keyword arguments to be passed to the ray client. """ def __init__( self, address: t.Optional[str] = None, + local: bool = False, **kwargs, ): self._futures_collection: t.Dict[str, ray.ObjectRef] = {} - - ray.init(address=address, **kwargs) + if local: + ray.init() + else: + ray.init(address=address, **kwargs) @property def type(self) -> str: