Skip to content

Conversation

alanwguo
Copy link
Contributor

Why are these changes needed?

label-based selection is being added as a feature. tracker here: #51564

As part of the feature, we should allow users to observe labels of nodes and selection rules of tasks and actors.
This PR adds these fields to:

  • state api CLI output
  • state api API responses
  • Ray Dashboard UI

Nodes:
Screenshot 2025-05-29 at 2 26 30 PM
Screenshot 2025-05-29 at 2 26 26 PM

Tasks:
Screenshot 2025-05-29 at 2 26 49 PM
Screenshot 2025-05-29 at 2 26 53 PM

Actors:
Screenshot 2025-05-29 at 3 06 15 PM
Screenshot 2025-05-29 at 3 06 17 PM

Related issue number

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: Alan Guo <aguo@anyscale.com>
@alanwguo alanwguo requested review from a team, pcmoritz and raulchen as code owners May 29, 2025 23:07
@alanwguo alanwguo marked this pull request as draft May 29, 2025 23:07
@alanwguo
Copy link
Contributor Author

@nikitavemuri @MengjinYan, this is working except for the export task events. Any ideas what's missing?

@MengjinYan , ptal if this interferes with your new export work.

Signed-off-by: Alan Guo <aguo@anyscale.com>
@alanwguo
Copy link
Contributor Author

Any idea why clang-format is not working? I installed it on my mac with brew install clang-format

@MengjinYan
Copy link
Collaborator

MengjinYan commented May 30, 2025

@nikitavemuri @MengjinYan, this is working except for the export task events. Any ideas what's missing?

I tried with a local setup and I can see the label_selectors in one of the export_task_events:

{
  "event_data": {
    "attempt_number": 0,
    "job_id": "AQAAAA==",
    "state_updates": {
      "node_id": "s2vXu4O2zoSYp7lyenw3SpAshKdrhi0ymstVuA==",
      "state_ts_ns": {
        "1": "1748648100752828000",
        "2": "1748648100752871000",
        "5": "1748648100753810000"
      },
      "worker_id": "MppU4ViQhW4Xqu+E8YMc997YHHVp5cQIKI8trg=="
    },
    "task_id": "yO9FzNARJXH///////////////8BAAAA",
    "task_info": {
      "func_or_class_name": "test_label_success",
      "label_selector": {
        "test-lable-key": "test-lable-value"  // <======== The label selector
      },
      "labels": {},
      "language": "PYTHON",
      "parent_task_id": "//////////////////////////8BAAAA",
      "required_resources": {
        "CPU": 1
      },
      "runtime_env_info": {
        "runtime_env_config": {
          "eager_install": true,
          "log_files": [],
          "setup_timeout_seconds": 600
        },
        "serialized_runtime_env": "{}",
        "uris": {
          "py_modules_uris": [],
          "working_dir_uri": ""
        }
      },
      "task_id": "yO9FzNARJXH///////////////8BAAAA",
      "type": "NORMAL_TASK"
    }
  },
  "event_id": "5b1416805fa99b47c02819115647b9d2b80c",
  "source_type": "EXPORT_TASK",
  "timestamp": 1748648101
}

Is it something you tested or you were looking at something else for the export task event?

@MengjinYan , ptal if this interferes with your new export work.

No. This won't interferes with my work now.

@MengjinYan
Copy link
Collaborator

Any idea why clang-format is not working? I installed it on my mac with brew install clang-format

I never tried brew install clang-format for the lint installation

Normally I follow https://docs.ray.io/en/latest/ray-contribute/development.html#installing-additional-dependencies-for-development to install the additional dependencies for lint:

pip install -c python/requirements_compiled.txt -r python/requirements/lint-requirements.txt

Probably you can try that to see if it will be helpful.

Signed-off-by: Alan Guo <aguo@anyscale.com>
@alanwguo alanwguo marked this pull request as ready for review June 2, 2025 17:15
@alanwguo
Copy link
Contributor Author

alanwguo commented Jun 2, 2025

Any idea why clang-format is not working? I installed it on my mac with brew install clang-format

I never tried brew install clang-format for the lint installation

Normally I follow https://docs.ray.io/en/latest/ray-contribute/development.html#installing-additional-dependencies-for-development to install the additional dependencies for lint:

pip install -c python/requirements_compiled.txt -r python/requirements/lint-requirements.txt

Probably you can try that to see if it will be helpful.

yes, this fixed it. Thanks!

@alanwguo alanwguo added the go add ONLY when ready to merge, run all tests label Jun 3, 2025
Copy link
Contributor

@ryanaoleary ryanaoleary left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding this!

Copy link
Collaborator

@MengjinYan MengjinYan left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. It looks good. Thanks!

@edoakes edoakes merged commit 2f93603 into ray-project:master Jun 11, 2025
6 checks passed
elliot-barn pushed a commit that referenced this pull request Jun 18, 2025
label-based selection is being added as a feature. tracker here:
#51564

