mirror of
https://github.com/hanzo-ml/trainer.git
synced 2026-09-24 00:31:34 +00:00
feat: update k8s to 0.36 (#3470)
Signed-off-by: Kevin Hannon <[email protected]>
This commit is contained in:
+5
-1
@@ -135,6 +135,7 @@ from kubeflow_trainer_api.models.io_k8s_api_core_v1_host_path_volume_source impo
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_iscsi_persistent_volume_source import IoK8sApiCoreV1ISCSIPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_iscsi_volume_source import IoK8sApiCoreV1ISCSIVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_image_volume_source import IoK8sApiCoreV1ImageVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_image_volume_status import IoK8sApiCoreV1ImageVolumeStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_key_to_path import IoK8sApiCoreV1KeyToPath
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle import IoK8sApiCoreV1Lifecycle
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle_handler import IoK8sApiCoreV1LifecycleHandler
|
||||
@@ -158,6 +159,7 @@ from kubeflow_trainer_api.models.io_k8s_api_core_v1_namespace_status import IoK8
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node import IoK8sApiCoreV1Node
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_address import IoK8sApiCoreV1NodeAddress
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_affinity import IoK8sApiCoreV1NodeAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_allocatable_resource_claim_status import IoK8sApiCoreV1NodeAllocatableResourceClaimStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_condition import IoK8sApiCoreV1NodeCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_config_source import IoK8sApiCoreV1NodeConfigSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_config_status import IoK8sApiCoreV1NodeConfigStatus
|
||||
@@ -210,6 +212,7 @@ from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_readiness_gate import Io
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_resource_claim import IoK8sApiCoreV1PodResourceClaim
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_resource_claim_status import IoK8sApiCoreV1PodResourceClaimStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_scheduling_gate import IoK8sApiCoreV1PodSchedulingGate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_scheduling_group import IoK8sApiCoreV1PodSchedulingGroup
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_security_context import IoK8sApiCoreV1PodSecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_signature import IoK8sApiCoreV1PodSignature
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_spec import IoK8sApiCoreV1PodSpec
|
||||
@@ -288,10 +291,10 @@ from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_node_affinity import
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_projection import IoK8sApiCoreV1VolumeProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_resource_requirements import IoK8sApiCoreV1VolumeResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_source import IoK8sApiCoreV1VolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_status import IoK8sApiCoreV1VolumeStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_vsphere_virtual_disk_volume_source import IoK8sApiCoreV1VsphereVirtualDiskVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_weighted_pod_affinity_term import IoK8sApiCoreV1WeightedPodAffinityTerm
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_windows_security_context_options import IoK8sApiCoreV1WindowsSecurityContextOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_workload_reference import IoK8sApiCoreV1WorkloadReference
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_group import IoK8sApimachineryPkgApisMetaV1APIGroup
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_group_list import IoK8sApimachineryPkgApisMetaV1APIGroupList
|
||||
@@ -325,6 +328,7 @@ from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_patch_opti
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_preconditions import IoK8sApimachineryPkgApisMetaV1Preconditions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_root_paths import IoK8sApimachineryPkgApisMetaV1RootPaths
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_server_address_by_client_cidr import IoK8sApimachineryPkgApisMetaV1ServerAddressByClientCIDR
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_shard_info import IoK8sApimachineryPkgApisMetaV1ShardInfo
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_status import IoK8sApimachineryPkgApisMetaV1Status
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_status_cause import IoK8sApimachineryPkgApisMetaV1StatusCause
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_status_details import IoK8sApimachineryPkgApisMetaV1StatusDetails
|
||||
|
||||
Generated
+1
-1
@@ -32,7 +32,7 @@ class IoK8sApiAutoscalingV2HorizontalPodAutoscaler(BaseModel):
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
spec: Optional[IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec] = Field(default=None, description="spec is the specification for the behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.")
|
||||
spec: IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec = Field(description="spec is the specification for the behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.")
|
||||
status: Optional[IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus] = Field(default=None, description="status is the current information about the autoscaler.")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"]
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class IoK8sApiBatchV1CronJob(BaseModel):
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
spec: Optional[IoK8sApiBatchV1CronJobSpec] = Field(default=None, description="Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
spec: IoK8sApiBatchV1CronJobSpec = Field(description="Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
status: Optional[IoK8sApiBatchV1CronJobStatus] = Field(default=None, description="Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"]
|
||||
|
||||
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ImageVolumeStatus(BaseModel):
|
||||
"""
|
||||
ImageVolumeStatus represents the image-based volume status.
|
||||
""" # noqa: E501
|
||||
image_ref: StrictStr = Field(description="ImageRef is the digest of the image used for this volume. It should have a value that's similar to the pod's status.containerStatuses[i].imageID. The ImageRef length should not exceed 256 characters.", alias="imageRef")
|
||||
__properties: ClassVar[List[str]] = ["imageRef"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ImageVolumeStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ImageVolumeStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"imageRef": obj.get("imageRef")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1NodeAllocatableResourceClaimStatus(BaseModel):
|
||||
"""
|
||||
NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.
|
||||
""" # noqa: E501
|
||||
containers: Optional[List[StrictStr]] = Field(default=None, description="Containers lists the names of all containers in this pod that reference the claim.")
|
||||
resource_claim_name: StrictStr = Field(description="ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.", alias="resourceClaimName")
|
||||
resources: Dict[str, IoK8sApimachineryPkgApiResourceQuantity] = Field(description="Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim.")
|
||||
__properties: ClassVar[List[str]] = ["containers", "resourceClaimName", "resources"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1NodeAllocatableResourceClaimStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each value in resources (dict)
|
||||
_field_dict = {}
|
||||
if self.resources:
|
||||
for _key_resources in self.resources:
|
||||
if self.resources[_key_resources]:
|
||||
_field_dict[_key_resources] = self.resources[_key_resources].to_dict()
|
||||
_dict['resources'] = _field_dict
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1NodeAllocatableResourceClaimStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"containers": obj.get("containers"),
|
||||
"resourceClaimName": obj.get("resourceClaimName") if obj.get("resourceClaimName") is not None else '',
|
||||
"resources": dict(
|
||||
(_k, IoK8sApimachineryPkgApiResourceQuantity.from_dict(_v))
|
||||
for _k, _v in obj["resources"].items()
|
||||
)
|
||||
if obj.get("resources") is not None
|
||||
else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ class IoK8sApiCoreV1PersistentVolumeSource(BaseModel):
|
||||
local: Optional[IoK8sApiCoreV1LocalVolumeSource] = Field(default=None, description="local represents directly-attached storage with node affinity")
|
||||
nfs: Optional[IoK8sApiCoreV1NFSVolumeSource] = Field(default=None, description="nfs represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs")
|
||||
photon_persistent_disk: Optional[IoK8sApiCoreV1PhotonPersistentDiskVolumeSource] = Field(default=None, description="photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.", alias="photonPersistentDisk")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.", alias="portworxVolume")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver.", alias="portworxVolume")
|
||||
quobyte: Optional[IoK8sApiCoreV1QuobyteVolumeSource] = Field(default=None, description="quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.")
|
||||
rbd: Optional[IoK8sApiCoreV1RBDPersistentVolumeSource] = Field(default=None, description="rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. More info: https://examples.k8s.io/volumes/rbd/README.md")
|
||||
scale_io: Optional[IoK8sApiCoreV1ScaleIOPersistentVolumeSource] = Field(default=None, description="scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported.", alias="scaleIO")
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ class IoK8sApiCoreV1PersistentVolumeSpec(BaseModel):
|
||||
node_affinity: Optional[IoK8sApiCoreV1VolumeNodeAffinity] = Field(default=None, description="nodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume. This field is mutable if MutablePVNodeAffinity feature gate is enabled.", alias="nodeAffinity")
|
||||
persistent_volume_reclaim_policy: Optional[StrictStr] = Field(default=None, description="persistentVolumeReclaimPolicy defines what happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming Possible enum values: - `\"Delete\"` means the volume will be deleted from Kubernetes on release from its claim. The volume plugin must support Deletion. - `\"Recycle\"` means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. The volume plugin must support Recycling. - `\"Retain\"` means the volume will be left in its current phase (Released) for manual reclamation by the administrator. The default policy is Retain.", alias="persistentVolumeReclaimPolicy")
|
||||
photon_persistent_disk: Optional[IoK8sApiCoreV1PhotonPersistentDiskVolumeSource] = Field(default=None, description="photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.", alias="photonPersistentDisk")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.", alias="portworxVolume")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver.", alias="portworxVolume")
|
||||
quobyte: Optional[IoK8sApiCoreV1QuobyteVolumeSource] = Field(default=None, description="quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.")
|
||||
rbd: Optional[IoK8sApiCoreV1RBDPersistentVolumeSource] = Field(default=None, description="rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. More info: https://examples.k8s.io/volumes/rbd/README.md")
|
||||
scale_io: Optional[IoK8sApiCoreV1ScaleIOPersistentVolumeSource] = Field(default=None, description="scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported.", alias="scaleIO")
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class IoK8sApiCoreV1PodCondition(BaseModel):
|
||||
last_probe_time: Optional[datetime] = Field(default=None, description="Last time we probed the condition.", alias="lastProbeTime")
|
||||
last_transition_time: Optional[datetime] = Field(default=None, description="Last time the condition transitioned from one status to another.", alias="lastTransitionTime")
|
||||
message: Optional[StrictStr] = Field(default=None, description="Human-readable message indicating details about last transition.")
|
||||
observed_generation: Optional[StrictInt] = Field(default=None, description="If set, this represents the .metadata.generation that the pod condition was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.", alias="observedGeneration")
|
||||
observed_generation: Optional[StrictInt] = Field(default=None, description="If set, this represents the .metadata.generation that the pod condition was set based upon.", alias="observedGeneration")
|
||||
reason: Optional[StrictStr] = Field(default=None, description="Unique, one-word, CamelCase reason for the condition's last transition.")
|
||||
status: StrictStr = Field(description="Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions")
|
||||
type: StrictStr = Field(description="Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions")
|
||||
|
||||
+2
-2
@@ -24,11 +24,11 @@ from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1PodResourceClaim(BaseModel):
|
||||
"""
|
||||
PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.
|
||||
PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. When the DRAWorkloadResourceClaims feature gate is enabled and this Pod belongs to a PodGroup, a PodResourceClaim is matched to a PodGroupResourceClaim if all of their fields are equal (Name, ResourceClaimName, and ResourceClaimTemplateName). A matched claim references a single ResourceClaim shared across all Pods in the PodGroup, reserved for the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual Pods.
|
||||
""" # noqa: E501
|
||||
name: StrictStr = Field(description="Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.")
|
||||
resource_claim_name: Optional[StrictStr] = Field(default=None, description="ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", alias="resourceClaimName")
|
||||
resource_claim_template_name: Optional[StrictStr] = Field(default=None, description="ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod. The template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", alias="resourceClaimTemplateName")
|
||||
resource_claim_template_name: Optional[StrictStr] = Field(default=None, description="ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod. The template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. When the DRAWorkloadResourceClaims feature gate is enabled and the pod belongs to a PodGroup that defines a PodGroupResourceClaim with the same Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the ResourceClaim generated for the PodGroup. All pods in the group that define an equivalent PodResourceClaim matching the PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same generated ResourceClaim. ResourceClaims generated for a PodGroup are owned by the PodGroup and their lifecycles are tied to the PodGroup instead of any individual pod. This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", alias="resourceClaimTemplateName")
|
||||
__properties: ClassVar[List[str]] = ["name", "resourceClaimName", "resourceClaimTemplateName"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
|
||||
Generated
+1
-1
@@ -27,7 +27,7 @@ class IoK8sApiCoreV1PodResourceClaimStatus(BaseModel):
|
||||
PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.
|
||||
""" # noqa: E501
|
||||
name: StrictStr = Field(description="Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL.")
|
||||
resource_claim_name: Optional[StrictStr] = Field(default=None, description="ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", alias="resourceClaimName")
|
||||
resource_claim_name: Optional[StrictStr] = Field(default=None, description="ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. When the DRAWorkloadResourceClaims feature is enabled and the corresponding PodResourceClaim matches a PodGroupResourceClaim made by the Pod's PodGroup, then this is the name of the ResourceClaim generated and reserved for the PodGroup. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", alias="resourceClaimName")
|
||||
__properties: ClassVar[List[str]] = ["name", "resourceClaimName"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1PodSchedulingGroup(BaseModel):
|
||||
"""
|
||||
PodSchedulingGroup identifies the runtime scheduling group instance that a Pod belongs to. The scheduler uses this information to apply workload-aware scheduling semantics. Exactly one field must be specified.
|
||||
""" # noqa: E501
|
||||
pod_group_name: Optional[StrictStr] = Field(default=None, description="PodGroupName specifies the name of the standalone PodGroup object that represents the runtime instance of this group. Must be a DNS subdomain.", alias="podGroupName")
|
||||
__properties: ClassVar[List[str]] = ["podGroupName"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1PodSchedulingGroup from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1PodSchedulingGroup from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"podGroupName": obj.get("podGroupName")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@ from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_os import IoK8sApiCoreV1
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_readiness_gate import IoK8sApiCoreV1PodReadinessGate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_resource_claim import IoK8sApiCoreV1PodResourceClaim
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_scheduling_gate import IoK8sApiCoreV1PodSchedulingGate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_scheduling_group import IoK8sApiCoreV1PodSchedulingGroup
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_security_context import IoK8sApiCoreV1PodSecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_requirements import IoK8sApiCoreV1ResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_toleration import IoK8sApiCoreV1Toleration
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_topology_spread_constraint import IoK8sApiCoreV1TopologySpreadConstraint
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume import IoK8sApiCoreV1Volume
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_workload_reference import IoK8sApiCoreV1WorkloadReference
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
@@ -55,7 +55,7 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
host_ipc: Optional[StrictBool] = Field(default=None, description="Use the host's ipc namespace. Optional: Default to false.", alias="hostIPC")
|
||||
host_network: Optional[StrictBool] = Field(default=None, description="Host networking requested for this pod. Use the host's network namespace. When using HostNetwork you should specify ports so the scheduler is aware. When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. Default to false.", alias="hostNetwork")
|
||||
host_pid: Optional[StrictBool] = Field(default=None, description="Use the host's pid namespace. Optional: Default to false.", alias="hostPID")
|
||||
host_users: Optional[StrictBool] = Field(default=None, description="Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.", alias="hostUsers")
|
||||
host_users: Optional[StrictBool] = Field(default=None, description="Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host.", alias="hostUsers")
|
||||
hostname: Optional[StrictStr] = Field(default=None, description="Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.")
|
||||
hostname_override: Optional[StrictStr] = Field(default=None, description="HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false. This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.", alias="hostnameOverride")
|
||||
image_pull_secrets: Optional[List[IoK8sApiCoreV1LocalObjectReference]] = Field(default=None, description="ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", alias="imagePullSecrets")
|
||||
@@ -74,6 +74,7 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
runtime_class_name: Optional[StrictStr] = Field(default=None, description="RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", alias="runtimeClassName")
|
||||
scheduler_name: Optional[StrictStr] = Field(default=None, description="If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", alias="schedulerName")
|
||||
scheduling_gates: Optional[List[IoK8sApiCoreV1PodSchedulingGate]] = Field(default=None, description="SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod. SchedulingGates can only be set at pod creation time, and be removed only afterwards.", alias="schedulingGates")
|
||||
scheduling_group: Optional[IoK8sApiCoreV1PodSchedulingGroup] = Field(default=None, description="SchedulingGroup provides a reference to the immediate scheduling runtime grouping object that this Pod belongs to. This field is used by the scheduler to identify the group and apply the correct group scheduling policies. The association with a group also impacts other lifecycle aspects of a Pod that are relevant in a wider context of scheduling like preemption, resource attachment, etc. If not specified, the Pod is treated as a single unit in all of these aspects. The group object referenced by this field may not exist at the time the Pod is created. This field is immutable, but a group object with the same name may be recreated with different policies. Doing this during pod scheduling may result in the placement not conforming to the expected policies.", alias="schedulingGroup")
|
||||
security_context: Optional[IoK8sApiCoreV1PodSecurityContext] = Field(default=None, description="SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", alias="securityContext")
|
||||
service_account: Optional[StrictStr] = Field(default=None, description="DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", alias="serviceAccount")
|
||||
service_account_name: Optional[StrictStr] = Field(default=None, description="ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", alias="serviceAccountName")
|
||||
@@ -84,8 +85,7 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
tolerations: Optional[List[IoK8sApiCoreV1Toleration]] = Field(default=None, description="If specified, the pod's tolerations.")
|
||||
topology_spread_constraints: Optional[List[IoK8sApiCoreV1TopologySpreadConstraint]] = Field(default=None, description="TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", alias="topologySpreadConstraints")
|
||||
volumes: Optional[List[IoK8sApiCoreV1Volume]] = Field(default=None, description="List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes")
|
||||
workload_ref: Optional[IoK8sApiCoreV1WorkloadReference] = Field(default=None, description="WorkloadRef provides a reference to the Workload object that this Pod belongs to. This field is used by the scheduler to identify the PodGroup and apply the correct group scheduling policies. The Workload object referenced by this field may not exist at the time the Pod is created. This field is immutable, but a Workload object with the same name may be recreated with different policies. Doing this during pod scheduling may result in the placement not conforming to the expected policies.", alias="workloadRef")
|
||||
__properties: ClassVar[List[str]] = ["activeDeadlineSeconds", "affinity", "automountServiceAccountToken", "containers", "dnsConfig", "dnsPolicy", "enableServiceLinks", "ephemeralContainers", "hostAliases", "hostIPC", "hostNetwork", "hostPID", "hostUsers", "hostname", "hostnameOverride", "imagePullSecrets", "initContainers", "nodeName", "nodeSelector", "os", "overhead", "preemptionPolicy", "priority", "priorityClassName", "readinessGates", "resourceClaims", "resources", "restartPolicy", "runtimeClassName", "schedulerName", "schedulingGates", "securityContext", "serviceAccount", "serviceAccountName", "setHostnameAsFQDN", "shareProcessNamespace", "subdomain", "terminationGracePeriodSeconds", "tolerations", "topologySpreadConstraints", "volumes", "workloadRef"]
|
||||
__properties: ClassVar[List[str]] = ["activeDeadlineSeconds", "affinity", "automountServiceAccountToken", "containers", "dnsConfig", "dnsPolicy", "enableServiceLinks", "ephemeralContainers", "hostAliases", "hostIPC", "hostNetwork", "hostPID", "hostUsers", "hostname", "hostnameOverride", "imagePullSecrets", "initContainers", "nodeName", "nodeSelector", "os", "overhead", "preemptionPolicy", "priority", "priorityClassName", "readinessGates", "resourceClaims", "resources", "restartPolicy", "runtimeClassName", "schedulerName", "schedulingGates", "schedulingGroup", "securityContext", "serviceAccount", "serviceAccountName", "setHostnameAsFQDN", "shareProcessNamespace", "subdomain", "terminationGracePeriodSeconds", "tolerations", "topologySpreadConstraints", "volumes"]
|
||||
|
||||
@field_validator('dns_policy')
|
||||
def dns_policy_validate_enum(cls, value):
|
||||
@@ -231,6 +231,9 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
if _item_scheduling_gates:
|
||||
_items.append(_item_scheduling_gates.to_dict())
|
||||
_dict['schedulingGates'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of scheduling_group
|
||||
if self.scheduling_group:
|
||||
_dict['schedulingGroup'] = self.scheduling_group.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of security_context
|
||||
if self.security_context:
|
||||
_dict['securityContext'] = self.security_context.to_dict()
|
||||
@@ -255,9 +258,6 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
if _item_volumes:
|
||||
_items.append(_item_volumes.to_dict())
|
||||
_dict['volumes'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of workload_ref
|
||||
if self.workload_ref:
|
||||
_dict['workloadRef'] = self.workload_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@@ -306,6 +306,7 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
"runtimeClassName": obj.get("runtimeClassName"),
|
||||
"schedulerName": obj.get("schedulerName"),
|
||||
"schedulingGates": [IoK8sApiCoreV1PodSchedulingGate.from_dict(_item) for _item in obj["schedulingGates"]] if obj.get("schedulingGates") is not None else None,
|
||||
"schedulingGroup": IoK8sApiCoreV1PodSchedulingGroup.from_dict(obj["schedulingGroup"]) if obj.get("schedulingGroup") is not None else None,
|
||||
"securityContext": IoK8sApiCoreV1PodSecurityContext.from_dict(obj["securityContext"]) if obj.get("securityContext") is not None else None,
|
||||
"serviceAccount": obj.get("serviceAccount"),
|
||||
"serviceAccountName": obj.get("serviceAccountName"),
|
||||
@@ -315,8 +316,7 @@ class IoK8sApiCoreV1PodSpec(BaseModel):
|
||||
"terminationGracePeriodSeconds": obj.get("terminationGracePeriodSeconds"),
|
||||
"tolerations": [IoK8sApiCoreV1Toleration.from_dict(_item) for _item in obj["tolerations"]] if obj.get("tolerations") is not None else None,
|
||||
"topologySpreadConstraints": [IoK8sApiCoreV1TopologySpreadConstraint.from_dict(_item) for _item in obj["topologySpreadConstraints"]] if obj.get("topologySpreadConstraints") is not None else None,
|
||||
"volumes": [IoK8sApiCoreV1Volume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"workloadRef": IoK8sApiCoreV1WorkloadReference.from_dict(obj["workloadRef"]) if obj.get("workloadRef") is not None else None
|
||||
"volumes": [IoK8sApiCoreV1Volume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+11
-1
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_v
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_status import IoK8sApiCoreV1ContainerStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_host_ip import IoK8sApiCoreV1HostIP
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_allocatable_resource_claim_status import IoK8sApiCoreV1NodeAllocatableResourceClaimStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_condition import IoK8sApiCoreV1PodCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_extended_resource_claim_status import IoK8sApiCoreV1PodExtendedResourceClaimStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_ip import IoK8sApiCoreV1PodIP
|
||||
@@ -44,6 +45,7 @@ class IoK8sApiCoreV1PodStatus(BaseModel):
|
||||
host_ips: Optional[List[IoK8sApiCoreV1HostIP]] = Field(default=None, description="hostIPs holds the IP addresses allocated to the host. If this field is specified, the first entry must match the hostIP field. This list is empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns means that HostIPs will not be updated even if there is a node is assigned to this pod.", alias="hostIPs")
|
||||
init_container_statuses: Optional[List[IoK8sApiCoreV1ContainerStatus]] = Field(default=None, description="Statuses of init containers in this pod. The most recent successful non-restartable init container will have ready = true, the most recently started container will have startTime set. Each init container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-and-container-status", alias="initContainerStatuses")
|
||||
message: Optional[StrictStr] = Field(default=None, description="A human readable message indicating details about why the pod is in this condition.")
|
||||
node_allocatable_resource_claim_statuses: Optional[List[IoK8sApiCoreV1NodeAllocatableResourceClaimStatus]] = Field(default=None, description="NodeAllocatableResourceClaimStatuses contains the status of node-allocatable resources that were allocated for this pod through DRA claims. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages.", alias="nodeAllocatableResourceClaimStatuses")
|
||||
nominated_node_name: Optional[StrictStr] = Field(default=None, description="nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", alias="nominatedNodeName")
|
||||
observed_generation: Optional[StrictInt] = Field(default=None, description="If set, this represents the .metadata.generation that the pod status was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.", alias="observedGeneration")
|
||||
phase: Optional[StrictStr] = Field(default=None, description="The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values: Pending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase Possible enum values: - `\"Failed\"` means that all containers in the pod have terminated, and at least one container has terminated in a failure (exited with a non-zero exit code or was stopped by the system). - `\"Pending\"` means the pod has been accepted by the system, but one or more of the containers has not been started. This includes time before being bound to a node, as well as time spent pulling images onto the host. - `\"Running\"` means the pod has been bound to a node and all of the containers have been started. At least one container is still running or is in the process of being restarted. - `\"Succeeded\"` means that all containers in the pod have voluntarily terminated with a container exit code of 0, and the system is not going to restart any of these containers. - `\"Unknown\"` means that for some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod. Deprecated: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095)")
|
||||
@@ -55,7 +57,7 @@ class IoK8sApiCoreV1PodStatus(BaseModel):
|
||||
resource_claim_statuses: Optional[List[IoK8sApiCoreV1PodResourceClaimStatus]] = Field(default=None, description="Status of resource claims.", alias="resourceClaimStatuses")
|
||||
resources: Optional[IoK8sApiCoreV1ResourceRequirements] = Field(default=None, description="Resources represents the compute resource requests and limits that have been applied at the pod level if pod-level requests or limits are set in PodSpec.Resources")
|
||||
start_time: Optional[datetime] = Field(default=None, description="RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", alias="startTime")
|
||||
__properties: ClassVar[List[str]] = ["allocatedResources", "conditions", "containerStatuses", "ephemeralContainerStatuses", "extendedResourceClaimStatus", "hostIP", "hostIPs", "initContainerStatuses", "message", "nominatedNodeName", "observedGeneration", "phase", "podIP", "podIPs", "qosClass", "reason", "resize", "resourceClaimStatuses", "resources", "startTime"]
|
||||
__properties: ClassVar[List[str]] = ["allocatedResources", "conditions", "containerStatuses", "ephemeralContainerStatuses", "extendedResourceClaimStatus", "hostIP", "hostIPs", "initContainerStatuses", "message", "nodeAllocatableResourceClaimStatuses", "nominatedNodeName", "observedGeneration", "phase", "podIP", "podIPs", "qosClass", "reason", "resize", "resourceClaimStatuses", "resources", "startTime"]
|
||||
|
||||
@field_validator('phase')
|
||||
def phase_validate_enum(cls, value):
|
||||
@@ -161,6 +163,13 @@ class IoK8sApiCoreV1PodStatus(BaseModel):
|
||||
if _item_init_container_statuses:
|
||||
_items.append(_item_init_container_statuses.to_dict())
|
||||
_dict['initContainerStatuses'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in node_allocatable_resource_claim_statuses (list)
|
||||
_items = []
|
||||
if self.node_allocatable_resource_claim_statuses:
|
||||
for _item_node_allocatable_resource_claim_statuses in self.node_allocatable_resource_claim_statuses:
|
||||
if _item_node_allocatable_resource_claim_statuses:
|
||||
_items.append(_item_node_allocatable_resource_claim_statuses.to_dict())
|
||||
_dict['nodeAllocatableResourceClaimStatuses'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in pod_ips (list)
|
||||
_items = []
|
||||
if self.pod_ips:
|
||||
@@ -204,6 +213,7 @@ class IoK8sApiCoreV1PodStatus(BaseModel):
|
||||
"hostIPs": [IoK8sApiCoreV1HostIP.from_dict(_item) for _item in obj["hostIPs"]] if obj.get("hostIPs") is not None else None,
|
||||
"initContainerStatuses": [IoK8sApiCoreV1ContainerStatus.from_dict(_item) for _item in obj["initContainerStatuses"]] if obj.get("initContainerStatuses") is not None else None,
|
||||
"message": obj.get("message"),
|
||||
"nodeAllocatableResourceClaimStatuses": [IoK8sApiCoreV1NodeAllocatableResourceClaimStatus.from_dict(_item) for _item in obj["nodeAllocatableResourceClaimStatuses"]] if obj.get("nodeAllocatableResourceClaimStatuses") is not None else None,
|
||||
"nominatedNodeName": obj.get("nominatedNodeName"),
|
||||
"observedGeneration": obj.get("observedGeneration"),
|
||||
"phase": obj.get("phase"),
|
||||
|
||||
+3
-1
@@ -27,8 +27,9 @@ class IoK8sApiCoreV1ResourceHealth(BaseModel):
|
||||
ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680.
|
||||
""" # noqa: E501
|
||||
health: Optional[StrictStr] = Field(default=None, description="Health of the resource. can be one of: - Healthy: operates as normal - Unhealthy: reported unhealthy. We consider this a temporary health issue since we do not have a mechanism today to distinguish temporary and permanent issues. - Unknown: The status cannot be determined. For example, Device Plugin got unregistered and hasn't been re-registered since. In future we may want to introduce the PermanentlyUnhealthy Status.")
|
||||
message: Optional[StrictStr] = Field(default=None, description="Message provides human-readable context for Health (e.g. \"ECC error count exceeded threshold\"). This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise.")
|
||||
resource_id: StrictStr = Field(description="ResourceID is the unique identifier of the resource. See the ResourceID type for more information.", alias="resourceID")
|
||||
__properties: ClassVar[List[str]] = ["health", "resourceID"]
|
||||
__properties: ClassVar[List[str]] = ["health", "message", "resourceID"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -82,6 +83,7 @@ class IoK8sApiCoreV1ResourceHealth(BaseModel):
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"health": obj.get("health"),
|
||||
"message": obj.get("message"),
|
||||
"resourceID": obj.get("resourceID") if obj.get("resourceID") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ class IoK8sApiCoreV1SecurityContext(BaseModel):
|
||||
app_armor_profile: Optional[IoK8sApiCoreV1AppArmorProfile] = Field(default=None, description="appArmorProfile is the AppArmor options to use by this container. If set, this profile overrides the pod's appArmorProfile. Note that this field cannot be set when spec.os.name is windows.", alias="appArmorProfile")
|
||||
capabilities: Optional[IoK8sApiCoreV1Capabilities] = Field(default=None, description="The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.")
|
||||
privileged: Optional[StrictBool] = Field(default=None, description="Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.")
|
||||
proc_mount: Optional[StrictStr] = Field(default=None, description="procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. Possible enum values: - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information. - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", alias="procMount")
|
||||
proc_mount: Optional[StrictStr] = Field(default=None, description="procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. Note that this field cannot be set when spec.os.name is windows. Possible enum values: - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information. - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", alias="procMount")
|
||||
read_only_root_filesystem: Optional[StrictBool] = Field(default=None, description="Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.", alias="readOnlyRootFilesystem")
|
||||
run_as_group: Optional[StrictInt] = Field(default=None, description="The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", alias="runAsGroup")
|
||||
run_as_non_root: Optional[StrictBool] = Field(default=None, description="Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", alias="runAsNonRoot")
|
||||
|
||||
@@ -73,13 +73,13 @@ class IoK8sApiCoreV1Volume(BaseModel):
|
||||
git_repo: Optional[IoK8sApiCoreV1GitRepoVolumeSource] = Field(default=None, description="gitRepo represents a git repository at a particular revision. Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", alias="gitRepo")
|
||||
glusterfs: Optional[IoK8sApiCoreV1GlusterfsVolumeSource] = Field(default=None, description="glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.")
|
||||
host_path: Optional[IoK8sApiCoreV1HostPathVolumeSource] = Field(default=None, description="hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", alias="hostPath")
|
||||
image: Optional[IoK8sApiCoreV1ImageVolumeSource] = Field(default=None, description="image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided: - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.")
|
||||
image: Optional[IoK8sApiCoreV1ImageVolumeSource] = Field(default=None, description="image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided: - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.")
|
||||
iscsi: Optional[IoK8sApiCoreV1ISCSIVolumeSource] = Field(default=None, description="iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi")
|
||||
name: StrictStr = Field(description="name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names")
|
||||
nfs: Optional[IoK8sApiCoreV1NFSVolumeSource] = Field(default=None, description="nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs")
|
||||
persistent_volume_claim: Optional[IoK8sApiCoreV1PersistentVolumeClaimVolumeSource] = Field(default=None, description="persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", alias="persistentVolumeClaim")
|
||||
photon_persistent_disk: Optional[IoK8sApiCoreV1PhotonPersistentDiskVolumeSource] = Field(default=None, description="photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.", alias="photonPersistentDisk")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.", alias="portworxVolume")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver.", alias="portworxVolume")
|
||||
projected: Optional[IoK8sApiCoreV1ProjectedVolumeSource] = Field(default=None, description="projected items for all in one resources secrets, configmaps, and downward API")
|
||||
quobyte: Optional[IoK8sApiCoreV1QuobyteVolumeSource] = Field(default=None, description="quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.")
|
||||
rbd: Optional[IoK8sApiCoreV1RBDVolumeSource] = Field(default=None, description="rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.")
|
||||
|
||||
+8
-2
@@ -19,6 +19,7 @@ import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_status import IoK8sApiCoreV1VolumeStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -30,7 +31,8 @@ class IoK8sApiCoreV1VolumeMountStatus(BaseModel):
|
||||
name: StrictStr = Field(description="Name corresponds to the name of the original VolumeMount.")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="ReadOnly corresponds to the original VolumeMount.", alias="readOnly")
|
||||
recursive_read_only: Optional[StrictStr] = Field(default=None, description="RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, depending on the mount result.", alias="recursiveReadOnly")
|
||||
__properties: ClassVar[List[str]] = ["mountPath", "name", "readOnly", "recursiveReadOnly"]
|
||||
volume_status: Optional[IoK8sApiCoreV1VolumeStatus] = Field(default=None, description="volumeStatus represents volume-type-specific status about the mounted volume.", alias="volumeStatus")
|
||||
__properties: ClassVar[List[str]] = ["mountPath", "name", "readOnly", "recursiveReadOnly", "volumeStatus"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -71,6 +73,9 @@ class IoK8sApiCoreV1VolumeMountStatus(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of volume_status
|
||||
if self.volume_status:
|
||||
_dict['volumeStatus'] = self.volume_status.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@@ -86,7 +91,8 @@ class IoK8sApiCoreV1VolumeMountStatus(BaseModel):
|
||||
"mountPath": obj.get("mountPath") if obj.get("mountPath") is not None else '',
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"recursiveReadOnly": obj.get("recursiveReadOnly")
|
||||
"recursiveReadOnly": obj.get("recursiveReadOnly"),
|
||||
"volumeStatus": IoK8sApiCoreV1VolumeStatus.from_dict(obj["volumeStatus"]) if obj.get("volumeStatus") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+2
-2
@@ -73,12 +73,12 @@ class IoK8sApiCoreV1VolumeSource(BaseModel):
|
||||
git_repo: Optional[IoK8sApiCoreV1GitRepoVolumeSource] = Field(default=None, description="gitRepo represents a git repository at a particular revision. Deprecated: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", alias="gitRepo")
|
||||
glusterfs: Optional[IoK8sApiCoreV1GlusterfsVolumeSource] = Field(default=None, description="glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.")
|
||||
host_path: Optional[IoK8sApiCoreV1HostPathVolumeSource] = Field(default=None, description="hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", alias="hostPath")
|
||||
image: Optional[IoK8sApiCoreV1ImageVolumeSource] = Field(default=None, description="image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided: - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.")
|
||||
image: Optional[IoK8sApiCoreV1ImageVolumeSource] = Field(default=None, description="image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided: - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.")
|
||||
iscsi: Optional[IoK8sApiCoreV1ISCSIVolumeSource] = Field(default=None, description="iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi")
|
||||
nfs: Optional[IoK8sApiCoreV1NFSVolumeSource] = Field(default=None, description="nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs")
|
||||
persistent_volume_claim: Optional[IoK8sApiCoreV1PersistentVolumeClaimVolumeSource] = Field(default=None, description="persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", alias="persistentVolumeClaim")
|
||||
photon_persistent_disk: Optional[IoK8sApiCoreV1PhotonPersistentDiskVolumeSource] = Field(default=None, description="photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.", alias="photonPersistentDisk")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.", alias="portworxVolume")
|
||||
portworx_volume: Optional[IoK8sApiCoreV1PortworxVolumeSource] = Field(default=None, description="portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver.", alias="portworxVolume")
|
||||
projected: Optional[IoK8sApiCoreV1ProjectedVolumeSource] = Field(default=None, description="projected items for all in one resources secrets, configmaps, and downward API")
|
||||
quobyte: Optional[IoK8sApiCoreV1QuobyteVolumeSource] = Field(default=None, description="quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.")
|
||||
rbd: Optional[IoK8sApiCoreV1RBDVolumeSource] = Field(default=None, description="rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.")
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_image_volume_status import IoK8sApiCoreV1ImageVolumeStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1VolumeStatus(BaseModel):
|
||||
"""
|
||||
VolumeStatus represents the status of a mounted volume. At most one of its members must be specified.
|
||||
""" # noqa: E501
|
||||
image: Optional[IoK8sApiCoreV1ImageVolumeStatus] = Field(default=None, description="image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.")
|
||||
__properties: ClassVar[List[str]] = ["image"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1VolumeStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of image
|
||||
if self.image:
|
||||
_dict['image'] = self.image.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1VolumeStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"image": IoK8sApiCoreV1ImageVolumeStatus.from_dict(obj["image"]) if obj.get("image") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
Generated
+8
-2
@@ -19,6 +19,7 @@ import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_shard_info import IoK8sApimachineryPkgApisMetaV1ShardInfo
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -30,7 +31,8 @@ class IoK8sApimachineryPkgApisMetaV1ListMeta(BaseModel):
|
||||
remaining_item_count: Optional[StrictInt] = Field(default=None, description="remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", alias="remainingItemCount")
|
||||
resource_version: Optional[StrictStr] = Field(default=None, description="String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", alias="resourceVersion")
|
||||
self_link: Optional[StrictStr] = Field(default=None, description="Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", alias="selfLink")
|
||||
__properties: ClassVar[List[str]] = ["continue", "remainingItemCount", "resourceVersion", "selfLink"]
|
||||
shard_info: Optional[IoK8sApimachineryPkgApisMetaV1ShardInfo] = Field(default=None, description="shardInfo is set when the list is a filtered subset of the full collection, as selected by a shard selector on the request. It echoes back the selector so clients can verify which shard they received and merge sharded responses. Clients should not cache sharded list responses as a full representation of the collection. This is an alpha field and requires enabling the ShardedListAndWatch feature gate.", alias="shardInfo")
|
||||
__properties: ClassVar[List[str]] = ["continue", "remainingItemCount", "resourceVersion", "selfLink", "shardInfo"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -71,6 +73,9 @@ class IoK8sApimachineryPkgApisMetaV1ListMeta(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of shard_info
|
||||
if self.shard_info:
|
||||
_dict['shardInfo'] = self.shard_info.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@@ -86,7 +91,8 @@ class IoK8sApimachineryPkgApisMetaV1ListMeta(BaseModel):
|
||||
"continue": obj.get("continue"),
|
||||
"remainingItemCount": obj.get("remainingItemCount"),
|
||||
"resourceVersion": obj.get("resourceVersion"),
|
||||
"selfLink": obj.get("selfLink")
|
||||
"selfLink": obj.get("selfLink"),
|
||||
"shardInfo": IoK8sApimachineryPkgApisMetaV1ShardInfo.from_dict(obj["shardInfo"]) if obj.get("shardInfo") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
Generated
+3
-1
@@ -36,9 +36,10 @@ class IoK8sApimachineryPkgApisMetaV1ListOptions(BaseModel):
|
||||
resource_version: Optional[StrictStr] = Field(default=None, description="resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset", alias="resourceVersion")
|
||||
resource_version_match: Optional[StrictStr] = Field(default=None, description="resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset", alias="resourceVersionMatch")
|
||||
send_initial_events: Optional[StrictBool] = Field(default=None, description="`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", alias="sendInitialEvents")
|
||||
shard_selector: Optional[StrictStr] = Field(default=None, description="shardSelector restricts the list of returned objects using a CEL-based shard selector expression. The format uses the shardRange() function combined with || (logical OR) to specify one or more hash ranges: shardRange(object.metadata.uid, '0x0', '0x8000000000000000') shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') Field paths use CEL-style object-rooted syntax (e.g. \"object.metadata.uid\"), NOT the fieldSelector format (\"metadata.uid\"). Currently supported paths: - object.metadata.uid - object.metadata.namespace hexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a hash space. The full range is [0x0, 0x10000000000000000), where the exclusive upper bound equals 2^64. Examples: 2-shard split: shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000') shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') 4-shard split: shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000') shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000') shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000') shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000') This is an alpha field and requires enabling the ShardedListAndWatch feature gate.", alias="shardSelector")
|
||||
timeout_seconds: Optional[StrictInt] = Field(default=None, description="Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", alias="timeoutSeconds")
|
||||
watch: Optional[StrictBool] = Field(default=None, description="Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.")
|
||||
__properties: ClassVar[List[str]] = ["allowWatchBookmarks", "apiVersion", "continue", "fieldSelector", "kind", "labelSelector", "limit", "resourceVersion", "resourceVersionMatch", "sendInitialEvents", "timeoutSeconds", "watch"]
|
||||
__properties: ClassVar[List[str]] = ["allowWatchBookmarks", "apiVersion", "continue", "fieldSelector", "kind", "labelSelector", "limit", "resourceVersion", "resourceVersionMatch", "sendInitialEvents", "shardSelector", "timeoutSeconds", "watch"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -101,6 +102,7 @@ class IoK8sApimachineryPkgApisMetaV1ListOptions(BaseModel):
|
||||
"resourceVersion": obj.get("resourceVersion"),
|
||||
"resourceVersionMatch": obj.get("resourceVersionMatch"),
|
||||
"sendInitialEvents": obj.get("sendInitialEvents"),
|
||||
"shardSelector": obj.get("shardSelector"),
|
||||
"timeoutSeconds": obj.get("timeoutSeconds"),
|
||||
"watch": obj.get("watch")
|
||||
})
|
||||
|
||||
Generated
+87
@@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApimachineryPkgApisMetaV1ShardInfo(BaseModel):
|
||||
"""
|
||||
ShardInfo describes the shard selector that was applied to produce a list response. Its presence on a list response indicates the list is a filtered subset.
|
||||
""" # noqa: E501
|
||||
selector: StrictStr = Field(description="selector is the shard selector string from the request, echoed back so clients can verify which shard they received and merge responses from multiple shards.")
|
||||
__properties: ClassVar[List[str]] = ["selector"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApimachineryPkgApisMetaV1ShardInfo from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApimachineryPkgApisMetaV1ShardInfo from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"selector": obj.get("selector") if obj.get("selector") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
Reference in New Issue
Block a user