Skip to content

[Core][Node Labels 2/n] Add labels param in python ray.init() to setting node labels#36007

Merged
jjyao merged 1 commit intoray-project:masterfrom
larrylian:node_labels_2
Jun 12, 2023
Merged

[Core][Node Labels 2/n] Add labels param in python ray.init() to setting node labels#36007
jjyao merged 1 commit intoray-project:masterfrom
larrylian:node_labels_2

Conversation

@larrylian
Copy link
Copy Markdown
Contributor

@larrylian larrylian commented Jun 2, 2023

Why are these changes needed?

Add labels param in python ray.init() to setting node labels
user cases:

  labels = {"gpu_type": "A100", "region": "us"}
  ray.init(labels=labels)
  assert ray.nodes()[0]["Labels"] == labels
  ray.shutdown()
  ray.init(labels={})
  assert ray.nodes()[0]["Labels"] == {}

Related issue number

Enhancing node affinity scheduling feature through node labels #34894

(P1)Finalize the format for setting node labels in the ray.init() interface of Python worker.

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 :(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since these are kwargs and the ordering doesn't matter, let's put this next to resources, that will logically be the best place to put it :)

Copy link
Copy Markdown
Contributor

@pcmoritz pcmoritz left a comment

Choose a reason for hiding this comment

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

Please address the comment before merging it :)

node labels

Signed-off-by: LarryLian <554538252@qq.com>
@larrylian
Copy link
Copy Markdown
Contributor Author

Please address the comment before merging it :)

I went on vacation last week, and I have fixed now, and I am waiting for the CI to be merge.

@jjyao jjyao merged commit 0e50436 into ray-project:master Jun 12, 2023
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…ing node labels (ray-project#36007)

Signed-off-by: LarryLian <554538252@qq.com>
Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants