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] Refactor to Fix Type Checking Errors #3999

Merged
merged 10 commits into from
Oct 4, 2024

Conversation

andylizf
Copy link
Contributor

@andylizf andylizf commented Sep 26, 2024

This PR refactors multiple files within the Serve module to address type-checking errors and improve type annotations. Key changes include:

  • Adjustments to method signatures and variable types in modules like autoscalers.py and replica_managers.py for better type safety.
  • Modifications to ensure consistent use of aiohttp.ClientTimeout in load_balancer.py to prevent timeouts.
  • Refactoring of methods in serve_state.py to make paths considered as str rather than str | Path using helper functions.
  • Cleaning up and streamlining processes in service.py for managing service states and cleanup tasks.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • 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: conda deactivate; bash -i tests/backward_compatibility_tests.sh

@andylizf andylizf changed the title [Serve]: refactor to silent the type error [Serve] Refactor to silent the type error Sep 26, 2024
@andylizf andylizf changed the title [Serve] Refactor to silent the type error [Serve] Refactor to Fix Type Checking Errors Sep 26, 2024
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.

@andylizf Thanks for the refactor! This mostly looks good to me. Left some nits

sky/serve/replica_managers.py Outdated Show resolved Hide resolved
sky/serve/replica_managers.py Outdated Show resolved Hide resolved
sky/serve/serve_state.py Show resolved Hide resolved
sky/serve/service.py Show resolved Hide resolved
sky/serve/service.py Outdated Show resolved Hide resolved
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 quick fix @andylizf ! Left one last nit and after that it should be ready to go 🙌

sky/serve/service.py Show resolved Hide resolved
andylizf and others added 2 commits October 4, 2024 10:04
Co-authored-by: Tian Xia <cblmemo@gmail.com>
@cblmemo cblmemo added this pull request to the merge queue Oct 4, 2024
Merged via the queue into skypilot-org:master with commit 12706e9 Oct 4, 2024
20 checks passed
@cblmemo cblmemo deleted the refactor-serve branch October 4, 2024 17:48
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.

2 participants