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: tolerate build error when watching for changes #5000

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading