Skip to content

Commit

Permalink
fix: change forbid extra keys to false for bentocloud
Browse files Browse the repository at this point in the history
Signed-off-by: FogDong <fog@bentoml.com>
  • Loading branch information
FogDong committed Jul 18, 2024
1 parent 65b22ef commit 003be5e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
34 changes: 17 additions & 17 deletions src/bentoml/_internal/cloud/schemas/modelschemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ModelManifestSchema:
@attr.define
class DeploymentTargetCanaryRule:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
type: str
weight: int
header: str
Expand All @@ -124,7 +124,7 @@ class DeploymentTargetCanaryRule:
@attr.define
class ApiServerBentoDeploymentOverrides:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
monitorExporter: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
extraPodMetadata: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
extraPodSpec: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
Expand All @@ -133,7 +133,7 @@ class ApiServerBentoDeploymentOverrides:
@attr.define
class ApiServerBentoFunctionOverrides:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
annotations: t.Optional[t.Dict[str, str]] = attr.field(default=None)
monitorExporter: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
extraPodMetadata: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
Expand All @@ -143,7 +143,7 @@ class ApiServerBentoFunctionOverrides:
@attr.define
class RunnerBentoFunctionOverrides:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
annotations: t.Optional[t.Dict[str, str]] = attr.field(default=None)
extraPodMetadata: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
extraPodSpec: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
Expand All @@ -152,15 +152,15 @@ class RunnerBentoFunctionOverrides:
@attr.define
class RunnerBentoDeploymentOverrides:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
extraPodMetadata: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)
extraPodSpec: t.Optional[t.Dict[str, t.Any]] = attr.field(default=None)


