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 log rotation for runtime env agent #50877

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Feb 25, 2025

As titled, use pipe-based redirection to setup log rotation for runtime env agent.

@dentiny dentiny added the go add ONLY when ready to merge, run all tests label Feb 25, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny force-pushed the hjiang/redirect-runtime-env-agent branch from e10a3b5 to 993da3c Compare February 25, 2025 08:07
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny requested a review from jjyao February 25, 2025 22:58
@@ -97,18 +99,16 @@ def open_capture_files(log_dir):
"--logging-rotate-bytes",
required=False,
type=int,
default=ray_constants.LOGGING_ROTATE_BYTES,
default=sys.maxsize,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The behavior here is tricky, we have two types of files here: runtime_agent.out and runtime_agent.log.

In terms of current behavior, default rotation size for out file is sys.maxsize;
while default value for log file is ray_constants.LOGGING_ROTATE_BYTES.

RedirectStderr(opt)

@staticmethod
def redirect_stdout(const c_string &file_path, uint64_t rotation_max_size, uint64_t rotation_max_file_count, c_bool tee_to_stdout, c_bool tee_to_stderr):
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the difference between this and the previous redirect_stdout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No difference.. I'm really surprised it could compile

Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny requested a review from jjyao February 25, 2025 23:02
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.

2 participants