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

Change core worker C++ namespace to ray::core #17610

Merged
merged 27 commits into from
Aug 8, 2021

Conversation

raulchen
Copy link
Contributor

@raulchen raulchen commented Aug 5, 2021

Why are these changes needed?

In order to avoid namespace conflicts between ray core code and C++ worker code, we wanted to change the namespace of all ray core code to "ray::core". However, this turned out to be too complex.
Thus, this PR only changes core worker namespace, which should resolve most conflicts with the C++ worker.

Related issue number

#17388

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

@raulchen raulchen requested review from scv119, kfstorm and rkooo567 August 5, 2021 11:53
@raulchen raulchen force-pushed the ray_core_namespace branch from e916fab to 2d3b17f Compare August 5, 2021 11:56
@qicosmos
Copy link
Contributor

qicosmos commented Aug 5, 2021

Also need to deal with such classes:

util/logging.h (RayLogLevel,RayLog)

cmmon/task/task.h(Task)

@qicosmos qicosmos self-requested a review August 5, 2021 12:01
@raulchen
Copy link
Contributor Author

raulchen commented Aug 5, 2021

Also need to deal with such classes:

util/logging.h (RayLogLevel,RayLog)

cmmon/task/task.h(Task)

this PR only handles core worker code to avoid a huge PR

Copy link
Contributor

@SongGuyang SongGuyang left a comment

Choose a reason for hiding this comment

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

LGTM.

@raulchen raulchen force-pushed the ray_core_namespace branch from a93d02b to 8173087 Compare August 6, 2021 05:51
Copy link
Member

@kfstorm kfstorm left a comment

Choose a reason for hiding this comment

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

Could you list the results of git grep ray:: src/ray/core_worker? I'd like to know where the remaining usages of ray:: prefix are in core worker code.

@@ -21,6 +21,8 @@
namespace ray {
namespace api {

using ray::core::WorkerType;
Copy link
Member

Choose a reason for hiding this comment

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

Should we avoid using in header files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This header is not exposed to users. So I think it's fine. we should avoid using in api headers.

@@ -26,20 +26,20 @@
#include "ray/util/util.h"

namespace ray {
namespace core {
namespace {
Copy link
Member

Choose a reason for hiding this comment

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

Remove this line.

@@ -24,6 +24,9 @@
#include "ray/common/ray_object.h"
#include "ray/core_worker/core_worker.h"

using namespace ray;
using namespace ray::core;
Copy link
Member

Choose a reason for hiding this comment

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

Nice change!

@kfstorm
Copy link
Member

kfstorm commented Aug 6, 2021

Since we already have ray::gcs and ray::raylet, do you plan to keep them or rename them to ray::core::gcs and ray::core::raylet? If you want to rename, should we move the core worker code to ray::core::coreworker in this PR?

@raulchen
Copy link
Contributor Author

raulchen commented Aug 6, 2021

@kfstorm I tried changing everything, but that's too complex. I'd prefer keeping ray::raylet and ray::gcs for now.

@kfstorm
Copy link
Member

kfstorm commented Aug 7, 2021

@raulchen Do you plan to rename ray::gcs to ray::core::gcsin a later PR?

@raulchen raulchen merged commit 0858f0e into ray-project:master Aug 8, 2021
@raulchen raulchen deleted the ray_core_namespace branch August 8, 2021 15:34
@raulchen
Copy link
Contributor Author

raulchen commented Aug 9, 2021

we'll try changing other parts after releasing C++ worker.

clarkzinzow pushed a commit to clarkzinzow/ray that referenced this pull request Aug 12, 2021
clarkzinzow added a commit that referenced this pull request Aug 12, 2021
* [Core] Support ConcurrentGroup part1 (#16795)

* Core change and Java change.

* Fix void call.

* Address comments and fix cases.

* Fix asyncio

* Change core worker C++ namespace to ray::core (#17610)

* [C++ Worker] Replace `Ray::xxx` with `ray::xxx` and update namespaces (#17388)

* [core] make 'PopWorker' to be an async function (#17202)

* make 'PopWorker' to be an async function

* pop worker async works

* fix

* address comments

* bugfix

* fix cluster_task_manager_test

* fix

* bugfix of detached actor

* address comments

* fix

* address comments

* fix aioredis

* Revert "fix aioredis"

This reverts commit 041b983.

* bug fix

* fix

* fix test_step_resources test

* format

* add unit test

* fix

* add test case PopWorkerStatus

* address commit

* fix lint

* address comments

* add python test

* address comments

* make an independent function

* Update test_basic_3.py

Co-authored-by: Hao Chen <chenh1024@gmail.com>

Co-authored-by: Qing Wang <kingchin1218@gmail.com>
Co-authored-by: Hao Chen <chenh1024@gmail.com>
Co-authored-by: qicosmos <383121719@qq.com>
Co-authored-by: SongGuyang <guyang.sgy@antfin.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.

5 participants