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][dashboard] Add repr_name as part of actor state #33555

Merged
merged 7 commits into from
Mar 23, 2023

Conversation

rickyyx
Copy link
Contributor

@rickyyx rickyyx commented Mar 21, 2023

Why are these changes needed?

If an actor has __repr__ defined, one could retrieve the actor's repr name in the actor data.
Example:

    from ray.experimental.state.api import get_actor
    get_actor,
    @ray.remote
    class ReprActor:
        def __init__(self, x) -> None:
            self.x = x

        def __repr__(self) -> str:
            return self.x

        def ready(self):
            pass

    a = ReprActor.remote(x="repr-name-a")
    actor = get_actor(id=a._actor_id.hex())
    assert actor["repr_name"] == "repr-name-a"

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

  1. Task summary (we will likely use "group_name" in the future)
  2. Repr name on actor table as another column
  3. Repr name on actor detail.

image

image

image

@ray.remote
class Actor:
    pass


@ray.remote
class ActorClass:
    def __repr__(self) -> str:
        return "hi"

image

Related issue number

Closes #

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: rickyyx <[email protected]>
Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

only nit comments

src/ray/protobuf/gcs.proto Show resolved Hide resolved
python/ray/_raylet.pyx Outdated Show resolved Hide resolved
@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 21, 2023
@rickyyx rickyyx removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 22, 2023
@rickyyx
Copy link
Contributor Author

rickyyx commented Mar 22, 2023

The cpp-tests-asan is flaky due to this: #33475

@rkooo567
Copy link
Contributor

cc @wuisawesome can you review the gcs.proto change

@rickyyx
Copy link
Contributor Author

rickyyx commented Mar 22, 2023

Adding frontend changes to the PR as well.

Signed-off-by: rickyyx <[email protected]>
@rickyyx
Copy link
Contributor Author

rickyyx commented Mar 23, 2023

Added frontend changes.

Signed-off-by: rickyyx <[email protected]>
Signed-off-by: rickyyx <[email protected]>
@rkooo567
Copy link
Contributor

Some test failiure seems related?

@@ -30,6 +30,7 @@ export type Actor = {
[key: string]: number;
};
exitDetail: string;
reprName: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this supposed to be optional? Or does it always exist?

Copy link
Contributor Author

@rickyyx rickyyx Mar 23, 2023

Choose a reason for hiding this comment

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

it will always exist, as an empty string if no repr is defined on the actor.

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 23, 2023
Signed-off-by: rickyyx <[email protected]>
@rkooo567
Copy link
Contributor

Lmk when tests pass!

@rkooo567 rkooo567 merged commit 334ee66 into ray-project:master Mar 23, 2023
rickyyx added a commit that referenced this pull request Mar 23, 2023
scottsun94 pushed a commit to scottsun94/ray that referenced this pull request Mar 28, 2023
…3555)

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

Task summary (we will likely use "group_name" in the future)
Repr name on actor table as another column
Repr name on actor detail.
cassidylaidlaw pushed a commit to cassidylaidlaw/ray that referenced this pull request Mar 28, 2023
…3555)

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

Task summary (we will likely use "group_name" in the future)
Repr name on actor table as another column
Repr name on actor detail.
brycehuang30 pushed a commit to brycehuang30/ray that referenced this pull request Mar 29, 2023
…3555)

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

Task summary (we will likely use "group_name" in the future)
Repr name on actor table as another column
Repr name on actor detail.

Signed-off-by: bhuang <[email protected]>
joncarter1 pushed a commit to joncarter1/ray that referenced this pull request Apr 2, 2023
…3555)

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

Task summary (we will likely use "group_name" in the future)
Repr name on actor table as another column
Repr name on actor detail.

Signed-off-by: Jonathan Carter <[email protected]>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…3555)

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

Task summary (we will likely use "group_name" in the future)
Repr name on actor table as another column
Repr name on actor detail.

Signed-off-by: elliottower <[email protected]>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…3555)

This PR adds the actor's repr name as part of the PushTaskReply when executing actor creation task on the executor, and stores it as part of GCS actor table.

A couple of places where the repr name will now show up:

Task summary (we will likely use "group_name" in the future)
Repr name on actor table as another column
Repr name on actor detail.

Signed-off-by: Jack He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants