Skip to content

Commit

Permalink
fix: tolerate build error when watching for changes (#5000)
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Sep 26, 2024
1 parent f15110a commit d6c2735
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions src/bentoml/_internal/cloud/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,18 +869,24 @@ def is_bento_changed(bento_info: Bento) -> bool:
if not is_editable or any(
fs.path.isparent(bento_dir, p) for _, p in changes
):
bento_info = ensure_bento(
bento_dir,
bare=True,
push=False,
reload=True,
_client=self._client,
)
assert isinstance(bento_info, Bento)
if is_bento_changed(bento_info):
# stop log tail and reset the deployment
needs_update = True
break
try:
bento_info = ensure_bento(
bento_dir,
bare=True,
push=False,
reload=True,
_client=self._client,
)
except Exception as e:
spinner.console.print(
f"🚨 [bold red]Failed to build Bento: {e}[/]"
)
else:
assert isinstance(bento_info, Bento)
if is_bento_changed(bento_info):
# stop log tail and reset the deployment
needs_update = True
break

build_config = get_bento_build_config(bento_dir)
upload_files: list[tuple[str, bytes]] = []
Expand Down

0 comments on commit d6c2735

Please sign in to comment.