# Ray builder quickstart

Open the Ray DAG Builder in EugoLab, insert the map-reduce starter, write its code into your notebook and run it on your Eugo cluster, and what the cluster badge and Run's messages mean.

Source: https://docs.eugo.io/docs/platform/ray-builder-quickstart/

---

This quickstart takes you from an empty notebook to a Ray map-reduce program, built on the canvas of the [visual Ray builder](/docs/platform/ray-builder.md) and run on your Eugo cluster.

> **Applies to:** the EugoLab image, November 2026.

## Before you start

- A running EugoLab session (see [Starting EugoLab](/docs/platform/eugolab.md#starting-eugolab)).
- A running cluster in the EugoHPC Manager (see [EugoHPC Manager](/docs/guides/hpc-cluster-manager.md)).
- A notebook open in EugoLab, with a code cell selected.

## Build and run a map-reduce graph

1. **Connect the notebook to your cluster.** In the EugoHPC Manager, on the cluster's card, open the **Notebook** tab of its **Connect** section and click **Connect this notebook**. See [Connecting a notebook to your cluster](/docs/guides/connecting-a-notebook.md).
2. **Open the builder.** In the notebook's toolbar, click the Ray DAG Builder button (its tooltip reads "Open the visual Ray DAG builder beside the active notebook"). The builder opens beside the notebook, with the selected code cell as its target. The first time, a short tour walks through the canvas: "Add a node", "Wire it up", "Edit properties", "Emit Python" and "Or start from an example".
3. **Insert the starter.** On the empty canvas, the **Start here** card reads "Add a node from the palette on the left — or load an example:". Click **Map → reduce**. Its nodes appear: two mapper tasks that run in parallel and feed one reducer.
4. **Emit the code.** Click **Emit** (Accel+Shift+E). The builder writes the Python into the target cell and saves the notebook. While live re-emit is on (the default), the cell follows the graph as you edit it; the **● live** badge in the header shows that live re-emit is on.
5. **Run it.** Click **▶ Run** (Accel+Shift+Enter). The builder emits, then runs the target cell in the notebook's kernel. The button reads **Running…** until the cell finishes; **Cancel** stops it. Because the notebook is connected, the program runs on your cluster.

Accel is Ctrl, or Cmd on macOS.

### Other ways in

- **Open the builder** from the Launcher's **Ray DAG Builder** card (in its **Other** section), from the left-bar panel **Build a Ray DAG** with its **Open builder** button, or with the command **Ray DAG Builder** in the command palette.
- **Start from an example** with a **New Ray DAG from example: &lt;name&gt;** card in the Launcher's **Ray DAG examples** section. It inserts the example graph and stubs for its functions into the active notebook.
- **Add a starter to a graph that is not empty** with **Ray DAG: Insert starter — Map → reduce** in the command palette. All the starters are listed in [Starters and presets](/docs/platform/ray-builder-starters.md).
- **Rerun the tour** with **Ray DAG: Take the builder tour**.

If the builder's status reads 'No target cell — click "Use active cell".', click into a code cell, then click **Use active cell** (Accel+Shift+U).

## Running on your cluster

**▶ Run** runs the graph on the cluster the target notebook is connected to. The connection belongs to each notebook: the builder follows the connection of the notebook it writes into.

### The cluster badge

The builder's header shows which cluster Run will use. The same text appears in JupyterLab's status bar.

| Badge | What it means |
|---|---|
| ● Connected · &lt;cluster&gt; | The notebook's kernel is connected to that cluster. Run uses it. |
| ○ Reconnect needed · &lt;cluster&gt; | The notebook has a cluster recorded, but its kernel is not connected to it (for example, after a kernel restart). Run reconnects first, then runs. |
| ○ Not connected | The notebook has no cluster. Run is refused. |
| ○ Could not read cluster status from the HPC manager | The builder could not ask the EugoHPC Manager for the notebook's cluster. |

Hover over the badge for details. When connected, it reads "Run uses this notebook's connected cluster (&lt;address&gt;)."; when a reconnect is needed, "A cluster is recorded for this notebook, but its kernel is not connected to it. Run reconnects first."

A recorded cluster stays recorded until you click **Disconnect** on its card or terminate the cluster. Restarting the kernel drops only the live connection, so the badge then reads **Reconnect needed**, and Run reconnects for you.

### When Run says no

Run never shuts down a Ray that your kernel is already running. Its messages:

| Message | What to do |
|---|---|
| "Not connected — connect a cluster from the HPC panel to run this DAG." | Click **Connect this notebook** on the cluster's card in the EugoHPC Manager, then **▶ Run** again. |
| "This kernel is already running Ray (local or another cluster). Restart the kernel or run eugo.hpc.shutdown(), then Run again." | The kernel started its own Ray, or is connected to another cluster. Restart the kernel, or run `eugo.hpc.shutdown()` in a cell, then **▶ Run** again. |
| "Kernel is busy — try again when the current cell finishes." | Wait for the running cell, then **▶ Run** again. |
| "Start a kernel, then Run again." | The notebook has no kernel yet. Start one, then **▶ Run** again. |
| "Could not read the kernel's Ray state — try Run again." | Click **▶ Run** again. |
| "HPC manager is too old to reconnect automatically — click Connect in the HPC panel" | Click **Connect this notebook** on the cluster's card, then **▶ Run** again. |
| "Could not read cluster status from the HPC manager" | Click **▶ Run** again. |

If your graph sets its own `ray.init` options (for example a runtime environment) and the kernel was already connected, Run still runs, but the connection keeps its own settings. A warning beside the badge names what was skipped: "⚠ Warning: the graph's ray.init settings (&lt;names&gt;) were not applied — the kernel was already connected to &lt;cluster&gt;." To use your own settings for the whole connection, see [Connect with your own settings](/docs/guides/connecting-a-notebook.md#connect-with-your-own-settings).

### Run with parameters

If your graph has typed inputs, **⚙ Params** (Accel+Shift+R) runs it with values you enter: "Run with parameter overrides for typed inputs (one-off, or saved as defaults)". It is not available for Serve graphs.

Serve graphs are not run from the builder: **▶ Run** emits the code and tells you to run the cell yourself ("Emitted. Run the cell to serve.run(app) — in-app Run is disabled for Serve graphs.").

## Related

- [Visual Ray builder](/docs/platform/ray-builder.md): how a graph becomes code.
- [Starters and presets](/docs/platform/ray-builder-starters.md): every built-in starter, and saving your own.
- [Exporting a graph](/docs/platform/ray-builder-exports.md): modules, job scripts, notebooks and Serve configs.
- [Ray builder troubleshooting](/docs/platform/ray-builder-troubleshooting.md).
