BentoML icon indicating copy to clipboard operation
BentoML copied to clipboard

bug: Error when calling "bentoml.bentos.build_bentofile()"

Open holzweber opened this issue 3 months ago • 0 comments

Describe the bug

When i try to create a bento in python, i get the following error:

bentoml.exceptions.BentoMLException: Failed to build BentoService bundle (Lookup for traceback):
Command '['/opt/conda/bin/python', '-m', 'bentoml', 'build', '/tmp/tmptp9t2mki/src', '--bentofile', '/tmp/tmptp9t2mki/bentofile.yaml', '--output', 'tag']' returned non-zero exit status 1.
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 54, in op_execution_error_boundary
    yield
  File "/opt/conda/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 467, in iterate_with_context
    next_output = next(iterator)
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/compute_generator.py", line 131, in _coerce_op_compute_fn_to_iterator
    result = invoke_compute_fn(
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/compute_generator.py", line 125, in invoke_compute_fn
    return fn(context, **args_to_pass) if context_arg_provided else fn(**args_to_pass)
  File "/eppnext/epp-dagster/epp_dagster/ops/_export_model.py", line 124, in create_bento
    s = bentoml.bentos.build_bentofile(bentofile=str(tmp_dir / "bentofile.yaml"), build_ctx=str(tmp_dir / "src"))
  File "/opt/conda/lib/python3.10/site-packages/simple_di/__init__.py", line 139, in _
    return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
  File "/opt/conda/lib/python3.10/site-packages/bentoml/bentos.py", line 451, in build_bentofile
    raise BentoMLException(
The above exception was caused by the following exception:
subprocess.CalledProcessError: Command '['/opt/conda/bin/python', '-m', 'bentoml', 'build', '/tmp/tmptp9t2mki/src', '--bentofile', '/tmp/tmptp9t2mki/bentofile.yaml', '--output', 'tag']' returned non-zero exit status 1.
  File "/opt/conda/lib/python3.10/site-packages/bentoml/bentos.py", line 447, in build_bentofile
    _parse_tag_from_outputs(subprocess.check_output(build_args, env=copied)),
  File "/opt/conda/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/opt/conda/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,

To reproduce

import bentoml
tmp_dir = Path("mypath")
s = bentoml.bentos.build_bentofile(bentofile=str(tmp_dir / "bentofile.yaml"), build_ctx=str(tmp_dir / "src"))

Expected behavior

Create a bento

Environment

bentoml version: 1.2.9 Python 3.10.14

holzweber avatar Apr 03 '24 13:04 holzweber