Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): add RayTaskRunner doc example using runtime_env #14138

Merged
merged 4 commits into from
Jun 19, 2024

Conversation

parkedwards
Copy link
Contributor

@parkedwards parkedwards commented Jun 19, 2024

resolves #14099

Example

Checklist

  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.
  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

Comment on lines 339 to 350
For example, this flow uses the `RayTaskRunner` configured to access an existing Ray instance at `ray://192.0.2.255:8786`. It specifies `runtime_env` to ensure that the Ray workers have the [dependencies](https://docs.ray.io/en/latest/ray-core/handling-dependencies.html#runtime-environments) they need.

```python hl_lines="4"
from prefect import flow
from prefect_ray.task_runners import RayTaskRunner

@flow(task_runner=RayTaskRunner(address="ray://192.0.2.255:8786"))
@flow(
task_runner=RayTaskRunner(
address="ray://192.0.2.255:8786",
init_kwargs={"runtime_env": {"pip": ["prefect-ray"]}},
)
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the actual change

@parkedwards parkedwards merged commit f4fc69b into main Jun 19, 2024
4 checks passed
@parkedwards parkedwards deleted the ray-task-runner-docs branch June 19, 2024 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RayTaskRunner with remote address doesn't load prefect-ray dependency
2 participants