towhee.functional.mixins.ray.RayMixin

class towhee.functional.mixins.ray.RayMixin[source]

Bases: object

Mixin for parallel ray execution.

Methods

ray_resolve

ray_start

Start the ray service.

ray_start(address=None, local_packages: Optional[list] = None, pip_packages: Optional[list] = None, silence=True)[source]

Start the ray service. When using a remote cluster, all dependencies for custom functions and operators defined locally will need to be sent to the ray cluster. If using ray locally, within the runtime, avoid passing in any arguments.

Parameters:
  • address (str) – The address for the ray service being connected to. If using ray cluster remotely with kubectl forwarded port, the most likely address will be “ray://localhost:10001”.

  • local_packages (list[str]) – Whichever locally defined modules that are used within a custom function supplied to the pipeline, whether it be in lambda functions, locally registered operators, or functions themselves.

  • pip_packages (list[str]) – Whichever pip installed modules that are used within a custom function supplied to the pipeline, whether it be in lambda functions, locally registered operators, or functions themselves.