runnable 0.28.1__py3-none-any.whl → 0.28.3__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,19 @@ class ImagePullPolicy(str, Enum):
34
34
  NEVER = "Never"
35
35
 
36
36
 
37
+ class TolerationOperator(str, Enum):
38
+ EXISTS = "Exists"
39
+ EQUAL = "Equal"
40
+
41
+
42
+ class Toleration(BaseModel):
43
+ key: str
44
+ operator: TolerationOperator = TolerationOperator.EQUAL
45
+ value: Optional[str]
46
+ effect: str
47
+ toleration_seconds: Optional[int] = Field(default=None)
48
+
49
+
37
50
  class LabelSelectorRequirement(BaseModel):
38
51
  key: str
39
52
  operator: Operator
@@ -56,6 +69,12 @@ class EnvVar(BaseModel):
56
69
  value: str
57
70
 
58
71
 
72
+ VendorGPU = Annotated[
73
+ Optional[int],
74
+ PlainSerializer(lambda x: str(x), return_type=str, when_used="unless-none"),
75
+ ]
76
+
77
+
59
78
  class Request(BaseModel):
60
79
  """
61
80
  The default requests
@@ -63,19 +82,16 @@ class Request(BaseModel):
63
82
 
64
83
  memory: str = "1Gi"
65
84
  cpu: str = "250m"
85
+ gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")
66
86
 
67
87
 
68
- VendorGPU = Annotated[
69
- Optional[int],
70
- PlainSerializer(lambda x: str(x), return_type=str, when_used="unless-none"),
71
- ]
72
-
73
-
74
- class Limit(Request):
88
+ class Limit(BaseModel):
75
89
  """
76
90
  The default limits
77
91
  """
78
92
 
93
+ memory: str = "1Gi"
94
+ cpu: str = "250m"
79
95
  gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")
80
96
 
81
97
 
@@ -124,7 +140,7 @@ class PVCVolume(BaseModel):
124
140
  class K8sTemplateSpec(BaseModel):
125
141
  active_deadline_seconds: int = Field(default=60 * 60 * 2) # 2 hours
126
142
  node_selector: Optional[dict[str, str]] = None
127
- tolerations: Optional[list[dict[str, str]]] = None
143
+ tolerations: Optional[list[Toleration]] = None
128
144
  volumes: Optional[list[HostPathVolume | PVCVolume]] = Field(
129
145
  default_factory=lambda: []
130
146
  )
@@ -260,7 +276,7 @@ class GenericK8sJobExecutor(GenericJobExecutor):
260
276
  tolerations = None
261
277
  if self.job_spec.template.spec.tolerations:
262
278
  tolerations = [
263
- self._client.V1Toleration(**toleration)
279
+ self._client.V1Toleration(**toleration.model_dump(by_alias=True))
264
280
  for toleration in self.job_spec.template.spec.tolerations
265
281
  ]
266
282
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runnable
3
- Version: 0.28.1
3
+ Version: 0.28.3
4
4
  Summary: Add your description here
5
5
  Author-email: "Vammi, Vijay" <vijay.vammi@astrazeneca.com>
6
6
  License-File: LICENSE
@@ -8,7 +8,7 @@ extensions/catalog/pyproject.toml,sha256=lLNxY6v04c8I5QK_zKw_E6sJTArSJRA_V-79kta
8
8
  extensions/catalog/s3.py,sha256=Sw5t8_kVRprn3uGGJCiHn7M9zw1CLaCOFj6YErtfG0o,287
9
9
  extensions/job_executor/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  extensions/job_executor/__init__.py,sha256=E2R6GV5cZTlZdqA5SVJ6ajZFh4oruM0k8AKHkpOZ3W8,5772
11
- extensions/job_executor/k8s.py,sha256=V5k6Rnf_sAFqptVbCrWs_x5sl3x3fSHwO96IZoiJxKU,15342
11
+ extensions/job_executor/k8s.py,sha256=LQSD33Q4Zdox2dt4Rr_88ahX2hWu0ZTky3IRmW5Gd54,15777
12
12
  extensions/job_executor/k8s_job_spec.yaml,sha256=7aFpxHdO_p6Hkc3YxusUOuAQTD1Myu0yTPX9DrhxbOg,1158
13
13
  extensions/job_executor/local.py,sha256=FvxTk0vyxdrbLOAyNkLyjvmmowypabWOSITQBK_ffVE,1907
14
14
  extensions/job_executor/local_container.py,sha256=hyFnpicCp3_87mZsW64P6KSVbz7XMLjwJUWVjeCJ0_I,6627
@@ -56,8 +56,8 @@ runnable/sdk.py,sha256=T1nqDpLN9fULvvU9L-oY0EHqYdKUI9qk7oekLynm02Y,33568
56
56
  runnable/secrets.py,sha256=PXcEJw-4WPzeWRLfsatcPPyr1zkqgHzdRWRcS9vvpvM,2354
57
57
  runnable/tasks.py,sha256=X6xijut7ffwpfYDcXoN6y0AcRVd7fWHs676DJ00Kma4,29134
58
58
  runnable/utils.py,sha256=hBr7oGwGL2VgfITlQCTz-a1iwvvf7Mfl-HY8UdENZac,19929
59
- runnable-0.28.1.dist-info/METADATA,sha256=j-mrRLCkfv8GkWDLLFDtheBccn9CP4H-NvKAwm2L9ak,10047
60
- runnable-0.28.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
61
- runnable-0.28.1.dist-info/entry_points.txt,sha256=ioMbWojILtdibYVgh1jXJ00SpK-tX3gy7oVGDq61cSk,1839
62
- runnable-0.28.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
- runnable-0.28.1.dist-info/RECORD,,
59
+ runnable-0.28.3.dist-info/METADATA,sha256=Nyn4qIxAdhRHPN--RXPJTwV-0CTgkdynbDsU1j8IXrA,10047
60
+ runnable-0.28.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
61
+ runnable-0.28.3.dist-info/entry_points.txt,sha256=ioMbWojILtdibYVgh1jXJ00SpK-tX3gy7oVGDq61cSk,1839
62
+ runnable-0.28.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
+ runnable-0.28.3.dist-info/RECORD,,