# Ray on Eugo

How to use Ray on Eugo: start a Ray cluster, connect a Jupyter notebook, run tasks, actors and Ray Data with eugo.hpc, request GPUs, install packages, handle memory, and build Ray programs visually.

Source: https://docs.eugo.io/docs/guides/ray-on-eugo/

---

To use Ray on Eugo, start a Ray cluster in the EugoHPC Manager, connect a notebook in EugoLab to it, and send work to it with `eugo.hpc`, which is Ray's Python API under Eugo's name: the same functions and the same `.remote(...)` call style, plus one function of Eugo's own, for the cluster's token. Code written with the `ray.*` names works the same way. If you would rather draw the program than type it, the visual Ray builder writes the Ray code into your notebook for you.

This page links the Ray pages in this documentation, in the order you are likely to need them.

## Start a cluster and connect to it

- [EugoHPC Manager](/docs/guides/hpc-cluster-manager.md): how your workspaces and Ray clusters are organized, what the Allow Tasks on Head Node setting does, and how to connect to a cluster by hand with your own runtime environment.
- [Cluster settings](/docs/guides/cluster-settings.md): every setting in the Cluster Launcher when you create a Ray cluster, including the GPU worker pools.
- [Connecting a Jupyter notebook to your Ray cluster](/docs/guides/connecting-a-notebook.md): connect with **Connect this notebook**, check that you are connected, disconnect, and run your own Python scripts on the cluster.

## Run your code on the cluster

- [The eugo.hpc API](/docs/guides/eugo-hpc-api.md): connecting, distributed functions and actors, objects, the token file, and how each name maps to Ray.
- [Distributed Python on a GPU cluster](/docs/guides/distributed-python.md): plain Python functions, classes and pandas or NumPy data across the cluster, with tasks, actors and Ray Data.
- [Requesting a GPU for a task](/docs/guides/distributed-python.md#step-5-optional-reserve-a-gpu-for-a-task): `@eugo.hpc.distribute(num_gpus=1)` reserves one GPU for a task or actor, on a cluster that has a GPU worker pool.
- [Running tasks in parallel](/docs/guides/parallel-tasks.md): why tasks run one at a time when you call `get` (or `ray.get`) inside the loop, and how to run them in parallel.
- [Batch inference with Ray Data on GPUs](/docs/guides/batch-inference-ray-data.md): run a model over a dataset on every GPU of the cluster with `map_batches` and an actor pool.

## Packages and memory on the cluster

- [Installing Python packages](/docs/guides/installing-python-packages.md#packages-on-the-cluster): what the workers already have, and how to add packages and your own code with a Ray runtime environment.
- [Ray out-of-memory kills, the object store and spilling](/docs/guides/memory-for-distributed-jobs.md): why Ray kills a task for running out of memory, how big the object store is, and when it spills to disk.

## Build Ray programs visually

- [Visual Ray builder](/docs/platform/ray-builder.md): the Ray DAG Builder, a canvas in EugoLab that writes Ray code into your notebook.
- [Ray builder quickstart](/docs/platform/ray-builder-quickstart.md): insert the map-reduce starter, write its code into your notebook and run it on your cluster.
- [Ray builder starters and presets](/docs/platform/ray-builder-starters.md): the built-in starter graphs, and presets of your own nodes that you reuse in any notebook.
- [Exporting a Ray builder graph](/docs/platform/ray-builder-exports.md): a graph as a Python module, a Ray Job script, a cron wrapper, a notebook, a Mermaid diagram or a Ray Serve config.
- [Ray builder reference](/docs/platform/ray-builder-reference.md): every node, canvas tool, setting and keyboard shortcut.
- [Ray builder troubleshooting](/docs/platform/ray-builder-troubleshooting.md): what to do about each message the builder may show.
