-
Notifications
You must be signed in to change notification settings - Fork 583
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
[API server] hornor cgroup cpu limit when set worker numbers #4848
Conversation
Signed-off-by: Aylei <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aylei! LGTM with some minor nits.
|
||
workers = [] | ||
try: | ||
workers = executor.start(cmd_args.deploy) | ||
logger.info('Starting SkyPilot API server') | ||
logger.info(f'Starting SkyPilot API server, workers={num_workers}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a bit too detailed for a user to know. Can we hide the num workers in logger.debug
or some other logs, not directly printing to the terminal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, users of remote API server and sky
CLI do not see this log in normal use cases unless they check it explicitly in ~/.sky/api_server/server.log
or by kubectl logs
(usually for diagnosis). In the meantime, infra operators of a centralized API server do care about the detailed setup. This info would help like the number of Long and Short workers we printed previously for them. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that makes sense, as long as it is not shown to the user in console, it is good to me. In that case, let's make the workers
here more explicit being uvicorn workers: {num_workers}
tests/unit_tests/test_server.py
Outdated
@@ -0,0 +1,108 @@ | |||
"""Unit tests for the SkyPilot API server.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This is great. Let's move this unit_tests to the specific subfolder, i.e. unit_tests/sky/server/test_server.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep directories flat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be confusing with a flat structure, as we have multiple server.py
in different directories, e.g. jobs.server.server.py
and serve.server.server.py
. It seems a best practice to mirror the structure of tests: https://pytest-with-eric.com/pytest-best-practices/pytest-organize-tests/#Best-Practice-2-Test-Structure-Should-Mirror-Application-Code
and some other sources.
Signed-off-by: Aylei <[email protected]>
Signed-off-by: Aylei <[email protected]>
close #4847
Tested (run the relevant ones):
On my laptop:
On K8S (cpu limit to 4 cores):
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