Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cblmemo committed Dec 30, 2023
1 parent b53976a commit 98f8c29
Showing 1 changed file with 5 additions and 5 deletions.
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(
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

0 comments on commit 98f8c29

Please sign in to comment.