Packaging and containerization

From VectorSpaceLab/AREX-Skill · View interactive version

Packaging and containerization is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Build BentoML Services into Bentos, author bentofile.yaml or equivalent build options, configure runtime images/dependencies, manage local Bento stores, and containerize safely.

How to use this skill

Skill file

Packaging and Containerization

Use this sub-skill when the task is about turning a BentoML Service into a Bento artifact or OCI image: bentoml build, bentoml.build(...), bentofile.yaml, pyproject.toml [tool.bentoml.build], dependency/runtime image settings, file inclusion, local Bento store operations, or bentoml containerize.

Do not use this sub-skill for writing the Service/API itself, running clients or servers, BentoCloud deployment, or framework-specific model import/export details. Route those to service-authoring, serving-and-clients, cli-and-cloud, or model-management.

Fast Path

  1. Identify the entry Service import path, usually service:ClassName for a class decorated with @bentoml.service or module:svc for an exported service object.
  2. Prefer runtime image configuration in Python with bentoml.images.Image(...) attached to @bentoml.service(image=...) for new SDK Services.
  3. Use bentofile.yaml or [tool.bentoml.build] when the project needs declarative build metadata, file patterns, models, or compatibility with existing workflows.
  4. Run safe local validation before building: parse the YAML, check required files, inspect include/exclude patterns, and confirm dependency files exist.
  5. Build with bentoml build, bentoml build -f path/to/bentofile.yaml BUILD_CTX, or bentoml.build(...).
  6. Containerize only when Docker or another OCI backend is available: bentoml containerize BENTO_TAG or bentoml build --containerize.

Safe Local Checks

Core Workflows

Minimal Examples

A minimal bentofile.yaml:

service: "service:MyService"
include:
  - "service.py"
python:
  packages:
    - "numpy"
docker:
  python_version: "3.11"

Equivalent direct build API shape:

import bentoml

bento = bentoml.build(
    service="service:MyService",
    include=["service.py"],
    python={"packages": ["numpy"]},
    docker={"python_version": "3.11"},
)

A modern runtime image in service.py:

import bentoml

image = bentoml.images.Image(python_version="3.11").python_packages("numpy")

@bentoml.service(image=image)
class MyService:
    pass

Build Context Rules

Side-Effect Boundaries

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.