-
Notifications
You must be signed in to change notification settings - Fork 518
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
[Jobs] Allow logs for finished jobs and add sky jobs logs --refresh
for restartin jobs controller
#4380
Conversation
sky jobs logs --refresh
for restartin jobs controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this @Michaelvll ! Left some discussions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems super useful, thanks!
sky/jobs/state.py
Outdated
|
||
def get_local_log_file(job_id: int, task_id: Optional[int]) -> Optional[str]: | ||
"""Get the local log directory for a job.""" | ||
task_str = '' if task_id is None else f' AND task_id={task_id}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Stream the logs to the console without reading the whole | ||
# file into memory. | ||
start_streaming = False | ||
for line in f: | ||
if log_lib.LOG_FILE_START_STREAMING_AT in line: | ||
start_streaming = True | ||
if start_streaming: | ||
print(line, end='', flush=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this into some utils file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! It may require a larger refactoring of the log_lib
functions as well. Let's do it in a different PR. Added a TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fixes!
Currently,
sky jobs logs
does not work with finished jobs, although we do have the logs downloaded for failed jobs to the controller. We now enablesky jobs logs
for all finished jobs, including succeeded ones.Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py --managed-jobs
pytest tests/test_smoke.py::test_fill_in_the_name
pytest tests/test_smoke.py::test_env_check
(with newly added --detach-setup test)conda deactivate; bash -i tests/backward_compatibility_tests.sh