skypilot-org / skypilot

SkyPilot: Run AI and batch jobs on any infra (Kubernetes or 12+ clouds). Get unified execution, cost savings, and high GPU availability via a simple interface.
https://skypilot.readthedocs.io
Apache License 2.0
6.82k stars 513 forks source link

Refactor: Consolidate log streaming logic into centralized `log_utils.follow_logs()` #4292

Closed andylizf closed 1 week ago

andylizf commented 2 weeks ago

In preparation for #4128 (DAG improvements), both jobs and serve modules need log streaming functionality. This refactor provides a centralized utility to avoid duplicating the logic across modules.

We consolidate duplicated log streaming logic from serve_utils into a new utility function log_utils.follow_logs():

_Originally posted by @cblmemo in https://github.com/skypilot-org/skypilot/pull/4128#discussion_r1833464435_

Tested (run the relevant ones):

andylizf commented 2 weeks ago

@cblmemo PTAL, thanks!

andylizf commented 1 week ago

@cblmemo Please merge this PR or rerun the action - the test failure is due to resource availability as explained in #4308.