As part of the feature, we should allow users to observe labels of nodes
and selection rules of tasks and actors.
This PR adds these fields to:
- state api CLI output
- state api API responses
- Ray Dashboard UI

Nodes:
![Screenshot 2025-05-29 at 2 26
30 PM](https://github.com/user-attachments/assets/1dcd5faf-bdcf-440b-b03f-0eeeb23a46bb)
![Screenshot 2025-05-29 at 2 26
26 PM](https://github.com/user-attachments/assets/8b37c283-342f-43e6-8d87-19e56e514817)

Tasks:
![Screenshot 2025-05-29 at 2 26
49 PM](https://github.com/user-attachments/assets/15c1fc6f-e540-4030-99ec-ae9124df83eb)
![Screenshot 2025-05-29 at 2 26
53 PM](https://github.com/user-attachments/assets/e078981f-cf46-47a1-b49a-4e37ffa63502)

Actors:
![Screenshot 2025-05-29 at 3 06
15 PM](https://github.com/user-attachments/assets/7de5c507-c44d-412f-828a-6b30a7466e04)
![Screenshot 2025-05-29 at 3 06
17 PM](https://github.com/user-attachments/assets/954b36e0-9042-41e6-a4a9-d88803559975)

---------

Signed-off-by: Alan Guo <aguo@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
elliot-barn pushed a commit that referenced this pull request Jul 2, 2025
label-based selection is being added as a feature. tracker here:
#51564

As part of the feature, we should allow users to observe labels of nodes
and selection rules of tasks and actors.
This PR adds these fields to:
- state api CLI output
- state api API responses
- Ray Dashboard UI

Nodes:
![Screenshot 2025-05-29 at 2 26
30 PM](https://github.com/user-attachments/assets/1dcd5faf-bdcf-440b-b03f-0eeeb23a46bb)
![Screenshot 2025-05-29 at 2 26
26 PM](https://github.com/user-attachments/assets/8b37c283-342f-43e6-8d87-19e56e514817)

Tasks:
![Screenshot 2025-05-29 at 2 26
49 PM](https://github.com/user-attachments/assets/15c1fc6f-e540-4030-99ec-ae9124df83eb)
![Screenshot 2025-05-29 at 2 26
53 PM](https://github.com/user-attachments/assets/e078981f-cf46-47a1-b49a-4e37ffa63502)

Actors:
![Screenshot 2025-05-29 at 3 06
15 PM](https://github.com/user-attachments/assets/7de5c507-c44d-412f-828a-6b30a7466e04)
![Screenshot 2025-05-29 at 3 06
17 PM](https://github.com/user-attachments/assets/954b36e0-9042-41e6-a4a9-d88803559975)

---------

Signed-off-by: Alan Guo <aguo@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
edoakes pushed a commit that referenced this pull request Jul 9, 2025
…and task detail pages (#54292)

Follow-up to #53423

Missed a few places in the UI.
Also updates placement group tables to use the same code preview
component as the actor and tasks tables.

Placement group table
![Screenshot 2025-07-02 at 4 00
53 PM](https://github.com/user-attachments/assets/8de97470-abda-4680-b2fb-a4f90add0063)
![Screenshot 2025-07-02 at 4 00
56 PM](https://github.com/user-attachments/assets/a3c37e6f-c9db-4b37-b873-a5fbbd3012d7)

Actor detail
![Screenshot 2025-07-02 at 4 01
05 PM](https://github.com/user-attachments/assets/839cdaea-b441-4380-9c77-4ccb4ebfe563)

Task detail
![Screenshot 2025-07-02 at 4 01
19 PM](https://github.com/user-attachments/assets/aa12461c-a192-4114-a7fd-824613b9c6e6)

---------

Signed-off-by: Alan Guo <aguo@anyscale.com>
ccmao1130 pushed a commit to ccmao1130/ray that referenced this pull request Jul 29, 2025
…and task detail pages (ray-project#54292)

Follow-up to ray-project#53423

Missed a few places in the UI.
Also updates placement group tables to use the same code preview
component as the actor and tasks tables.

Placement group table
![Screenshot 2025-07-02 at 4 00
53 PM](https://github.com/user-attachments/assets/8de97470-abda-4680-b2fb-a4f90add0063)
![Screenshot 2025-07-02 at 4 00
56 PM](https://github.com/user-attachments/assets/a3c37e6f-c9db-4b37-b873-a5fbbd3012d7)

Actor detail
![Screenshot 2025-07-02 at 4 01
05 PM](https://github.com/user-attachments/assets/839cdaea-b441-4380-9c77-4ccb4ebfe563)

Task detail
![Screenshot 2025-07-02 at 4 01
19 PM](https://github.com/user-attachments/assets/aa12461c-a192-4114-a7fd-824613b9c6e6)

---------

Signed-off-by: Alan Guo <aguo@anyscale.com>
Signed-off-by: ChanChan Mao <chanchanmao1130@gmail.com>
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