Skip to content

Commit

Permalink
fix(cli): component name regression (#2944)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheng committed Aug 26, 2022
1 parent d3d9cdb commit 6370972
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bentoml_cli/worker/http_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def main(
from bentoml._internal.context import component_context
from bentoml._internal.configuration.containers import BentoMLContainer

component_context.component_type = "api_server"
component_context.component_index = worker_id
configure_server_logging()

BentoMLContainer.development_mode.set(False)
Expand All @@ -120,9 +122,7 @@ def main(
svc = bentoml.load(bento_identifier, working_dir=working_dir, standalone_load=True)

# setup context
component_context.component_type = "api_server"
component_context.component_name = svc.name
component_context.component_index = worker_id
if svc.tag is None:
component_context.bento_name = f"*{svc.__class__.__name__}"
component_context.bento_version = "not available"
Expand Down
2 changes: 1 addition & 1 deletion bentoml_cli/worker/http_dev_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def main(
from bentoml._internal.context import component_context
from bentoml._internal.configuration.containers import BentoMLContainer

component_context.component_type = "dev_api_server"
configure_server_logging()

if prometheus_dir is not None:
Expand All @@ -91,7 +92,6 @@ def main(
svc = load(bento_identifier, working_dir=working_dir, standalone_load=True)

# setup context
component_context.component_type = "dev_api_server"
component_context.component_name = svc.name
if svc.tag is None:
component_context.bento_name = f"*{svc.__class__.__name__}"
Expand Down
6 changes: 5 additions & 1 deletion bentoml_cli/worker/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def main(
from bentoml import load
from bentoml._internal.context import component_context

component_context.component_name = f"runner:{runner_name}:{worker_id}"
# setup context
component_context.component_type = "runner"
component_context.component_name = runner_name
component_context.component_index = worker_id

from bentoml._internal.log import configure_server_logging

configure_server_logging()
Expand Down

0 comments on commit 6370972

Please sign in to comment.