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] Setup cgroup v2 in C++ #49416

Merged
merged 23 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
strinv view for cgroup content
Signed-off-by: dentiny <dentinyhao@gmail.com>
  • Loading branch information
dentiny committed Dec 24, 2024
commit feb0282f952fe9b504eb0224a1273f75cbe12aac
2 changes: 1 addition & 1 deletion src/ray/common/cgroup/cgroup_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ray {

// Context used to setup cgroupv2 for a task / actor.
struct PhysicalModeExecutionContext {
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: do we need this separate config class from CgroupV2Setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These data fields are necessary to construct and destruct cgroup;
As of now the struct doesn't seem that necessary since it only contains 4 fields and we could directly pass them into the factory function, but we could have much more fields (i.e. cpu-related, resource min / high), better to have a struct.

// Directory for cgroup, which is appled to application process.
// Directory for cgroup, which is applied to application process.
std::string_view cgroup_directory;
// UUID to indicate the current task / actor.
std::string uuid;
dentiny marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion src/ray/common/cgroup/cgroup_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace {
constexpr int kCgroupFilePerm = 0600;
dentiny marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a uuid, and we should not use a name like this visible in linux. We had the idea of getting a default name from cluster ID right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed as id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had the idea of getting a default name from cluster ID right?

I'm not sure how cluster id is related here?

// Open a cgroup path and append write [content] into the file.
void OpenCgroupFileAndAppend(std::string_view path, std::string content) {
void OpenCgroupFileAndAppend(std::string_view path, std::string_view content) {
std::ofstream out_file{path.data(), std::ios::out | std::ios::app};
out_file << content;
}
Expand Down
Loading