Skip to content

Commit

Permalink
fix: limits and requests during GPU should be consistent (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayvammi authored Feb 15, 2025
1 parent a811380 commit fedf29b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions extensions/job_executor/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,29 @@ class EnvVar(BaseModel):
value: str


VendorGPU = Annotated[
Optional[int],
PlainSerializer(lambda x: str(x), return_type=str, when_used="unless-none"),
]


class Request(BaseModel):
"""
The default requests
"""

memory: str = "1Gi"
cpu: str = "250m"
gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")


VendorGPU = Annotated[
Optional[int],
PlainSerializer(lambda x: str(x), return_type=str, when_used="unless-none"),
]


class Limit(Request):
class Limit(BaseModel):
"""
The default limits
"""

memory: str = "1Gi"
cpu: str = "250m"
gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")


Expand Down

0 comments on commit fedf29b

Please sign in to comment.