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

[SkyServe] Fix replica log not found when replica cluster not found #2924

Merged
merged 2 commits into from
Jan 3, 2024
Merged
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
10 changes: 5 additions & 5 deletions sky/serve/serve_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,6 @@ def stream_replica_logs(service_name: str,

replica_cluster_name = generate_replica_cluster_name(
service_name, replica_id)
handle = global_user_state.get_handle_from_cluster_name(
replica_cluster_name)
if handle is None:
return _FAILED_TO_FIND_REPLICA_MSG.format(replica_id=replica_id)
assert isinstance(handle, backends.CloudVmRayResourceHandle), handle

launch_log_file_name = generate_replica_launch_log_file_name(
service_name, replica_id)
Expand Down Expand Up @@ -580,6 +575,11 @@ def _get_replica_status() -> serve_state.ReplicaStatus:
f'of replica {replica_id}...{colorama.Style.RESET_ALL}')

backend = backends.CloudVmRayBackend()
handle = global_user_state.get_handle_from_cluster_name(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move handle = global_user_state.get_handle_from_cluster_name(...) before # Notify user here to make sure user won't think the log is finished.?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That makes sense! Fixed. Thanks!

replica_cluster_name)
if handle is None:
return _FAILED_TO_FIND_REPLICA_MSG.format(replica_id=replica_id)
assert isinstance(handle, backends.CloudVmRayResourceHandle), handle
# Always tail the latest logs, which represent user setup & run.
returncode = backend.tail_logs(handle, job_id=None, follow=follow)
if returncode != 0:
Expand Down