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

[UX] Fix sky jobs logs for finished jobs #4465

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion sky/jobs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def stream_logs_by_id(job_id: int, follow: bool = True) -> str:
f'{managed_job_state.get_failure_reason(job_id)}')
log_file = managed_job_state.get_local_log_file(job_id, None)
if log_file is not None:
with open(log_file, 'r', encoding='utf-8') as f:
with open(os.path.expanduser(log_file), 'r', encoding='utf-8') as f:
# Stream the logs to the console without reading the whole
# file into memory.
start_streaming = False
Expand Down
4 changes: 2 additions & 2 deletions sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def download_and_stream_latest_job_log(

This function is only used by jobs controller and sky serve controller.
"""
os.makedirs(local_dir, exist_ok=True)
os.makedirs(os.path.expanduser(local_dir), exist_ok=True)
log_file = None
try:
log_dirs = backend.sync_down_logs(
Expand All @@ -338,7 +338,7 @@ def download_and_stream_latest_job_log(
# TODO(zhwu): refactor this into log_utils, along with the
# refactoring for the log_lib.tail_logs.
try:
with open(log_file, 'r', encoding='utf-8') as f:
with open(os.path.expanduser(log_file), 'r', encoding='utf-8') as f:
# Stream the logs to the console without reading the whole
# file into memory.
start_streaming = False
Expand Down
Loading