API Reference

This section contains detailed reference documentation for working with the Ray API in Graphbook.

graphbook.ray.init(*, host='0.0.0.0', port=8005) None

Initializes Ray and Graphbook web server if not already initialized.

Parameters:
  • host – The host address to bind the web server to. Default is 0.0.0.0.

  • port – The port to bind the web server to. Default is 8005.

graphbook.ray.is_graphbook_ray_initialized() bool

Returns whether the Graphbook Ray API is initialized.

@graphbook.ray.remote(*args, **kwargs) GraphbookActorWrapper

Decorates the following class to be a remote actor in Ray that is also compatible with Graphbook.

@graphbook.ray.options

You may specify Ray options for the remote actor. Ray allows you to seamlessly scale your applications from a laptop to a cluster, and this decorator will forward the given arguments to the Ray options for the remote actor. See Ray Resources and options for more information.

Examples

from graphbook import step
from graphbook.ray import options

@step("RayStep")
@options(num_cpus=2, num_gpus=1)
def my_ray_step(ctx, data):
    # Process some data
    data["value"] = predict(...)
class graphbook.ray.RayExecutor(log_dir: str = 'logs', **init_args)

Ray execution engine that runs Graphbook workflows using Ray.