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

[Serve] Sync down logs #3063

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

dtran24
Copy link
Contributor

@dtran24 dtran24 commented Jan 31, 2024

Fixes #2914

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • sync down when only launch logs exists, and the two replicas are in PROVISIONING state
    • sync down across two READY replicas
    • sync down when one replica READY, and another replica terminated (e.g. through sky cancel on controller)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@dtran24 dtran24 changed the title [SkyServe] Sync down logs [Serve] Sync down logs Feb 4, 2024
@dtran24
Copy link
Contributor Author

dtran24 commented Feb 16, 2024

Requesting review @cblmemo @MaoZiming

@dtran24 dtran24 marked this pull request as ready for review February 16, 2024 05:25
Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

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

Thanks @dtran24 for this exciting feature!! Left some preliminary comments 🫡

sky/cli.py Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/serve_utils.py Outdated Show resolved Hide resolved
tests/unit_tests/test_serve_utils.py Outdated Show resolved Hide resolved
sky/serve/constants.py Outdated Show resolved Hide resolved
@dtran24 dtran24 requested a review from cblmemo February 18, 2024 01:18
sky/backends/cloud_vm_ray_backend.py Outdated Show resolved Hide resolved
sky/backends/cloud_vm_ray_backend.py Outdated Show resolved Hide resolved
sky/backends/cloud_vm_ray_backend.py Outdated Show resolved Hide resolved
sky/backends/cloud_vm_ray_backend.py Outdated Show resolved Hide resolved
sky/backends/cloud_vm_ray_backend.py Outdated Show resolved Hide resolved
sky/cli.py Outdated Show resolved Hide resolved
sky/cli.py Outdated Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/constants.py Outdated Show resolved Hide resolved
sky/serve/serve_utils.py Show resolved Hide resolved
@dtran24 dtran24 requested a review from cblmemo February 21, 2024 05:26
Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

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

Thanks for the prompt fix!! 🚀 It looks mostly great to me. Left some final comments

sky/backends/cloud_vm_ray_backend.py Show resolved Hide resolved
sky/backends/cloud_vm_ray_backend.py Show resolved Hide resolved
sky/backends/cloud_vm_ray_backend.py Outdated Show resolved Hide resolved
sky/serve/core.py Outdated Show resolved Hide resolved
sky/serve/serve_utils.py Show resolved Hide resolved
sky/serve/serve_utils.py Show resolved Hide resolved
sky/serve/serve_utils.py Outdated Show resolved Hide resolved
sky/serve/serve_utils.py Outdated Show resolved Hide resolved
launch_log_file)
replica_info = serve_state.get_replica_info_from_id(
service_name, replica_id)
if replica_info is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

For replica that has been normally terminated (scale down), we don't keep the record in database but we will keep its log file under the service directory. So it is likely the replica_info is None IIUC. Should we just continue here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inside this for loop, we are only dealing with launch log files, which shouldn't be relevant to replicas that have been normally terminated. For replicas that have been normally terminated, we manage them here

terminated_replica_log_files = [
file for file in log_files if not file.endswith('_launch.log') and
has_valid_replica_id(file, target_replica_id)
]
for file_path in terminated_replica_log_files:
shutil.copy(file_path, dir_for_download)

sky/serve/serve_utils.py Outdated Show resolved Hide resolved
@dtran24 dtran24 requested a review from cblmemo February 27, 2024 23:06
Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

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

also, could you address the merge conflict?

Copy link
Collaborator

Choose a reason for hiding this comment

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

as mentioned, we might want to move those code under sky/serve.

@Michaelvll
Copy link
Collaborator

A bump for this PR as a user is requesting this feature.

@cblmemo cblmemo self-assigned this Jun 17, 2024
@aj-ya
Copy link

aj-ya commented Jun 26, 2024

Hey! I was trying to explore on the log capturing part. Is there a way to continuously sync down the logs.
Also looks like this PR is a bit outdated. Is this going to be taken up again?

@cblmemo
Copy link
Collaborator

cblmemo commented Jun 28, 2024

Hey! I was trying to explore on the log capturing part. Is there a way to continuously sync down the logs. Also looks like this PR is a bit outdated. Is this going to be taken up again?

Hi @aj-ya ! Thanks for your interest in this PR. For now, one workaround would be having a screen session and redirecting the output of sky serve logs to some files:

sky serve logs service-name --controller > ~/serve-logs/controller.log 2>&1

This PR is on our roadmap and we'll try to prioritize it based on your request. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SkyServe] Support syncing down logs for sky serve logs
4 participants