Skip to content

Commit

Permalink
fix: add no_image switch
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jan 23, 2025
1 parent 40e88b7 commit 04df64b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/bentoml/_internal/bento/bento.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ def create(
is_legacy = isinstance(svc, Service)
# Apply default build options
image: Image | None = None
disable_image = "no_image" in enabled_features

if isinstance(svc, Service):
# for < 1.2
Expand All @@ -282,7 +283,7 @@ def create(
build_config.envs.extend(svc.envs)
if svc.image is not None:
image = svc.image
if image is None:
if image is None and not disable_image:
image = get_image_from_build_config(build_config)
build_config = build_config.with_defaults()
tag = Tag(bento_name, version)
Expand Down
4 changes: 2 additions & 2 deletions src/bentoml/testing/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def run_bento_server_distributed(
path = bento_service.path
with open(os.path.join(path, "bento.yaml"), "r", encoding="utf-8") as f:
bentofile = yaml.safe_load(f)
for runner in bentofile["runners"]:
for runner in bentofile.get("runners", []):
with reserve_free_port(enable_so_reuseport=use_grpc) as port:
runner_map[runner["name"]] = f"tcp://127.0.0.1:{port}"
cmd = [
Expand Down Expand Up @@ -363,7 +363,7 @@ def run_bento_server_distributed(
)
runner_args = [
("--depends", f"{runner['name']}={runner_map[runner['name']]}")
for runner in bentofile["runners"]
for runner in bentofile.get("runners", [])
]
cmd = [
sys.executable,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/bento_new_sdk/test_quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_local_prediction(examples: Path) -> None:


def test_build_and_prediction(examples: Path) -> None:
bento = bentoml.bentos.build(
bento = bentoml.build(
"service.py:Summarization", build_ctx=str(examples / "quickstart")
)

Expand Down

0 comments on commit 04df64b

Please sign in to comment.