platform-api-python-client 4.31.0__py3-none-any.whl → 4.41.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platform_api_python_client/__init__.py +410 -148
- platform_api_python_client/api/external_api.py +6466 -1215
- platform_api_python_client/api_client.py +81 -36
- platform_api_python_client/configuration.py +262 -66
- platform_api_python_client/exceptions.py +24 -5
- platform_api_python_client/models/__init__.py +90 -35
- platform_api_python_client/models/admission.py +106 -0
- platform_api_python_client/models/autoscaling.py +120 -0
- platform_api_python_client/models/ccl_dynamo_pools.py +117 -0
- platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +16 -16
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_chart_values.py +121 -0
- platform_api_python_client/models/{c_serve_v2_recipe.py → ccluster_catalogs_cluster_base_argo_rollouts_controller.py} +15 -18
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_chart_values.py +117 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_chart_values.py +152 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_chart_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_controller.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_istio_values.py +143 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_chart_values.py +154 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_chart_values.py +131 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_chart_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_chart_values.py +106 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_values.py +110 -0
- platform_api_python_client/models/cdi.py +113 -0
- platform_api_python_client/models/cluster_base_components.py +187 -0
- platform_api_python_client/models/cluster_capacity_response.py +5 -5
- platform_api_python_client/models/cluster_credential.py +6 -5
- platform_api_python_client/models/cluster_registration_request.py +4 -3
- platform_api_python_client/models/cluster_registration_response.py +4 -3
- platform_api_python_client/models/{istio_cni_overrides.py → cni.py} +29 -15
- platform_api_python_client/models/config_file_mount.py +6 -5
- platform_api_python_client/models/create_compute_deployment_request.py +35 -9
- platform_api_python_client/models/create_compute_deployment_response.py +4 -3
- platform_api_python_client/models/create_dynamo_deployment_request.py +67 -20
- platform_api_python_client/models/create_dynamo_deployment_response.py +4 -3
- platform_api_python_client/models/create_filesystem_volume_request.py +8 -20
- platform_api_python_client/models/create_hardware_instance_request.py +4 -3
- platform_api_python_client/models/create_inference_deployment_response.py +4 -3
- platform_api_python_client/models/create_inference_v3_deployment_request.py +52 -10
- platform_api_python_client/models/create_job_deployment_request.py +35 -9
- platform_api_python_client/models/create_job_deployment_response.py +4 -3
- platform_api_python_client/models/create_object_volume_request.py +10 -22
- platform_api_python_client/models/create_organization_request.py +4 -3
- platform_api_python_client/models/create_organization_response.py +4 -3
- platform_api_python_client/models/create_service_account_request.py +4 -3
- platform_api_python_client/models/create_service_account_response.py +4 -3
- platform_api_python_client/models/credits_response.py +4 -3
- platform_api_python_client/models/daily_bill_response.py +4 -3
- platform_api_python_client/models/{fluent_bit.py → dashboard.py} +29 -12
- platform_api_python_client/models/{prometheus_adapter.py → default_priorities.py} +29 -12
- platform_api_python_client/models/default_queue.py +106 -0
- platform_api_python_client/models/delete_user_vault_item_request.py +4 -3
- platform_api_python_client/models/deployment_log_event_v4.py +4 -3
- platform_api_python_client/models/deployment_response.py +12 -27
- platform_api_python_client/models/deployment_status_request.py +4 -3
- platform_api_python_client/models/deployment_status_response.py +4 -3
- platform_api_python_client/models/deployment_status_v3_response.py +5 -5
- platform_api_python_client/models/deployment_type.py +14 -0
- platform_api_python_client/models/deployment_usage.py +5 -5
- platform_api_python_client/models/deployment_usage_value.py +4 -3
- platform_api_python_client/models/dynamo_communications_input.py +4 -16
- platform_api_python_client/models/dynamo_frontend_config.py +105 -0
- platform_api_python_client/models/dynamo_frontend_config_response.py +105 -0
- platform_api_python_client/models/dynamo_image.py +106 -0
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +4 -16
- platform_api_python_client/models/{external_dns.py → dynamo_weight_transfer_configuration.py} +13 -13
- platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
- platform_api_python_client/models/dynamo_worker_pool_config.py +6 -18
- platform_api_python_client/models/dynamo_worker_pools.py +4 -16
- platform_api_python_client/models/{keda.py → env.py} +14 -13
- platform_api_python_client/models/generate_service_account_secret_response.py +4 -3
- platform_api_python_client/models/get_cluster_response.py +8 -5
- platform_api_python_client/models/get_compute_deployment_response.py +35 -8
- platform_api_python_client/models/get_deployment_log_response.py +4 -3
- platform_api_python_client/models/get_deployment_log_v4_response.py +5 -5
- platform_api_python_client/models/get_deployment_pods_response.py +4 -3
- platform_api_python_client/models/get_deployment_response.py +7 -7
- platform_api_python_client/models/get_deployment_revision_response.py +4 -3
- platform_api_python_client/models/get_deployment_usage_response.py +24 -9
- platform_api_python_client/models/get_dynamo_deployment_response.py +63 -15
- platform_api_python_client/models/get_filesystem_volume_response.py +4 -3
- platform_api_python_client/models/get_inference_deployment_response.py +7 -7
- platform_api_python_client/models/get_inference_v3_deployment_response.py +51 -8
- platform_api_python_client/models/get_job_deployment_response.py +35 -8
- platform_api_python_client/models/get_object_volume_response.py +4 -3
- platform_api_python_client/models/gpu_type_capacity.py +4 -3
- platform_api_python_client/models/hardware_instance_response.py +10 -5
- platform_api_python_client/models/hardware_preset_response.py +4 -3
- platform_api_python_client/models/http_validation_error.py +5 -5
- platform_api_python_client/models/image.py +113 -0
- platform_api_python_client/models/image_pull_secret_credentials.py +4 -3
- platform_api_python_client/models/{istio_cni_subchart_overrides.py → ingress.py} +26 -18
- platform_api_python_client/models/{c_serve_recipe_response.py → insight_list_item_response.py} +33 -27
- platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → insight_resource.py} +20 -14
- platform_api_python_client/models/insight_resource_type.py +37 -0
- platform_api_python_client/models/insight_response.py +133 -0
- platform_api_python_client/models/insight_severity.py +40 -0
- platform_api_python_client/models/insight_status.py +39 -0
- platform_api_python_client/models/insight_status_change_response.py +108 -0
- platform_api_python_client/models/invite_user_request.py +4 -3
- platform_api_python_client/models/istio_base.py +106 -0
- platform_api_python_client/models/istio_cni.py +124 -0
- platform_api_python_client/models/{ingress_nginx.py → istio_gateway.py} +29 -12
- platform_api_python_client/models/{dynamo_communications_output.py → istiod.py} +21 -15
- platform_api_python_client/models/list_cluster_capacity_response.py +5 -5
- platform_api_python_client/models/list_daily_bill_response.py +5 -5
- platform_api_python_client/models/list_deployment_revisions_response.py +5 -5
- platform_api_python_client/models/list_get_cluster_response.py +5 -5
- platform_api_python_client/models/list_get_deployment_response.py +5 -5
- platform_api_python_client/models/list_hardware_instance_response.py +5 -5
- platform_api_python_client/models/list_hardware_preset_response.py +5 -5
- platform_api_python_client/models/{istio_overrides.py → list_insights_response.py} +19 -20
- platform_api_python_client/models/list_organization_gpu_quota_response.py +5 -5
- platform_api_python_client/models/list_prebuilt_image_response.py +5 -5
- platform_api_python_client/models/list_service_accounts_response.py +5 -5
- platform_api_python_client/models/list_user_vault_items_response.py +5 -5
- platform_api_python_client/models/list_volumes_response.py +5 -5
- platform_api_python_client/models/{validation_error_loc_inner.py → location_inner.py} +6 -6
- platform_api_python_client/models/metric.py +13 -0
- platform_api_python_client/models/metrics.py +117 -0
- platform_api_python_client/models/metrics_config.py +6 -5
- platform_api_python_client/models/mig.py +106 -0
- platform_api_python_client/models/operator.py +117 -0
- platform_api_python_client/models/organization_gpu_quota_request.py +4 -3
- platform_api_python_client/models/organization_gpu_quota_response.py +4 -3
- platform_api_python_client/models/pilot.py +106 -0
- platform_api_python_client/models/pod_details.py +4 -3
- platform_api_python_client/models/pool.py +117 -0
- platform_api_python_client/models/prebuilt_image_response.py +4 -3
- platform_api_python_client/models/prometheus.py +110 -0
- platform_api_python_client/models/prometheus_rules.py +120 -0
- platform_api_python_client/models/prometheus_spec.py +113 -0
- platform_api_python_client/models/prometheus_values.py +117 -0
- platform_api_python_client/models/quota.py +106 -0
- platform_api_python_client/models/replicas.py +106 -0
- platform_api_python_client/models/resource_list.py +113 -0
- platform_api_python_client/models/resource_requirements.py +120 -0
- platform_api_python_client/models/revision_pod_details.py +5 -5
- platform_api_python_client/models/rollout_strategy_params.py +4 -3
- platform_api_python_client/models/scheduler.py +117 -0
- platform_api_python_client/models/service_account_response.py +4 -3
- platform_api_python_client/models/{istio.py → toggle.py} +27 -19
- platform_api_python_client/models/toleration.py +134 -0
- platform_api_python_client/models/unified_get_compute_deployment_response.py +177 -0
- platform_api_python_client/models/{c_serve_recipe_perf.py → unified_get_deployment_logs_response.py} +19 -22
- platform_api_python_client/models/{longhorn.py → unified_get_deployment_pods_response.py} +13 -14
- platform_api_python_client/models/unified_get_deployment_response.py +164 -0
- platform_api_python_client/models/unified_get_deployment_revision_response.py +110 -0
- platform_api_python_client/models/{argo_rollouts.py → unified_get_deployment_rollout_response.py} +15 -13
- platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
- platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
- platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
- platform_api_python_client/models/unified_get_job_deployment_response.py +204 -0
- platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +12 -12
- platform_api_python_client/models/{spire.py → unified_update_deployment_rollout_request.py} +12 -13
- platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
- platform_api_python_client/models/unified_write_deployment_request.py +164 -0
- platform_api_python_client/models/unified_write_deployment_response.py +110 -0
- platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
- platform_api_python_client/models/{create_c_serve_v3_deployment_request.py → unified_write_inference_v3_deployment_request.py} +86 -78
- platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
- platform_api_python_client/models/update_cluster_metadata_request.py +4 -3
- platform_api_python_client/models/{cluster_config.py → update_cluster_request.py} +11 -10
- platform_api_python_client/models/update_deployment_response.py +4 -3
- platform_api_python_client/models/update_deployment_status_v3_request.py +4 -3
- platform_api_python_client/models/update_insight_status_request.py +107 -0
- platform_api_python_client/models/update_service_account_request.py +4 -3
- platform_api_python_client/models/upsert_user_vault_item_request.py +5 -4
- platform_api_python_client/models/usage_availability.py +40 -0
- platform_api_python_client/models/usage_component.py +39 -0
- platform_api_python_client/models/user_vault_item.py +4 -3
- platform_api_python_client/models/validation_error.py +8 -8
- platform_api_python_client/models/volume_mount.py +4 -3
- platform_api_python_client/models/volume_status_response.py +4 -3
- platform_api_python_client/models/workload.py +110 -0
- platform_api_python_client/rest.py +87 -10
- platform_api_python_client-4.41.0.dist-info/METADATA +418 -0
- platform_api_python_client-4.41.0.dist-info/RECORD +206 -0
- {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.41.0.dist-info}/WHEEL +1 -1
- platform_api_python_client/models/cert_manager.py +0 -89
- platform_api_python_client/models/cluster_components.py +0 -193
- platform_api_python_client/models/final_stack.py +0 -89
- platform_api_python_client/models/get_c_serve_v2_deployment_response.py +0 -193
- platform_api_python_client/models/get_c_serve_v3_deployment_response.py +0 -194
- platform_api_python_client/models/gpu_operator.py +0 -89
- platform_api_python_client/models/kube_prometheus_stack.py +0 -89
- platform_api_python_client/models/metrics_server.py +0 -89
- platform_api_python_client/models/network_operator.py +0 -89
- platform_api_python_client/models/opentelemetry_collector.py +0 -89
- platform_api_python_client/models/spire_crds.py +0 -89
- platform_api_python_client/models/teleport_kube_agent.py +0 -89
- platform_api_python_client-4.31.0.dist-info/METADATA +0 -23
- platform_api_python_client-4.31.0.dist-info/RECORD +0 -151
- {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.41.0.dist-info}/top_level.txt +0 -0
|
@@ -22,11 +22,14 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from platform_api_python_client.models.backend_protocol import BackendProtocol
|
|
24
24
|
from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput
|
|
25
|
+
from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig
|
|
25
26
|
from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
|
|
27
|
+
from platform_api_python_client.models.dynamo_weight_transfer_configuration import DynamoWeightTransferConfiguration
|
|
26
28
|
from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools
|
|
27
29
|
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
28
30
|
from typing import Optional, Set
|
|
29
31
|
from typing_extensions import Self
|
|
32
|
+
from pydantic_core import to_jsonable_python
|
|
30
33
|
|
|
31
34
|
class CreateDynamoDeploymentRequest(BaseModel):
|
|
32
35
|
"""
|
|
@@ -36,50 +39,58 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
36
39
|
max_unavailable: Optional[StrictInt] = None
|
|
37
40
|
name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
|
|
38
41
|
cluster_id: StrictInt
|
|
39
|
-
hardware_instance_id: Optional[StrictInt] = None
|
|
42
|
+
hardware_instance_id: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.")
|
|
40
43
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
41
44
|
chart_revision: Optional[StrictStr] = None
|
|
42
45
|
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
|
-
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
46
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="Kubernetes PriorityClass name on the pod spec. Omit to leave unset.")
|
|
44
47
|
serving_mode: Optional[DynamoServingMode] = None
|
|
45
|
-
worker_pools: Optional[DynamoWorkerPools] = None
|
|
46
|
-
communications: Optional[DynamoCommunicationsInput] = None
|
|
48
|
+
worker_pools: Optional[DynamoWorkerPools] = Field(default=None, description="Hardware and scaling per worker role. Aggregated mode uses exactly `worker`; disaggregated mode uses exactly `prefill` and `decode`. Unused roles are null.")
|
|
49
|
+
communications: Optional[DynamoCommunicationsInput] = Field(default=None, description="Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration.")
|
|
50
|
+
weight_transfer: Optional[DynamoWeightTransferConfiguration] = Field(default=None, description="Platform-managed weight loading between the workers of a pool (ModelExpress peer transfer), in either serving mode. An empty object opts in and pins model_revision to a commit; omit or set null to keep the native loader.")
|
|
47
51
|
model: StrictStr
|
|
52
|
+
model_revision: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Hugging Face branch, tag or commit of `model`. The API resolves it to a commit SHA and stores that SHA, so resume and rollback load the same weights. An update keeps the stored commit when it omits this field or sends that commit, as long as `model` is unchanged and extra_args does not set --revision; send a branch or tag to move to its newest commit. With no stored commit, weight_transfer pins the default branch's current commit, and otherwise each worker loads the default branch when it starts.")
|
|
48
53
|
served_model_name: Optional[StrictStr] = None
|
|
49
54
|
runtime_version: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Dynamo runtime image tag (for example 1.4.0). Defaults to the platform's current release; GET /prebuilt-images?type=dynamo lists the versions the platform has validated, but any tag may be requested. require_gpu_direct_rdma needs an EFA-capable image. Changing it restarts every component of a running deployment.")
|
|
50
|
-
min_replicas: Optional[StrictInt] = None
|
|
51
|
-
max_replicas: Optional[StrictInt] = None
|
|
52
|
-
concurrency: Optional[StrictInt] = None
|
|
53
|
-
cooldown_period: Optional[StrictInt] = None
|
|
54
|
-
extra_args: Optional[StrictStr] = None
|
|
55
|
+
min_replicas: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.")
|
|
56
|
+
max_replicas: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.")
|
|
57
|
+
concurrency: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.")
|
|
58
|
+
cooldown_period: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.")
|
|
59
|
+
extra_args: Optional[StrictStr] = Field(default=None, description="Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected.")
|
|
55
60
|
hf_token: Optional[StrictStr] = None
|
|
61
|
+
hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN. Cannot be combined with hf_token.")
|
|
56
62
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
63
|
+
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
57
64
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
65
|
+
bearer_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
58
66
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
67
|
+
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
59
68
|
enable_logging: Optional[StrictBool] = True
|
|
60
69
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
61
70
|
backend_protocol: Optional[BackendProtocol] = None
|
|
62
|
-
|
|
71
|
+
frontend: Optional[DynamoFrontendConfig] = Field(default=None, description="Replica bounds and size of the Frontend (HTTP server and router) pods serving the endpoint, which are placed on separate nodes where possible. Two keep the endpoint serving through a node loss. min_replicas and max_replicas must be equal until Frontend autoscaling is supported. Changing any of these restarts every component of a running deployment.")
|
|
72
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "serving_mode", "worker_pools", "communications", "weight_transfer", "model", "model_revision", "served_model_name", "runtime_version", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "hf_token", "hf_token_ref", "env_vars", "env_vars_refs", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "image_pull_ref", "enable_logging", "enable_node_model_cache", "backend_protocol", "frontend"]
|
|
63
73
|
|
|
64
|
-
@field_validator('name')
|
|
74
|
+
@field_validator('name', mode="before")
|
|
65
75
|
def name_validate_regular_expression(cls, value):
|
|
66
76
|
"""Validates the regular expression"""
|
|
67
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
77
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
68
78
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
69
79
|
return value
|
|
70
80
|
|
|
71
|
-
@field_validator('runtime_version')
|
|
81
|
+
@field_validator('runtime_version', mode="before")
|
|
72
82
|
def runtime_version_validate_regular_expression(cls, value):
|
|
73
83
|
"""Validates the regular expression"""
|
|
74
84
|
if value is None:
|
|
75
85
|
return value
|
|
76
86
|
|
|
77
|
-
if not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value):
|
|
87
|
+
if isinstance(value, str) and not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value):
|
|
78
88
|
raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$/")
|
|
79
89
|
return value
|
|
80
90
|
|
|
81
91
|
model_config = ConfigDict(
|
|
82
|
-
|
|
92
|
+
validate_by_name=True,
|
|
93
|
+
validate_by_alias=True,
|
|
83
94
|
validate_assignment=True,
|
|
84
95
|
protected_namespaces=(),
|
|
85
96
|
)
|
|
@@ -91,8 +102,7 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
91
102
|
|
|
92
103
|
def to_json(self) -> str:
|
|
93
104
|
"""Returns the JSON representation of the model using alias"""
|
|
94
|
-
|
|
95
|
-
return json.dumps(self.to_dict())
|
|
105
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
96
106
|
|
|
97
107
|
@classmethod
|
|
98
108
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -121,8 +131,7 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
121
131
|
_items = []
|
|
122
132
|
if self.volume_mounts:
|
|
123
133
|
for _item_volume_mounts in self.volume_mounts:
|
|
124
|
-
if _item_volume_mounts
|
|
125
|
-
_items.append(_item_volume_mounts.to_dict())
|
|
134
|
+
_items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
|
|
126
135
|
_dict['volume_mounts'] = _items
|
|
127
136
|
# override the default output from pydantic by calling `to_dict()` of worker_pools
|
|
128
137
|
if self.worker_pools:
|
|
@@ -130,6 +139,12 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
130
139
|
# override the default output from pydantic by calling `to_dict()` of communications
|
|
131
140
|
if self.communications:
|
|
132
141
|
_dict['communications'] = self.communications.to_dict()
|
|
142
|
+
# override the default output from pydantic by calling `to_dict()` of weight_transfer
|
|
143
|
+
if self.weight_transfer:
|
|
144
|
+
_dict['weight_transfer'] = self.weight_transfer.to_dict()
|
|
145
|
+
# override the default output from pydantic by calling `to_dict()` of frontend
|
|
146
|
+
if self.frontend:
|
|
147
|
+
_dict['frontend'] = self.frontend.to_dict()
|
|
133
148
|
# set to None if max_surge (nullable) is None
|
|
134
149
|
# and model_fields_set contains the field
|
|
135
150
|
if self.max_surge is None and "max_surge" in self.model_fields_set:
|
|
@@ -165,6 +180,16 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
165
180
|
if self.communications is None and "communications" in self.model_fields_set:
|
|
166
181
|
_dict['communications'] = None
|
|
167
182
|
|
|
183
|
+
# set to None if weight_transfer (nullable) is None
|
|
184
|
+
# and model_fields_set contains the field
|
|
185
|
+
if self.weight_transfer is None and "weight_transfer" in self.model_fields_set:
|
|
186
|
+
_dict['weight_transfer'] = None
|
|
187
|
+
|
|
188
|
+
# set to None if model_revision (nullable) is None
|
|
189
|
+
# and model_fields_set contains the field
|
|
190
|
+
if self.model_revision is None and "model_revision" in self.model_fields_set:
|
|
191
|
+
_dict['model_revision'] = None
|
|
192
|
+
|
|
168
193
|
# set to None if served_model_name (nullable) is None
|
|
169
194
|
# and model_fields_set contains the field
|
|
170
195
|
if self.served_model_name is None and "served_model_name" in self.model_fields_set:
|
|
@@ -200,16 +225,31 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
200
225
|
if self.hf_token is None and "hf_token" in self.model_fields_set:
|
|
201
226
|
_dict['hf_token'] = None
|
|
202
227
|
|
|
228
|
+
# set to None if hf_token_ref (nullable) is None
|
|
229
|
+
# and model_fields_set contains the field
|
|
230
|
+
if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
|
|
231
|
+
_dict['hf_token_ref'] = None
|
|
232
|
+
|
|
203
233
|
# set to None if endpoint_bearer_token (nullable) is None
|
|
204
234
|
# and model_fields_set contains the field
|
|
205
235
|
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
206
236
|
_dict['endpoint_bearer_token'] = None
|
|
207
237
|
|
|
238
|
+
# set to None if bearer_token_ref (nullable) is None
|
|
239
|
+
# and model_fields_set contains the field
|
|
240
|
+
if self.bearer_token_ref is None and "bearer_token_ref" in self.model_fields_set:
|
|
241
|
+
_dict['bearer_token_ref'] = None
|
|
242
|
+
|
|
208
243
|
# set to None if endpoint_certificate_authority (nullable) is None
|
|
209
244
|
# and model_fields_set contains the field
|
|
210
245
|
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
211
246
|
_dict['endpoint_certificate_authority'] = None
|
|
212
247
|
|
|
248
|
+
# set to None if image_pull_ref (nullable) is None
|
|
249
|
+
# and model_fields_set contains the field
|
|
250
|
+
if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
|
|
251
|
+
_dict['image_pull_ref'] = None
|
|
252
|
+
|
|
213
253
|
return _dict
|
|
214
254
|
|
|
215
255
|
@classmethod
|
|
@@ -234,7 +274,9 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
234
274
|
"serving_mode": obj.get("serving_mode"),
|
|
235
275
|
"worker_pools": DynamoWorkerPools.from_dict(obj["worker_pools"]) if obj.get("worker_pools") is not None else None,
|
|
236
276
|
"communications": DynamoCommunicationsInput.from_dict(obj["communications"]) if obj.get("communications") is not None else None,
|
|
277
|
+
"weight_transfer": DynamoWeightTransferConfiguration.from_dict(obj["weight_transfer"]) if obj.get("weight_transfer") is not None else None,
|
|
237
278
|
"model": obj.get("model"),
|
|
279
|
+
"model_revision": obj.get("model_revision"),
|
|
238
280
|
"served_model_name": obj.get("served_model_name"),
|
|
239
281
|
"runtime_version": obj.get("runtime_version"),
|
|
240
282
|
"min_replicas": obj.get("min_replicas"),
|
|
@@ -243,12 +285,17 @@ class CreateDynamoDeploymentRequest(BaseModel):
|
|
|
243
285
|
"cooldown_period": obj.get("cooldown_period"),
|
|
244
286
|
"extra_args": obj.get("extra_args"),
|
|
245
287
|
"hf_token": obj.get("hf_token"),
|
|
288
|
+
"hf_token_ref": obj.get("hf_token_ref"),
|
|
246
289
|
"env_vars": obj.get("env_vars"),
|
|
290
|
+
"env_vars_refs": obj.get("env_vars_refs"),
|
|
247
291
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
292
|
+
"bearer_token_ref": obj.get("bearer_token_ref"),
|
|
248
293
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
294
|
+
"image_pull_ref": obj.get("image_pull_ref"),
|
|
249
295
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
|
|
250
296
|
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
251
|
-
"backend_protocol": obj.get("backend_protocol")
|
|
297
|
+
"backend_protocol": obj.get("backend_protocol"),
|
|
298
|
+
"frontend": DynamoFrontendConfig.from_dict(obj["frontend"]) if obj.get("frontend") is not None else None
|
|
252
299
|
})
|
|
253
300
|
return _obj
|
|
254
301
|
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
25
26
|
|
|
26
27
|
class CreateDynamoDeploymentResponse(BaseModel):
|
|
27
28
|
"""
|
|
@@ -33,7 +34,8 @@ class CreateDynamoDeploymentResponse(BaseModel):
|
|
|
33
34
|
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
|
-
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
37
39
|
validate_assignment=True,
|
|
38
40
|
protected_namespaces=(),
|
|
39
41
|
)
|
|
@@ -45,8 +47,7 @@ class CreateDynamoDeploymentResponse(BaseModel):
|
|
|
45
47
|
|
|
46
48
|
def to_json(self) -> str:
|
|
47
49
|
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
25
26
|
|
|
26
27
|
class CreateFilesystemVolumeRequest(BaseModel):
|
|
27
28
|
"""
|
|
@@ -32,13 +33,12 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
32
33
|
backend: StrictStr
|
|
33
34
|
size_gb: Optional[Annotated[int, Field(le=65536, strict=True, ge=1)]] = 100
|
|
34
35
|
storage_class: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = None
|
|
35
|
-
additional_properties: Dict[str, Any] = {}
|
|
36
36
|
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "size_gb", "storage_class"]
|
|
37
37
|
|
|
38
|
-
@field_validator('name')
|
|
38
|
+
@field_validator('name', mode="before")
|
|
39
39
|
def name_validate_regular_expression(cls, value):
|
|
40
40
|
"""Validates the regular expression"""
|
|
41
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
41
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
42
42
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
43
43
|
return value
|
|
44
44
|
|
|
@@ -49,18 +49,19 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
49
49
|
raise ValueError("must be one of enum values ('filesystem')")
|
|
50
50
|
return value
|
|
51
51
|
|
|
52
|
-
@field_validator('storage_class')
|
|
52
|
+
@field_validator('storage_class', mode="before")
|
|
53
53
|
def storage_class_validate_regular_expression(cls, value):
|
|
54
54
|
"""Validates the regular expression"""
|
|
55
55
|
if value is None:
|
|
56
56
|
return value
|
|
57
57
|
|
|
58
|
-
if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
58
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
59
59
|
raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
|
|
60
60
|
return value
|
|
61
61
|
|
|
62
62
|
model_config = ConfigDict(
|
|
63
|
-
|
|
63
|
+
validate_by_name=True,
|
|
64
|
+
validate_by_alias=True,
|
|
64
65
|
validate_assignment=True,
|
|
65
66
|
protected_namespaces=(),
|
|
66
67
|
)
|
|
@@ -72,8 +73,7 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
72
73
|
|
|
73
74
|
def to_json(self) -> str:
|
|
74
75
|
"""Returns the JSON representation of the model using alias"""
|
|
75
|
-
|
|
76
|
-
return json.dumps(self.to_dict())
|
|
76
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
77
77
|
|
|
78
78
|
@classmethod
|
|
79
79
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -89,10 +89,8 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
89
89
|
* `None` is only added to the output dict for nullable fields that
|
|
90
90
|
were set at model initialization. Other fields with value `None`
|
|
91
91
|
are ignored.
|
|
92
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
93
92
|
"""
|
|
94
93
|
excluded_fields: Set[str] = set([
|
|
95
|
-
"additional_properties",
|
|
96
94
|
])
|
|
97
95
|
|
|
98
96
|
_dict = self.model_dump(
|
|
@@ -100,11 +98,6 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
100
98
|
exclude=excluded_fields,
|
|
101
99
|
exclude_none=True,
|
|
102
100
|
)
|
|
103
|
-
# puts key-value pairs in additional_properties in the top level
|
|
104
|
-
if self.additional_properties is not None:
|
|
105
|
-
for _key, _value in self.additional_properties.items():
|
|
106
|
-
_dict[_key] = _value
|
|
107
|
-
|
|
108
101
|
# set to None if storage_class (nullable) is None
|
|
109
102
|
# and model_fields_set contains the field
|
|
110
103
|
if self.storage_class is None and "storage_class" in self.model_fields_set:
|
|
@@ -128,11 +121,6 @@ class CreateFilesystemVolumeRequest(BaseModel):
|
|
|
128
121
|
"size_gb": obj.get("size_gb") if obj.get("size_gb") is not None else 100,
|
|
129
122
|
"storage_class": obj.get("storage_class")
|
|
130
123
|
})
|
|
131
|
-
# store additional fields in additional_properties
|
|
132
|
-
for _key in obj.keys():
|
|
133
|
-
if _key not in cls.__properties:
|
|
134
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
135
|
-
|
|
136
124
|
return _obj
|
|
137
125
|
|
|
138
126
|
|
|
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
24
25
|
|
|
25
26
|
class CreateHardwareInstanceRequest(BaseModel):
|
|
26
27
|
"""
|
|
@@ -38,7 +39,8 @@ class CreateHardwareInstanceRequest(BaseModel):
|
|
|
38
39
|
__properties: ClassVar[List[str]] = ["cluster_id", "name", "gpu_type", "num_gpu", "cpu", "memory", "accelerator_resource_key", "node_affinity_labels", "accelerator_memory"]
|
|
39
40
|
|
|
40
41
|
model_config = ConfigDict(
|
|
41
|
-
|
|
42
|
+
validate_by_name=True,
|
|
43
|
+
validate_by_alias=True,
|
|
42
44
|
validate_assignment=True,
|
|
43
45
|
protected_namespaces=(),
|
|
44
46
|
)
|
|
@@ -50,8 +52,7 @@ class CreateHardwareInstanceRequest(BaseModel):
|
|
|
50
52
|
|
|
51
53
|
def to_json(self) -> str:
|
|
52
54
|
"""Returns the JSON representation of the model using alias"""
|
|
53
|
-
|
|
54
|
-
return json.dumps(self.to_dict())
|
|
55
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
55
56
|
|
|
56
57
|
@classmethod
|
|
57
58
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
25
26
|
|
|
26
27
|
class CreateInferenceDeploymentResponse(BaseModel):
|
|
27
28
|
"""
|
|
@@ -33,7 +34,8 @@ class CreateInferenceDeploymentResponse(BaseModel):
|
|
|
33
34
|
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
|
-
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
37
39
|
validate_assignment=True,
|
|
38
40
|
protected_namespaces=(),
|
|
39
41
|
)
|
|
@@ -45,8 +47,7 @@ class CreateInferenceDeploymentResponse(BaseModel):
|
|
|
45
47
|
|
|
46
48
|
def to_json(self) -> str:
|
|
47
49
|
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -27,6 +27,7 @@ from platform_api_python_client.models.metrics_config import MetricsConfig
|
|
|
27
27
|
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
28
28
|
from typing import Optional, Set
|
|
29
29
|
from typing_extensions import Self
|
|
30
|
+
from pydantic_core import to_jsonable_python
|
|
30
31
|
|
|
31
32
|
class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
32
33
|
"""
|
|
@@ -40,37 +41,54 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
40
41
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
41
42
|
chart_revision: Optional[StrictStr] = None
|
|
42
43
|
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
|
-
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
44
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="Kubernetes PriorityClass name on the pod spec. Omit to leave unset.")
|
|
45
|
+
hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN. Cannot be combined with hf_token.")
|
|
44
46
|
image_url: StrictStr
|
|
45
47
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
48
|
+
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
49
|
+
image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
|
|
46
50
|
port: Annotated[int, Field(le=65535, strict=True, ge=1)]
|
|
47
51
|
min_replicas: StrictInt
|
|
48
52
|
max_replicas: StrictInt
|
|
49
53
|
concurrency: Optional[StrictInt] = None
|
|
50
|
-
cooldown_period: Optional[
|
|
54
|
+
cooldown_period: Optional[Annotated[int, Field(le=3600, strict=True, ge=0)]] = None
|
|
51
55
|
healthcheck: Optional[StrictStr] = None
|
|
52
56
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
53
57
|
command: Optional[StrictStr] = None
|
|
54
58
|
endpoint_bearer_token: Optional[StrictStr] = None
|
|
59
|
+
bearer_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
55
60
|
endpoint_certificate_authority: Optional[StrictStr] = None
|
|
56
61
|
hf_token: Optional[StrictStr] = None
|
|
62
|
+
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
57
63
|
backend_protocol: Optional[BackendProtocol] = None
|
|
64
|
+
request_body_limit_mib: Optional[Annotated[int, Field(le=1024, strict=True, ge=1)]] = Field(default=15, description="Maximum request-body size in MiB, including encoding and multipart overhead. Defaults to 15 MiB; must be between 1 and 1024 MiB.")
|
|
58
65
|
enable_logging: Optional[StrictBool] = False
|
|
59
66
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
60
67
|
session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.")
|
|
61
68
|
config_file: Optional[ConfigFileMount] = None
|
|
62
69
|
metrics: Optional[MetricsConfig] = None
|
|
63
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "endpoint_certificate_authority", "hf_token", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
70
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "hf_token_ref", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "hf_token", "env_vars_refs", "backend_protocol", "request_body_limit_mib", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
64
71
|
|
|
65
|
-
@field_validator('name')
|
|
72
|
+
@field_validator('name', mode="before")
|
|
66
73
|
def name_validate_regular_expression(cls, value):
|
|
67
74
|
"""Validates the regular expression"""
|
|
68
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
75
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
69
76
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
70
77
|
return value
|
|
71
78
|
|
|
79
|
+
@field_validator('image_pull_secret_name', mode="before")
|
|
80
|
+
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
81
|
+
"""Validates the regular expression"""
|
|
82
|
+
if value is None:
|
|
83
|
+
return value
|
|
84
|
+
|
|
85
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
86
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
|
|
87
|
+
return value
|
|
88
|
+
|
|
72
89
|
model_config = ConfigDict(
|
|
73
|
-
|
|
90
|
+
validate_by_name=True,
|
|
91
|
+
validate_by_alias=True,
|
|
74
92
|
validate_assignment=True,
|
|
75
93
|
protected_namespaces=(),
|
|
76
94
|
)
|
|
@@ -82,8 +100,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
82
100
|
|
|
83
101
|
def to_json(self) -> str:
|
|
84
102
|
"""Returns the JSON representation of the model using alias"""
|
|
85
|
-
|
|
86
|
-
return json.dumps(self.to_dict())
|
|
103
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
87
104
|
|
|
88
105
|
@classmethod
|
|
89
106
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -112,8 +129,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
112
129
|
_items = []
|
|
113
130
|
if self.volume_mounts:
|
|
114
131
|
for _item_volume_mounts in self.volume_mounts:
|
|
115
|
-
if _item_volume_mounts
|
|
116
|
-
_items.append(_item_volume_mounts.to_dict())
|
|
132
|
+
_items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
|
|
117
133
|
_dict['volume_mounts'] = _items
|
|
118
134
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
119
135
|
if self.image_pull_secret_credentials:
|
|
@@ -144,11 +160,26 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
144
160
|
if self.priority is None and "priority" in self.model_fields_set:
|
|
145
161
|
_dict['priority'] = None
|
|
146
162
|
|
|
163
|
+
# set to None if hf_token_ref (nullable) is None
|
|
164
|
+
# and model_fields_set contains the field
|
|
165
|
+
if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
|
|
166
|
+
_dict['hf_token_ref'] = None
|
|
167
|
+
|
|
147
168
|
# set to None if image_pull_secret_credentials (nullable) is None
|
|
148
169
|
# and model_fields_set contains the field
|
|
149
170
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
150
171
|
_dict['image_pull_secret_credentials'] = None
|
|
151
172
|
|
|
173
|
+
# set to None if image_pull_ref (nullable) is None
|
|
174
|
+
# and model_fields_set contains the field
|
|
175
|
+
if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
|
|
176
|
+
_dict['image_pull_ref'] = None
|
|
177
|
+
|
|
178
|
+
# set to None if image_pull_secret_name (nullable) is None
|
|
179
|
+
# and model_fields_set contains the field
|
|
180
|
+
if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
|
|
181
|
+
_dict['image_pull_secret_name'] = None
|
|
182
|
+
|
|
152
183
|
# set to None if concurrency (nullable) is None
|
|
153
184
|
# and model_fields_set contains the field
|
|
154
185
|
if self.concurrency is None and "concurrency" in self.model_fields_set:
|
|
@@ -179,6 +210,11 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
179
210
|
if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
|
|
180
211
|
_dict['endpoint_bearer_token'] = None
|
|
181
212
|
|
|
213
|
+
# set to None if bearer_token_ref (nullable) is None
|
|
214
|
+
# and model_fields_set contains the field
|
|
215
|
+
if self.bearer_token_ref is None and "bearer_token_ref" in self.model_fields_set:
|
|
216
|
+
_dict['bearer_token_ref'] = None
|
|
217
|
+
|
|
182
218
|
# set to None if endpoint_certificate_authority (nullable) is None
|
|
183
219
|
# and model_fields_set contains the field
|
|
184
220
|
if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
|
|
@@ -220,8 +256,11 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
220
256
|
"chart_revision": obj.get("chart_revision"),
|
|
221
257
|
"volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
|
|
222
258
|
"priority": obj.get("priority"),
|
|
259
|
+
"hf_token_ref": obj.get("hf_token_ref"),
|
|
223
260
|
"image_url": obj.get("image_url"),
|
|
224
261
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
262
|
+
"image_pull_ref": obj.get("image_pull_ref"),
|
|
263
|
+
"image_pull_secret_name": obj.get("image_pull_secret_name"),
|
|
225
264
|
"port": obj.get("port"),
|
|
226
265
|
"min_replicas": obj.get("min_replicas"),
|
|
227
266
|
"max_replicas": obj.get("max_replicas"),
|
|
@@ -231,9 +270,12 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
231
270
|
"env_vars": obj.get("env_vars"),
|
|
232
271
|
"command": obj.get("command"),
|
|
233
272
|
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
|
|
273
|
+
"bearer_token_ref": obj.get("bearer_token_ref"),
|
|
234
274
|
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
|
|
235
275
|
"hf_token": obj.get("hf_token"),
|
|
276
|
+
"env_vars_refs": obj.get("env_vars_refs"),
|
|
236
277
|
"backend_protocol": obj.get("backend_protocol"),
|
|
278
|
+
"request_body_limit_mib": obj.get("request_body_limit_mib") if obj.get("request_body_limit_mib") is not None else 15,
|
|
237
279
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
|
|
238
280
|
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
239
281
|
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
|
|
@@ -25,6 +25,7 @@ from platform_api_python_client.models.image_pull_secret_credentials import Imag
|
|
|
25
25
|
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
26
26
|
from typing import Optional, Set
|
|
27
27
|
from typing_extensions import Self
|
|
28
|
+
from pydantic_core import to_jsonable_python
|
|
28
29
|
|
|
29
30
|
class CreateJobDeploymentRequest(BaseModel):
|
|
30
31
|
"""
|
|
@@ -36,10 +37,13 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
36
37
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
38
|
chart_revision: Optional[StrictStr] = None
|
|
38
39
|
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
39
|
-
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
40
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="Kubernetes PriorityClass name on the pod spec. Omit to leave unset.")
|
|
40
41
|
image_url: StrictStr
|
|
41
42
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
43
|
+
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
44
|
+
image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
|
|
42
45
|
env_vars: Optional[Dict[str, StrictStr]] = None
|
|
46
|
+
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
43
47
|
command: Optional[StrictStr] = None
|
|
44
48
|
completions: Optional[StrictInt] = 1
|
|
45
49
|
parallelism: Optional[StrictInt] = 1
|
|
@@ -47,17 +51,28 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
47
51
|
active_deadline_seconds: Optional[StrictInt] = None
|
|
48
52
|
enable_logging: Optional[StrictBool] = True
|
|
49
53
|
config_file: Optional[ConfigFileMount] = None
|
|
50
|
-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "env_vars", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
54
|
+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "env_vars", "env_vars_refs", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
51
55
|
|
|
52
|
-
@field_validator('name')
|
|
56
|
+
@field_validator('name', mode="before")
|
|
53
57
|
def name_validate_regular_expression(cls, value):
|
|
54
58
|
"""Validates the regular expression"""
|
|
55
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
59
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
56
60
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
57
61
|
return value
|
|
58
62
|
|
|
63
|
+
@field_validator('image_pull_secret_name', mode="before")
|
|
64
|
+
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
65
|
+
"""Validates the regular expression"""
|
|
66
|
+
if value is None:
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
70
|
+
raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
|
|
71
|
+
return value
|
|
72
|
+
|
|
59
73
|
model_config = ConfigDict(
|
|
60
|
-
|
|
74
|
+
validate_by_name=True,
|
|
75
|
+
validate_by_alias=True,
|
|
61
76
|
validate_assignment=True,
|
|
62
77
|
protected_namespaces=(),
|
|
63
78
|
)
|
|
@@ -69,8 +84,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
69
84
|
|
|
70
85
|
def to_json(self) -> str:
|
|
71
86
|
"""Returns the JSON representation of the model using alias"""
|
|
72
|
-
|
|
73
|
-
return json.dumps(self.to_dict())
|
|
87
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
74
88
|
|
|
75
89
|
@classmethod
|
|
76
90
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -99,8 +113,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
99
113
|
_items = []
|
|
100
114
|
if self.volume_mounts:
|
|
101
115
|
for _item_volume_mounts in self.volume_mounts:
|
|
102
|
-
if _item_volume_mounts
|
|
103
|
-
_items.append(_item_volume_mounts.to_dict())
|
|
116
|
+
_items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
|
|
104
117
|
_dict['volume_mounts'] = _items
|
|
105
118
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
106
119
|
if self.image_pull_secret_credentials:
|
|
@@ -123,6 +136,16 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
123
136
|
if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
|
|
124
137
|
_dict['image_pull_secret_credentials'] = None
|
|
125
138
|
|
|
139
|
+
# set to None if image_pull_ref (nullable) is None
|
|
140
|
+
# and model_fields_set contains the field
|
|
141
|
+
if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
|
|
142
|
+
_dict['image_pull_ref'] = None
|
|
143
|
+
|
|
144
|
+
# set to None if image_pull_secret_name (nullable) is None
|
|
145
|
+
# and model_fields_set contains the field
|
|
146
|
+
if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
|
|
147
|
+
_dict['image_pull_secret_name'] = None
|
|
148
|
+
|
|
126
149
|
# set to None if env_vars (nullable) is None
|
|
127
150
|
# and model_fields_set contains the field
|
|
128
151
|
if self.env_vars is None and "env_vars" in self.model_fields_set:
|
|
@@ -164,7 +187,10 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
164
187
|
"priority": obj.get("priority"),
|
|
165
188
|
"image_url": obj.get("image_url"),
|
|
166
189
|
"image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
|
|
190
|
+
"image_pull_ref": obj.get("image_pull_ref"),
|
|
191
|
+
"image_pull_secret_name": obj.get("image_pull_secret_name"),
|
|
167
192
|
"env_vars": obj.get("env_vars"),
|
|
193
|
+
"env_vars_refs": obj.get("env_vars_refs"),
|
|
168
194
|
"command": obj.get("command"),
|
|
169
195
|
"completions": obj.get("completions") if obj.get("completions") is not None else 1,
|
|
170
196
|
"parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1,
|