liveBook · Manning

Bentoml build

As explained in Machine Learning Platform Engineering

bentoml build is a BentoML command that builds a Bento from its application definition and dependencies.

bentoml build packages a BentoML service into a deployment-ready Bento containing the service definition, application files, trained model, and dependencies. The command reads bentofile.yaml and saves the resulting artifact in the local Bento Store. section 6.1.2 section 10.5

A build configuration typically specifies:

  • The service entry point, included files, Python requirements, labels, and base Docker image. section 10.5
  • A unique Bento tag in the form service_name:version_label, which identifies the built service version. section 10.5
  • A package that can be inspected with bentoml list, served locally, containerized, or pushed to a remote Bento Store. section 6.1.2

Build and continue toward deployment

Run bentoml build -f bento/bentofile.yaml. After a successful build, inspect the generated tag with bentoml list, run the service locally, and use bentoml containerize or bentoml push for deployment workflows. section 6.1.2 section 10.5

bentoml build -f bento/bentofile.yaml
ENV_NAME=production
AWS_ACCESS_KEY_ID=minio
AWS_SECRET_ACCESS_KEY=minio123
██████╗ ███████╗███╗   ██╗████████╗ ██████╗ ███╗   ███╗██╗
██╔══██╗██╔════╝████╗  ██║╚══██╔══╝██╔═══██╗████╗ ████║██║
██████╔╝█████╗  ██╔██╗ ██║   ██║   ██║   ██║██╔████╔██║██║
██╔══██╗██╔══╝  ██║╚██╗██║   ██║   ██║   ██║██║╚██╔╝██║██║
██████╔╝███████╗██║ ╚████║   ██║   ╚██████╔╝██║ ╚═╝ ██║███████╗
╚═════╝ ╚══════╝╚═╝  ╚═══╝   ╚═╝    ╚═════╝ ╚═╝     ╚═╝╚══════╝
Successfully built Bento(tag="income_classifier_service:2umhoidopolz3ktg").
Possible next steps:
 * Containerize your Bento with `bentoml containerize`:

    $ bentoml containerize \
      income_classifier_service:2umhoidopolz3ktg
      [or: bentoml build –containerize]
 * Push to BentoCloud with `bentoml push`:
    $ bentoml push \ 
      income_classifier_service:2umhoidopolz3ktg 
      [or bentoml build --push]

Shows the build command, generated Bento tag, and suggested containerization or push commands. section 6.1.2

How Machine Learning Platform Engineering covers it

How deep it goes
Explains configuration, generated tags, local storage, and deployment handoffs without detailing the build internals.
Examples
Uses YOLOv8 and MLflow-backed recommender services, with commands for building, listing, serving, containerizing, and pushing Bentos.
What it assumes
Assumes a defined BentoML service and bentofile.yaml listing files, dependencies, and an image base.
What you can do after
Builds a versioned Bento, verifies it locally, and prepares it for containerized or remote deployment.
How it connects
Connects BentoML services with bentofile.yaml, model packaging, containerization, BentoCloud, Yatai, and MLflow.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.