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

[core] push down GetAllNodeInfo and GetAllWorkerInfo filters to GCS. #47213

Merged
merged 10 commits into from
Aug 21, 2024

Conversation

rynewang
Copy link
Contributor

@rynewang rynewang commented Aug 20, 2024

GetAllNodeInfo filters supported: node_id, state, node_name.
GetAllWorkerInfo filters supported: (num_paused_threads != 0), (is_alive == True).

Note that GetAllWorkerInfo filters are used by the Ray Debugger.

@jjyao
Copy link
Collaborator

jjyao commented Aug 20, 2024

@rkooo567 could you review this one?

Signed-off-by: Ruiyang Wang <[email protected]>
python/ray/util/state/state_manager.py Outdated Show resolved Hide resolved
python/ray/util/state/state_manager.py Outdated Show resolved Hide resolved
python/ray/util/state/state_manager.py Show resolved Hide resolved
python/ray/util/state/state_manager.py Show resolved Hide resolved
src/ray/gcs/gcs_server/gcs_node_manager.cc Outdated Show resolved Hide resolved
Signed-off-by: Ruiyang Wang <[email protected]>
@rynewang rynewang changed the title [core] push down GetAllNodeInfo filters to GCS. [core] push down GetAllNodeInfo and GetAllWorkerInfo filters to GCS. Aug 20, 2024
@@ -341,7 +340,7 @@ async def list_nodes(self, *, option: ListApiOptions) -> ListApiResponse:
result = list(islice(result, option.limit))
return ListApiResponse(
result=result,
total=total_nodes,
total=reply.total,
Copy link
Contributor

Choose a reason for hiding this comment

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

QQ: this includes filtered numbers too. right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

req_filters = GetAllWorkerInfoRequest.Filters()
for filter in filters:
key, predicate, value = filter
# Special treatments for the Ray Debugger.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add an unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unit test already exists at

def test_worker_paused(shutdown_only):

):
req_filters.exist_paused_threads = True
continue
if key == "is_alive" and predicate == "=" and value == "True":
Copy link
Contributor

Choose a reason for hiding this comment

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

can value be something like 'true' btw? (not 'True')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated. now it supports True, true, 1.

Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
@rynewang rynewang enabled auto-merge (squash) August 20, 2024 23:03
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Aug 20, 2024
Copy link
Contributor

@alexeykudinkin alexeykudinkin left a comment

Choose a reason for hiding this comment

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

@rynewang please address
#47213 (comment) before merging

python/ray/util/state/state_manager.py Outdated Show resolved Hide resolved
python/ray/util/state/state_manager.py Show resolved Hide resolved
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
@rynewang rynewang enabled auto-merge (squash) August 21, 2024 05:07
Signed-off-by: Ruiyang Wang <[email protected]>
@github-actions github-actions bot disabled auto-merge August 21, 2024 17:38
@rynewang rynewang enabled auto-merge (squash) August 21, 2024 17:44
@rynewang rynewang merged commit 63d6af3 into ray-project:master Aug 21, 2024
6 checks passed
@rynewang rynewang deleted the filter-pushdown branch August 21, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants