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,
    envs: t.List[EnvironmentEntry] | 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,
    platform: 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
        platform: Platform to build for
    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 or {},
        include=include,
        exclude=exclude,
        envs=envs or [],
        docker=docker,
        python=python,
        conda=conda,
        models=models or [],
    )

    return Bento.create(
        build_config=build_config,
        version=version,
        build_ctx=build_ctx,
        platform=platform,
    ).save(_bento_store)
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
platform: Platform to build for
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",
),
)
src/bentoml/bentos.py