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][c++ worker]Add namespace support for c++ worker #26327

Merged
merged 8 commits into from
Jul 12, 2022

Conversation

WangTaoTheTonic
Copy link
Contributor

@WangTaoTheTonic WangTaoTheTonic commented Jul 6, 2022

Why are these changes needed?

Namespace feature has been supported in Python/Java but not in c++ worker. All created actors are assigned with a default empty namespace.

With this change, users can use namespace in c++ worker like:

RayConfig config;
config.ray_namespace = "my_ns";
ray::Init(config, ..., ...);

Then all named actor created are under namespace my_ns, they're invisible to other namespaces.

auto test_actor = ray::Actor(...).setName("name", "test_ns").Remote();

Then test_actor is under namespace test_ns, it's only visible to those who is under same one.
User can also use api with namespace to get an actor:

ray::GetActor<...>(actor_name, namespace_name);
  • ray::GetActor with namespace
  • some more test cases

I'll file another PR to update the doc.

Related issue number

#26183

Checks

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

@WangTaoTheTonic WangTaoTheTonic changed the title [WIP][core][c++ worker]Add namespace support for c++ worker [core][c++ worker]Add namespace support for c++ worker Jul 7, 2022
@jovany-wang
Copy link
Contributor

jovany-wang commented Jul 7, 2022

FYI: We are aiming to remove job config concept these days, see #26116
but I think we could merge this PR firstly, and then remove job config in C++ worker after that PR merged.

Copy link
Contributor

@jovany-wang jovany-wang left a comment

Choose a reason for hiding this comment

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

Nice PR, I left some minor comments related code style and practices.

cpp/include/ray/api/ray_config.h Show resolved Hide resolved
src/ray/util/util.h Outdated Show resolved Hide resolved
cpp/include/ray/api.h Outdated Show resolved Hide resolved
src/ray/util/util.h Outdated Show resolved Hide resolved
@raulchen raulchen merged commit 1de0d35 into ray-project:master Jul 12, 2022
@WangTaoTheTonic WangTaoTheTonic deleted the a_ns branch July 12, 2022 01:59
edoakes pushed a commit to edoakes/ray that referenced this pull request Jul 14, 2022
nikitavemuri pushed a commit to nikitavemuri/ray that referenced this pull request Jul 15, 2022
Catch-Bull pushed a commit to alipay/ant-ray that referenced this pull request Jul 18, 2022
Catch-Bull pushed a commit to alipay/ant-ray that referenced this pull request Jul 18, 2022
jovany-wang pushed a commit that referenced this pull request Jul 20, 2022
…d specifying namespace while creating/getting named actors (#26498)

We've supported namespace in c++ worker in #26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++
avnishn pushed a commit to smorad/ray that referenced this pull request Jul 20, 2022
avnishn pushed a commit to smorad/ray that referenced this pull request Jul 20, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Avnish <[email protected]>
shrekris-anyscale pushed a commit to shrekris-anyscale/ray that referenced this pull request Jul 22, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Shreyas Krishnaswamy <[email protected]>
yaxife pushed a commit to alipay/ant-ray that referenced this pull request Jul 26, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: nanqi.yxf <[email protected]>
klwuibm pushed a commit to yuanchi2807/ray that referenced this pull request Jul 27, 2022
klwuibm pushed a commit to yuanchi2807/ray that referenced this pull request Jul 27, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: klwuibm <[email protected]>
Catch-Bull pushed a commit to alipay/ant-ray that referenced this pull request Jul 27, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Catch-Bull <[email protected]>
Rohan138 pushed a commit to Rohan138/ray that referenced this pull request Jul 28, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Rohan138 <[email protected]>
franklsf95 pushed a commit to franklsf95/ray that referenced this pull request Aug 2, 2022
franklsf95 pushed a commit to franklsf95/ray that referenced this pull request Aug 2, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Frank Luan <[email protected]>
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Scott Graham <[email protected]>
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
…d specifying namespace while creating/getting named actors (ray-project#26498)

We've supported namespace in c++ worker in ray-project#26327. Here we add doc for usage and also reinforce the documents of Java and Python, like adding explanation of specifying namespace while creating named actors.

- [x] add doc for basic c++ worker namespace usage
- [x] add explanation for specifying namespace while creating named actors, in Python, Java and C++

Signed-off-by: Stefan van der Kleij <[email protected]>
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.

None yet

3 participants