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.
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():
Move basic streaming logic from _follow_logs()
Add support for custom line handlers
Refactor _follow_replica_logs() to use the new utility
Lets left a todo for separate this part into master branch first.
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 functionlog_utils.follow_logs()
:_follow_logs()
Refactor
_follow_replica_logs()
to use the new utility_Originally posted by @cblmemo in https://github.com/skypilot-org/skypilot/pull/4128#discussion_r1833464435_
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh