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][1/n] Serve logging config API #40465

Merged
merged 15 commits into from
Oct 20, 2023

Conversation

sihanwang41
Copy link
Contributor

@sihanwang41 sihanwang41 commented Oct 18, 2023

Why are these changes needed?

LoggingConfigSchema will be located in:

  • global level: ServeDeploySchema
  • application level: ServeApplicationSchema
  • deployment level: DeploymentSchema

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
python/ray/serve/api.py Outdated Show resolved Hide resolved
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
@sihanwang41 sihanwang41 marked this pull request as ready for review October 18, 2023 22:42
@sihanwang41 sihanwang41 requested a review from a team October 18, 2023 23:37
Copy link
Contributor

@GeneDer GeneDer left a comment

Choose a reason for hiding this comment

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

LGTM!

"""

encoding: Optional[EncodingType] = EncodingType.TEXT
log_level: Optional[int] = logging.INFO
Copy link
Contributor

Choose a reason for hiding this comment

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

Just learned those have numeric values XD Should we add an validation on the allowed values?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh jeez it's not even an enum... https://github.com/python/cpython/blob/main/Lib/logging/__init__.py#L98

As this is written, in the config file users would need to look up the levels and convert them to an integer value... can we accept a Union[None, str, int] and convert passed strings to ints under the hood?

python/ray/serve/schema.py Outdated Show resolved Hide resolved
python/ray/serve/schema.py Outdated Show resolved Hide resolved
"""

encoding: Optional[EncodingType] = EncodingType.TEXT
log_level: Optional[int] = logging.INFO
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh jeez it's not even an enum... https://github.com/python/cpython/blob/main/Lib/logging/__init__.py#L98

As this is written, in the config file users would need to look up the levels and convert them to an integer value... can we accept a Union[None, str, int] and convert passed strings to ints under the hood?

@@ -63,6 +64,51 @@ def _route_prefix_format(cls, v):
return v


@PublicAPI(stability="alpha")
class LoggingConfigSchema(BaseModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is LoggingConfigSchema different from LogginConfig? Is it possible to unify them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get rid of the config.py change and only keep the schema.py.

Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
python/ray/serve/schema.py Outdated Show resolved Hide resolved
python/ray/serve/schema.py Outdated Show resolved Hide resolved
python/ray/serve/schema.py Outdated Show resolved Hide resolved
@edoakes
Copy link
Contributor

edoakes commented Oct 20, 2023

Given this isn't hooked up/implemented yet, let's wait until after branch cut to merge it.

Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
@sihanwang41
Copy link
Contributor Author

Given this isn't hooked up/implemented yet, let's wait until after branch cut to merge it.

Given this isn't hooked up/implemented yet, let's wait until after branch cut to merge it.

the branch is cut already! https://github.com/ray-project/ray/tree/releases/2.8.0

Signed-off-by: Sihan Wang <sihanwang41@gmail.com>
@edoakes edoakes merged commit e4feeb4 into ray-project:master Oct 20, 2023
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.

4 participants