-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Automatically use Ray Runner if Ray is initialized (#2282)
1. Automatically switches Daft to use the Ray Runner if a user calls `ray.init(...)` before running any Daft querying 2. Also switches behavior to try and deprecate the `DAFT_RAY_ADDRESS` environment variable so that we can centralize on the normal `RAY_ADDRESS` behavior This PR ensures the following behavior: * If a user explicitly calls `daft.context.set_runner_ray/py`, this overrides all behavior * If a user calls daft.context.set_runner_ray with a specified address, but Ray is already initialized, we warn them that their address is being ignored * Otherwise, on first execution Daft will attempt to retrieve the runner config from the current environment: * Check for the `DAFT_RUNNER` environment variable for `RAY`/`PY` * Check to see if Ray is initialized, and if we aren't running in a Ray worker: `RAY` * Fallback onto: `PY` Ray connection detection, on driver vs on worker: <img width="1470" alt="image" src="https://github.com/Eventual-Inc/Daft/assets/17691182/885a9dbc-0687-42ca-b0fa-6e99675bb00b"> Warning if set_runner_ray is called with an address after Ray is already initialized: <img width="1470" alt="image" src="https://github.com/Eventual-Inc/Daft/assets/17691182/8468220d-ed5a-49e6-b6e4-61c4c24f7e4e"> --------- Co-authored-by: Jay Chia <[email protected]@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
73 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters