Navigation Menu

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

fix(ssl): provide default values in configuration #3191

Merged
merged 2 commits into from Nov 4, 2022

Conversation

aarnphm
Copy link
Member

@aarnphm aarnphm commented Nov 4, 2022

This has to do with when using API from bentoml.serve directly, the value for SSL

is not set, whereas on CLI, all fields are default to None.

Since the configuration value is not set under our default configuration files, using serve_[http|grpc]_*
directly will result in simple_di error

Traceback (most recent call last):
  File "/Users/aarnphm/.pyenv/versions/3.10.4/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/aarnphm/.pyenv/versions/3.10.4/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/aarnphm/workspace/playground/scripts/run.py", line 18, in <module>
    serve_http_development(
  File "/Users/aarnphm/.pyenv/versions/3.10.4/lib/python3.10/site-packages/simple_di/__init__.py", line 139, in _
    return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
  File "/Users/aarnphm/.pyenv/versions/3.10.4/lib/python3.10/site-packages/simple_di/__init__.py", line 104, in _inject_args
    return tuple(a.get() if isinstance(a, Provider) else a for a in args)
  File "/Users/aarnphm/.pyenv/versions/3.10.4/lib/python3.10/site-packages/simple_di/__init__.py", line 104, in <genexpr>
    return tuple(a.get() if isinstance(a, Provider) else a for a in args)
  File "/Users/aarnphm/.pyenv/versions/3.10.4/lib/python3.10/site-packages/simple_di/providers.py", line 218, in get
    _cursor = _cursor[i]
KeyError: 'ssl'

Simple reproducible way on main:

serve_http_development(str(bento.tag), working_dir=".")

Signed-off-by: Aaron Pham 29749331+aarnphm@users.noreply.github.com

@aarnphm aarnphm requested a review from a team as a code owner November 4, 2022 19:11
@aarnphm aarnphm requested review from ssheng and sauyon and removed request for a team November 4, 2022 19:11
@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Merging #3191 (453e113) into main (a52a201) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3191   +/-   ##
=======================================
  Coverage   21.48%   21.48%           
=======================================
  Files         102      102           
  Lines        9764     9764           
  Branches     1698     1698           
=======================================
  Hits         2098     2098           
  Misses       7619     7619           
  Partials       47       47           

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@aarnphm aarnphm merged commit 364f9e5 into bentoml:main Nov 4, 2022
@aarnphm aarnphm deleted the fix/config branch November 4, 2022 20:22
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.

None yet

2 participants