code: def build(
      service: str,
      *,
      name: str | None = None,
      labels: dict[str, str] | None = None,
      description: str | None = None,
      include: t.List[str] | None = None,
      exclude: t.List[str] | None = None,
      docker: DockerOptions | dict[str, t.Any] | None = None,
      python: PythonOptions | dict[str, t.Any] | None = None,
      conda: CondaOptions | dict[str, t.Any] | None = None,
      models: t.List[ModelSpec | str | dict[str, t.Any]] | None = None,
      version: str | None = None,
      build_ctx: str | None = None,
      _bento_store: BentoStore = Provide[BentoMLContainer.bento_store],
  ) -> Bento:
      """
      User-facing API for building a Bento. The available build options are identical to the keys of a
      valid 'bentofile.yaml' file.
  
      This API will not respect any 'bentofile.yaml' files. Build options should instead be provided
      via function call parameters.
  
      Args:
          service: import str for finding the bentoml.Service instance build target
          labels: optional immutable labels for carrying contextual info
          description: optional description string in markdown format
          include: list of file paths and patterns specifying files to include in Bento,
                   default is all files under build_ctx, beside the ones excluded from the
                   exclude parameter or a :code:`.bentoignore` file for a given directory
          exclude: list of file paths and patterns to exclude from the final Bento archive
          docker: dictionary for configuring Bento's containerization process, see details
                  in :class:`bentoml._internal.bento.build_config.DockerOptions`
          python: dictionary for configuring Bento's python dependencies, see details in
                  :class:`bentoml._internal.bento.build_config.PythonOptions`
          conda: dictionary for configuring Bento's conda dependencies, see details in
                 :class:`bentoml._internal.bento.build_config.CondaOptions`
          version: Override the default auto generated version str
          build_ctx: Build context directory, when used as
          _bento_store: save Bento created to this BentoStore
  
      Returns:
          Bento: a Bento instance representing the materialized Bento saved in BentoStore
  
      Example:
  
          .. code-block::
  
             import bentoml
  
             bentoml.build(
                 service="fraud_detector.py:svc",
                 version="any_version_label",  # override default version generator
                 description=open("README.md").read(),
                 include=['*'],
                 exclude=[], # files to exclude can also be specified with a .bentoignore file
                 labels={
                     "foo": "bar",
                     "team": "abc"
                 },
                 python=dict(
                     packages=["tensorflow", "numpy"],
                     # requirements_txt="./requirements.txt",
                     index_url="http://<api token>:@mycompany.com/pypi/simple",
                     trusted_host=["mycompany.com"],
                     find_links=['thirdparty..'],
                     extra_index_url=["..."],
                     pip_args="ANY ADDITIONAL PIP INSTALL ARGS",
                     wheels=["./wheels/*"],
                     lock_packages=True,
                 ),
                 docker=dict(
                     distro="amazonlinux2",
                     setup_script="setup_docker_container.sh",
                     python_version="3.8",
                 ),
             )
  
      """
      build_config = BentoBuildConfig(
          service=service,
          name=name,
          description=description,
          labels=labels,
          include=include,
          exclude=exclude,
          docker=docker,
          python=python,
          conda=conda,
          models=models or [],
      )
  
      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(["--output", "tag"])
  
      copied = os.environ.copy()
      copied.setdefault(
          "BENTOML_HOME", BentoMLContainer.bentoml_home.get()
      )
  
      with tempfile.NamedTemporaryFile(
          "w", encoding="utf-8", prefix="bentoml-build-", suffix=".yaml"
      ) as f:
          build_config.to_yaml(f)
          bentofile_path = os.path.join(os.path.dirname(f.name), f.name)
          build_args.extend(["--bentofile", bentofile_path])
          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 8 for calling a global function with example usage: build(service) and returns: get