code: def build_bentofile(
      bentofile: str = "bentofile.yaml",
      *,
      version: str | None = None,
      build_ctx: str | None = None,
      _bento_store: BentoStore = Provide[BentoMLContainer.bento_store],
  ) -> Bento:
      """
      Build a Bento base on options specified in a bentofile.yaml file.
  
      By default, this function will look for a `bentofile.yaml` file in current working
      directory.
  
      Args:
          bentofile: The file path to build config yaml file
          version: Override the default auto generated version str
          build_ctx: Build context directory, when used as
          _bento_store: save Bento created to this BentoStore
      """
      try:
          bentofile = resolve_user_filepath(bentofile, build_ctx)
      except FileNotFoundError:
          raise InvalidArgument(f'bentofile "{bentofile}" not found')
  
      build_args = [sys.executable, "-m", "bentoml", "build"]
      if build_ctx is None:
          build_ctx = "."
      build_args.append(build_ctx)
      if version is not None:
          build_args.extend(["--version", version])
      build_args.extend(["--bentofile", bentofile, "--output", "tag"])
  
      copied = os.environ.copy()
      copied.setdefault(
          "BENTOML_HOME", BentoMLContainer.bentoml_home.get()
      )
      try:
          return get(
              _parse_tag_from_outputs(
                  subprocess.check_output(build_args, env=copied)
              ),
              _bento_store=_bento_store,
          )
      except subprocess.CalledProcessError as e:
          raise BentoMLException(
              f"Failed to build BentoService bundle (Lookup for traceback):\n{e}"
          ) from e
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import subprocess
  import sys
  import tempfile
  import typing
  from simple_di import Provide
  from simple_di import inject
  from ._internal.bento import Bento
  from ._internal.bento.build_config import BentoBuildConfig
  from ._internal.configuration.containers import BentoMLContainer
  from ._internal.tag import Tag
  from ._internal.utils import resolve_user_filepath
  from .exceptions import BadInput
  from .exceptions import BentoMLException
  from .exceptions import InvalidArgument
label_desc: Use image node_id 10 for calling a global function with example usage: build_bentofile(bentofile) and returns: get