Implementation:Bentoml BentoML DeploymentConfigParameters
Appearance
Overview
DeploymentConfigParameters implements the Principle:Bentoml_BentoML_Deployment_Configuration principle by providing a structured class that captures, validates, and normalizes all deployment configuration parameters.
API
DeploymentConfigParameters class
Source
src/bentoml/_internal/cloud/deployment.py:L64-297
Import
from bentoml._internal.cloud.deployment import DeploymentConfigParameters
Signature
class DeploymentConfigParameters:
name: str = None
path_context: str = None
bento: Tag | str = None
cluster: str = None
access_authorization: bool = None
scaling_min: int = None
scaling_max: int = None
instance_type: str = None
strategy: str = None
labels: list[dict] = None
envs: list[dict] = None
secrets: list[str] = None
extras: dict = None
config_dict: dict = None
config_file: str = None
Key Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
str | None | Deployment name (must be unique within cluster) |
path_context |
str | None | Path context for resolving relative bento paths |
bento |
str | None | Bento tag or string reference to deploy |
cluster |
str | None | Target cluster name |
access_authorization |
bool | None | Require auth for endpoint access |
scaling_min |
int | None | Minimum replica count (0 enables scale-to-zero) |
scaling_max |
int | None | Maximum replica count for auto-scaling |
instance_type |
str | None | Compute instance specification |
strategy |
str | None | Deployment update strategy |
labels |
list[dict] | None | Key-value metadata labels |
envs |
list[dict] | None | Environment variables to inject |
secrets |
list[str] | None | Named secrets from BentoCloud secret store |
extras |
dict | None | Additional provider-specific configuration |
config_dict |
dict | None | Programmatic configuration dictionary |
config_file |
str | None | Path to YAML configuration file |
Inputs and Outputs
Inputs:
- Deployment parameters provided programmatically or via YAML configuration file
- Parameters can be supplied through any combination of direct arguments,
config_dict, andconfig_file
Outputs:
- Validated
DeploymentConfigParametersinstance - The
verify()method validates the configuration against the target cluster's available resources
Verification
The verify() method performs validation against the cluster:
config = DeploymentConfigParameters(
name="my-deployment",
bento="my_service:latest",
cluster="gcp-us-central1",
scaling_min=1,
scaling_max=5,
instance_type="gpu.a10.1",
)
# Validates instance_type exists, scaling limits are valid, etc.
config.verify()
Configuration Merging
Parameters are merged with the following precedence (highest to lowest):
- Explicit keyword arguments
config_dictvaluesconfig_filevalues- BentoCloud defaults
# config_file sets scaling_max=10, but explicit param overrides to 20
config = DeploymentConfigParameters(
config_file="deploy.yaml",
scaling_max=20, # Overrides config_file value
)
YAML Configuration File Format
name: my-service
bento: my_service:v1
cluster: aws-us-east-1
access_authorization: true
scaling:
min: 2
max: 10
instance_type: gpu.t4.1
strategy: RollingUpdate
envs:
- name: LOG_LEVEL
value: INFO
secrets:
- my-secret-group
labels:
- key: environment
value: production
Metadata
| Property | Value |
|---|---|
| Implementation | DeploymentConfigParameters |
| API | DeploymentConfigParameters class
|
| Source | src/bentoml/_internal/cloud/deployment.py:L64-297
|
| Domain | ML_Serving, Cloud_Deployment, Infrastructure |
| Workflow | BentoCloud_Deployment |
| Principle | Principle:Bentoml_BentoML_Deployment_Configuration |
Knowledge Sources
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment