feat(scheduler): RayLogCleanupTask 4-stage cleanup of session_latest/logs#1029
Open
jinbai340997 wants to merge 3 commits into
Open
feat(scheduler): RayLogCleanupTask 4-stage cleanup of session_latest/logs#1029jinbai340997 wants to merge 3 commits into
jinbai340997 wants to merge 3 commits into
Conversation
97477cc to
d27cb60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modified files
rock/admin/scheduler/tasks/ray_log_cleanup_task.py— 4-stage shell pipeline + daemon whitelist + 3 new tunable params(
live_log_keep_days,old_logs_keep_hours,setup_log_keep_minutes) + per-category counters in return dicttests/unit/admin/scheduler/test_ray_log_cleanup_task.py— 29 tests covering all 4 stages, daemon whitelist regression guards(especially PART 2a), output parsing, init validation, from_config defaults
New tunables (all backward compatible, defaults preserve existing behavior)
live_log_keep_days— PART 2b mtime threshold for non-PID non-daemon files (default 7)old_logs_keep_hours— PART 3 mtime threshold forlogs/old/files (default 24)setup_log_keep_minutes— PART 2c mtime threshold forruntime_env_setup-*(default 60)Cron mirror (out of scope of this PR)
The ray-head node runs an identical shell pipeline via
cron daily(no rocklet on ray-head, scheduler doesn't reach it). The shellmirror lives in the rock-internal repo and is kept lock-step with this task's pipeline (manual sync — both stages added together).
Test plan
uv run pytest tests/unit/admin/scheduler/test_ray_log_cleanup_task.py -v— 29/29 PASS11.8.74.237(6-month Ray session, 1705 files):runtime_env_setup-<hex>files correctly handled by new PART 2c (verified 770+ such files exist on production worker)agent-1183572637.erretc. — agent / log_monitor / dashboard_agentfiles preserved as expected
fixes [Feature] RayLogCleanupTask 4-stage cleanup of session_latest/logs (PID-aware + daemon-safe) #1028