@attr.define
class BentoRequestOverrides:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
imageBuildTimeout: int = attr.field(default=None)
imageBuilderExtraPodMetadata: t.Optional[t.Dict[str, t.Any]] = attr.field(
default=None
Expand Down Expand Up @@ -193,15 +193,15 @@ class EnvItemSchema:
@attr.define
class HPAMetric:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
type: str
value: t.Any # resource.Quantity


@attr.define
class HPAPolicy:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
metrics: t.Optional[t.List[HPAMetric]] = attr.field(default=None)
scale_down_behavior: t.Optional[str] = attr.field(default=None)
scale_up_behavior: t.Optional[str] = attr.field(default=None)
Expand All @@ -210,7 +210,7 @@ class HPAPolicy:
@attr.define
class DeploymentTargetHPAConf:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
min_replicas: t.Optional[int] = attr.field(default=None)
max_replicas: t.Optional[int] = attr.field(default=None)
policy: t.Optional[HPAPolicy] = attr.field(default=None)
Expand All @@ -219,7 +219,7 @@ class DeploymentTargetHPAConf:
@attr.define
class DeploymentTargetResourceItem:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
cpu: t.Optional[str] = attr.field(default=None)
memory: t.Optional[str] = attr.field(default=None)
gpu: t.Optional[str] = attr.field(default=None)
Expand All @@ -229,23 +229,23 @@ class DeploymentTargetResourceItem:
@attr.define
class DeploymentTargetResources:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
requests: t.Optional[DeploymentTargetResourceItem] = attr.field(default=None)
limits: t.Optional[DeploymentTargetResourceItem] = attr.field(default=None)


@attr.define
class RequestQueueConfig:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
enabled: t.Optional[bool] = attr.field(default=None)
max_consume_concurrency: t.Optional[int] = attr.field(default=None)


@attr.define
class TrafficControlConfig:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
timeout: t.Optional[str] = attr.field(default=None)
request_queue: t.Optional[RequestQueueConfig] = attr.field(default=None)

Expand All @@ -260,7 +260,7 @@ class DeploymentStrategy(Enum):
@attr.define
class DeploymentTargetRunnerConfig:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
resource_instance: t.Optional[str] = attr.field(default=None)
resources: t.Optional[DeploymentTargetResources] = attr.field(default=None)
hpa_conf: t.Optional[DeploymentTargetHPAConf] = attr.field(default=None)
Expand All @@ -284,7 +284,7 @@ class DeploymentTargetRunnerConfig:
@attr.define
class DeploymentTargetConfig:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
resources: t.Optional[DeploymentTargetResources] = attr.field(
default=None, converter=dict_options_converter(DeploymentTargetResources)
)
Expand Down Expand Up @@ -320,7 +320,7 @@ class DeploymentTargetConfig:
@attr.define
class ExtraDeploymentOverrides:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
bento_function_overrides: t.Optional[ApiServerBentoFunctionOverrides] = attr.field(
default=None
)
Expand All @@ -332,7 +332,7 @@ class ExtraDeploymentOverrides:
@attr.define
class DeploymentServiceConfig:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
instance_type: t.Optional[str] = attr.field(default=None)
scaling: t.Optional[DeploymentTargetHPAConf] = attr.field(default=None)
envs: t.Optional[t.List[t.Optional[EnvItemSchema]]] = attr.field(default=None)
Expand Down
18 changes: 9 additions & 9 deletions src/bentoml/_internal/cloud/schemas/schemasv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class BentoListSchema(BaseListSchema):
@attr.define
class CreateDeploymentTargetSchema:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
bento_repository: str
bento: str
config: DeploymentTargetConfig
Expand All @@ -241,7 +241,7 @@ class CreateDeploymentTargetSchema:
@attr.define
class DeploymentSchema(ResourceSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
creator: UserSchema
cluster: ClusterSchema
status: str
Expand All @@ -254,7 +254,7 @@ class DeploymentSchema(ResourceSchema):
@attr.define
class DeploymentTargetSchema(ResourceSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
creator: UserSchema
bento: BentoFullSchema
config: DeploymentTargetConfig
Expand All @@ -266,7 +266,7 @@ class DeploymentTargetSchema(ResourceSchema):
@attr.define
class DeploymentRevisionSchema(ResourceSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
creator: UserSchema
status: str
targets: t.List[DeploymentTargetSchema]
Expand All @@ -282,7 +282,7 @@ class ResourceInstanceSchema(ResourceSchema):
@attr.define
class ClusterFullSchema(ClusterSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
organization: OrganizationSchema
kube_config: str
config: ClusterConfigSchema
Expand All @@ -293,14 +293,14 @@ class ClusterFullSchema(ClusterSchema):
@attr.define
class DeploymentListSchema(BaseListSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
items: t.List[DeploymentSchema]


@attr.define
class UpdateDeploymentSchema:
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
targets: t.List[CreateDeploymentTargetSchema]
labels: t.Optional[t.List[LabelItemSchema]] = attr.field(default=None)
description: t.Optional[str] = attr.field(default=None)
Expand All @@ -310,13 +310,13 @@ class UpdateDeploymentSchema:
@attr.define(kw_only=True)
class CreateDeploymentSchema(UpdateDeploymentSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
name: str
kube_namespace: str


@attr.define(kw_only=True)
class DeploymentFullSchema(DeploymentSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
urls: list[str]
6 changes: 3 additions & 3 deletions src/bentoml/_internal/cloud/schemas/schemasv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ class UpdateDeploymentSchema(DeploymentConfigSchema):
@attr.define(kw_only=True)
class CreateDeploymentSchema(UpdateDeploymentSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
name: t.Optional[str] = attr.field(default=None)


@attr.define
class DeploymentSchema(ResourceSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
status: str
kube_namespace: str
creator: UserSchema
Expand All @@ -82,7 +82,7 @@ class DeploymentFullSchema(DeploymentSchema):
@attr.define
class DeploymentListSchema(BaseListSchema):
__omit_if_default__ = True
__forbid_extra_keys__ = True
__forbid_extra_keys__ = False
items: t.List[DeploymentSchema]


Expand Down

0 comments on commit 003be5e

Please sign in to comment.