You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-63Lines changed: 19 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
13
13
**Ray integration for Dagster.**
14
14
15
-
`dagster-ray` enables you to orchestrate distributed Ray compute from Dagster pipelines, providing seamless integration between Dagster's orchestration capabilities and Ray's distributed computing power.
15
+
`dagster-ray` enables working with distributed Ray compute from Dagster pipelines, combining Dagster's excellent orchestration capabilities and Ray's distributed computing power together.
16
16
17
17
> [!NOTE]
18
18
> This project is ready for production use, but some APIs may change between minor releases.
@@ -21,79 +21,31 @@ Learn more in the [docs](https://danielgafni.github.io/dagster-ray)
21
21
22
22
## 🚀 Key Features
23
23
24
-
-**Run Launchers & Executors**: Submit Dagster runs or individual ops as Ray jobs
25
-
-**Ray Resources**: Manage Ray clusters with Kubernetes (KubeRay) or local backends, connect to them in client mode
26
-
-**Dagster Pipes**: Execute external Ray scripts with rich logging and metadata
27
-
-**Production Ready**: Tested against a matrix of core dependencies and platform versions, integrated with Dagster+
24
+
-**🎯 Run Launchers & Executors**: Submit Dagster runs or individual steps by submitting Ray jobs
25
+
-**🔧 Ray Resources**: Automatically create and destroy ephemeral Ray clusters and connect to them in client mode
26
+
-**📡 Dagster Pipes Integration**: Submit external scripts as Ray jobs, stream back logs and rich Dagster metadata
27
+
-**☸️ KubeRay Support**: Utilize `RayJob` and `RayCluster` custom resources in client or job submission mode ([tutorial](tutorial/kuberay.md))
28
+
-**🏭 Production Ready**: Tested against a matrix of core dependencies, integrated with Dagster+
28
29
29
-
## 📦 Quick Start
30
-
31
-
### Installation
30
+
## Installation
32
31
33
32
```shell
34
33
pip install dagster-ray
35
34
```
36
35
37
-
### Example
38
-
39
-
Define a Dagster asset that uses Ray in client mode
Copy file name to clipboardExpand all lines: docs/index.md
+38-8Lines changed: 38 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,30 @@
1
-
# Welcome to dagster-ray
2
-
3
-
**Ray integration for Dagster** - Orchestrate distributed Ray compute from Dagster pipelines with seamless integration between Dagster's orchestration capabilities and Ray's distributed computing power.
`dagster-ray` enables working with distributed Ray compute from Dagster pipelines, combining Dagster's excellent orchestration capabilities and Ray's distributed computing power together.
17
+
9
18
10
19
> [!NOTE]
11
20
> This project is ready for production use, but some APIs may change between minor releases.
12
21
13
22
## 🚀 Key Features
14
23
15
-
-**🎯 Run Launchers & Executors**: Submit Dagster runs or individual steps as Ray jobs
16
-
-**🔧 Ray Resources**: Connect to Ray cluster in client mode and manage their lifecycle
17
-
-**📡 Dagster Pipes Integration**: Execute external Ray scripts with rich logging and metadata
18
-
-**☸️ KubeRay Support**: Utilize `RayJob` and `RayCluster` custom resources in client or job mode ([tutorial](tutorial/kuberay.md))
24
+
-**🎯 Run Launchers & Executors**: Submit Dagster runs or individual steps by submitting Ray jobs
25
+
-**🔧 Ray Resources**: Automatically create and destroy ephemeral Ray clusters and connect to them in client mode
26
+
-**📡 Dagster Pipes Integration**: Submit external scripts as Ray jobs, stream back logs and rich Dagster metadata
27
+
-**☸️ KubeRay Support**: Utilize `RayJob` and `RayCluster` custom resources in client or job submission mode ([tutorial](tutorial/kuberay.md))
19
28
-**🏭 Production Ready**: Tested against a matrix of core dependencies, integrated with Dagster+
20
29
21
30
## ⚡ Quick Start
@@ -27,14 +36,31 @@
27
36
pip install dagster-ray
28
37
```
29
38
39
+
!!! tip
40
+
See [external cluster tutorial](tutorial/external.md)
41
+
30
42
=== "With KubeRay"
31
43
```bash
32
44
pip install 'dagster-ray[kuberay]'
33
45
```
34
46
47
+
!!! tip
48
+
See [KubeRay tutorial](tutorial/kuberay.md)
49
+
35
50
### Basic Usage
51
+
#### Execute Dagster steps on an existing Ray cluster
52
+
!!! example
53
+
```python
54
+
import dagster as dg
55
+
from dagster_ray import ray_executor
56
+
57
+
defs = dg.Definitions(..., executor=ray_executor)
58
+
```
36
59
60
+
#### Execute an asset on Ray in client mode
37
61
!!! example
62
+
63
+
38
64
Define a Dagster asset that uses Ray in client mode
39
65
```python
40
66
import dagster as dg
@@ -56,9 +82,10 @@
56
82
1. :zap: I am already running in Ray!
57
83
2. :bulb: `RayResource` is a type annotation that provides a common interface for Ray resources
58
84
59
-
Now use `LocalRay` for local development and swap it with a thick cluster in Kubernetes!
85
+
Now use [`LocalRay`](api/core.md#dagster_ray.core.resources.LocalRay) for development and swap it with a thick cluster in Kubernetes!
60
86
61
87
```python
88
+
from dagster_ray import LocalRay
62
89
from dagster_ray.kuberay import in_k8s, KubeRayInteractiveJob
63
90
64
91
ray_cluster = LocalRay() if not in_k8s else KubeRayInteractiveJob()
@@ -69,6 +96,8 @@
69
96
)
70
97
```
71
98
99
+
[`KubeRayInteractiveJob`](api/kuberay.md#dagster_ray.kuberay.KubeRayInteractiveJob) will create a `RayJob`, connect to it, and optionally perform cleanup according to the configured policy.
100
+
72
101
Learn more by reading the [tutorials](tutorial/index.md).
73
102
74
103
## 🛠️ Choosing Your Integration
@@ -118,6 +147,7 @@ Learn more by reading the [tutorials](tutorial/index.md).
description="Enable tracing: inject `RAY_PROFILING=1` and `RAY_task_events_report_interval_ms=0` into the Ray cluster configuration. This allows using `ray.timeline()` to fetch recorded task events. Learn more: https://docs.ray.io/en/latest/ray-core/api/doc/ray.timeline.html#ray-timeline",
85
+
description="Enable tracing: inject `RAY_PROFILING=1` and `RAY_task_events_report_interval_ms=0` into the Ray cluster configuration. This allows using `ray.timeline()` to fetch recorded task events. Learn more: [KubeRay docs](https://docs.ray.io/en/latest/ray-core/api/doc/ray.timeline.html#ray-timeline)",
86
86
)
87
87
enable_actor_task_logging: bool=Field(
88
88
default=False,
89
89
description="Enable actor task logging: inject `RAY_ENABLE_RECORD_ACTOR_TASK_LOGGING=1` into the Ray cluster configuration.",
90
90
)
91
91
enable_debug_post_mortem: bool=Field(
92
92
default=False,
93
-
description="Enable post-mortem debugging: inject `RAY_DEBUG_POST_MORTEM=1` into the Ray cluster configuration. Learn more: https://docs.ray.io/en/latest/ray-observability/ray-distributed-debugger.html",
93
+
description="Enable post-mortem debugging: inject `RAY_DEBUG_POST_MORTEM=1` into the Ray cluster configuration. Learn more: [KubeRay docs](https://docs.ray.io/en/latest/ray-observability/ray-distributed-debugger.html)",
94
94
)
95
95
enable_legacy_debugger: bool=Field(
96
96
default=False,
97
-
description="Enable legacy debugger: inject `RAY_DEBUG=legacy` into the Ray cluster configuration. Learn more: https://docs.ray.io/en/latest/ray-observability/user-guides/debug-apps/ray-debugging.html#using-the-ray-debugger",
97
+
description="Enable legacy debugger: inject `RAY_DEBUG=legacy` into the Ray cluster configuration. Learn more: [KubeRay docs](https://docs.ray.io/en/latest/ray-observability/user-guides/debug-apps/ray-debugging.html#using-the-ray-debugger)",
The steps are started inside the Ray cluster directly.
66
-
When used together with the `RayRunLauncher`, the executor can inherit the job submission client configuration.
66
+
When used together with [`RayRunLauncher`][dagster_ray.core.run_launcher.RayRunLauncher], the executor can inherit the job submission client configuration.
67
67
This behavior can be disabled by setting `inherit_job_submission_client_from_ray_run_launcher` to `False`.
It is advised to use `dagster_ray.kuberay.KubeRayInteractiveJob` with KubeRay >= 1.3.0 instead.
31
+
It is advised to use [`KubeRayInteractiveJob`][dagster_ray.kuberay.resources.KubeRayInteractiveJob] with KubeRay >= 1.3.0 instead.
32
32
33
33
Info:
34
34
Image defaults to `dagster/image` run tag.
@@ -49,7 +49,7 @@ class KubeRayCluster(BaseKubeRayResourceConfig, RayResource):
49
49
)
50
50
log_cluster_conditions: bool=Field(
51
51
default=True,
52
-
description="Whether to log RayCluster conditions while waiting for the RayCluster to become ready. For more information, see https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/observability.html#raycluster-status-conditions.",
52
+
description="Whether to log RayCluster conditions while waiting for the RayCluster to become ready. Learn more: [KubeRay docs](https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/observability.html#raycluster-status-conditions).",
Is the recommended way to run Ray workloads with automatic cluster management. It creates a `RayJob`, connects to it in client mode and sets the `jobId` field. Cleanup is handled by the KubeRay controller or by the resource lifecycle logic.
50
+
Is the recommended way to run Ray workloads with automatic cluster management. It creates a Ray Job, connects to it in client mode and sets the `jobId` field. Cleanup is handled by the KubeRay controller or by the resource lifecycle logic.
51
51
52
52
Info:
53
53
Image defaults to `dagster/image` run tag.
@@ -72,7 +72,7 @@ class KubeRayInteractiveJob(RayResource, BaseKubeRayResourceConfig):
72
72
73
73
log_cluster_conditions: bool=Field(
74
74
default=True,
75
-
description="Whether to log `RayCluster` conditions while waiting for the RayCluster to become ready. For more information, see https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/observability.html#raycluster-status-conditions.",
75
+
description="Whether to log `RayCluster` conditions while waiting for the RayCluster to become ready. Learn more: [KubeRay docs](https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/observability.html#raycluster-status-conditions).",
0 commit comments