Skip to content

Commit

Permalink
fix: do not initialize cloud client when building bento (#4998)
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Sep 25, 2024
1 parent 27267ec commit 7cc0d0e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bentoml_cli/bentos.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ def push(
help="Platform to build for",
type=click.Choice(ALLOWED_PLATFORMS),
)
@inject
def build( # type: ignore (not accessed)
build_ctx: str,
bentofile: str,
Expand All @@ -407,7 +406,6 @@ def build( # type: ignore (not accessed)
threads: int,
containerize: bool,
platform: str | None,
_cloud_client: BentoCloudClient = Provide[BentoMLContainer.bentocloud_client],
):
"""Build a new Bento from current directory."""
from bentoml._internal.configuration import set_quiet_mode
Expand Down Expand Up @@ -462,7 +460,8 @@ def build( # type: ignore (not accessed)
if push:
if not get_quiet_mode():
rich.print(f"\n[magenta]Pushing {bento} to BentoCloud...[/]")
_cloud_client.bento.push(bento, force=force, threads=threads)
cloud_client = BentoMLContainer.bentocloud_client.get()
cloud_client.bento.push(bento, force=force, threads=threads)
elif containerize:
backend: DefaultBuilder = t.cast(
"DefaultBuilder", os.getenv("BENTOML_CONTAINERIZE_BACKEND", "docker")
Expand Down

0 comments on commit 7cc0d0e

Please sign in to comment.