runnable 0.28.2__tar.gz → 0.28.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. {runnable-0.28.2 → runnable-0.28.4}/PKG-INFO +1 -1
  2. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/k8s.py +46 -30
  3. {runnable-0.28.2 → runnable-0.28.4}/pyproject.toml +1 -1
  4. {runnable-0.28.2 → runnable-0.28.4}/.gitignore +0 -0
  5. {runnable-0.28.2 → runnable-0.28.4}/LICENSE +0 -0
  6. {runnable-0.28.2 → runnable-0.28.4}/README.md +0 -0
  7. {runnable-0.28.2 → runnable-0.28.4}/extensions/README.md +0 -0
  8. {runnable-0.28.2 → runnable-0.28.4}/extensions/__init__.py +0 -0
  9. {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/README.md +0 -0
  10. {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/any_path.py +0 -0
  11. {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/file_system.py +0 -0
  12. {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/minio.py +0 -0
  13. {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/pyproject.toml +0 -0
  14. {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/s3.py +0 -0
  15. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/README.md +0 -0
  16. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/__init__.py +0 -0
  17. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/k8s_job_spec.yaml +0 -0
  18. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/local.py +0 -0
  19. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/local_container.py +0 -0
  20. {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/pyproject.toml +0 -0
  21. {runnable-0.28.2 → runnable-0.28.4}/extensions/nodes/README.md +0 -0
  22. {runnable-0.28.2 → runnable-0.28.4}/extensions/nodes/nodes.py +0 -0
  23. {runnable-0.28.2 → runnable-0.28.4}/extensions/nodes/pyproject.toml +0 -0
  24. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/README.md +0 -0
  25. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/__init__.py +0 -0
  26. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/argo.py +0 -0
  27. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/local.py +0 -0
  28. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/local_container.py +0 -0
  29. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/mocked.py +0 -0
  30. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/pyproject.toml +0 -0
  31. {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/retry.py +0 -0
  32. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/README.md +0 -0
  33. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/__init__.py +0 -0
  34. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/any_path.py +0 -0
  35. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/chunked_fs.py +0 -0
  36. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/chunked_minio.py +0 -0
  37. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/db/implementation_FF.py +0 -0
  38. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/db/integration_FF.py +0 -0
  39. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/file_system.py +0 -0
  40. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/generic_chunked.py +0 -0
  41. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/minio.py +0 -0
  42. {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/pyproject.toml +0 -0
  43. {runnable-0.28.2 → runnable-0.28.4}/extensions/secrets/README.md +0 -0
  44. {runnable-0.28.2 → runnable-0.28.4}/extensions/secrets/dotenv.py +0 -0
  45. {runnable-0.28.2 → runnable-0.28.4}/extensions/secrets/pyproject.toml +0 -0
  46. {runnable-0.28.2 → runnable-0.28.4}/runnable/__init__.py +0 -0
  47. {runnable-0.28.2 → runnable-0.28.4}/runnable/catalog.py +0 -0
  48. {runnable-0.28.2 → runnable-0.28.4}/runnable/cli.py +0 -0
  49. {runnable-0.28.2 → runnable-0.28.4}/runnable/context.py +0 -0
  50. {runnable-0.28.2 → runnable-0.28.4}/runnable/datastore.py +0 -0
  51. {runnable-0.28.2 → runnable-0.28.4}/runnable/defaults.py +0 -0
  52. {runnable-0.28.2 → runnable-0.28.4}/runnable/entrypoints.py +0 -0
  53. {runnable-0.28.2 → runnable-0.28.4}/runnable/exceptions.py +0 -0
  54. {runnable-0.28.2 → runnable-0.28.4}/runnable/executor.py +0 -0
  55. {runnable-0.28.2 → runnable-0.28.4}/runnable/graph.py +0 -0
  56. {runnable-0.28.2 → runnable-0.28.4}/runnable/names.py +0 -0
  57. {runnable-0.28.2 → runnable-0.28.4}/runnable/nodes.py +0 -0
  58. {runnable-0.28.2 → runnable-0.28.4}/runnable/parameters.py +0 -0
  59. {runnable-0.28.2 → runnable-0.28.4}/runnable/pickler.py +0 -0
  60. {runnable-0.28.2 → runnable-0.28.4}/runnable/sdk.py +0 -0
  61. {runnable-0.28.2 → runnable-0.28.4}/runnable/secrets.py +0 -0
  62. {runnable-0.28.2 → runnable-0.28.4}/runnable/tasks.py +0 -0
  63. {runnable-0.28.2 → runnable-0.28.4}/runnable/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runnable
3
- Version: 0.28.2
3
+ Version: 0.28.4
4
4
  Summary: Add your description here
5
5
  Author-email: "Vammi, Vijay" <vijay.vammi@astrazeneca.com>
6
6
  License-File: LICENSE
@@ -39,7 +39,17 @@ class TolerationOperator(str, Enum):
39
39
  EQUAL = "Equal"
40
40
 
41
41
 
42
- class Toleration(BaseModel):
42
+ class BaseModelWIthConfig(BaseModel, use_enum_values=True):
43
+ model_config = ConfigDict(
44
+ extra="forbid",
45
+ alias_generator=to_camel,
46
+ populate_by_name=True,
47
+ from_attributes=True,
48
+ validate_default=True,
49
+ )
50
+
51
+
52
+ class Toleration(BaseModelWIthConfig):
43
53
  key: str
44
54
  operator: TolerationOperator = TolerationOperator.EQUAL
45
55
  value: Optional[str]
@@ -47,79 +57,82 @@ class Toleration(BaseModel):
47
57
  toleration_seconds: Optional[int] = Field(default=None)
48
58
 
49
59
 
50
- class LabelSelectorRequirement(BaseModel):
60
+ class LabelSelectorRequirement(BaseModelWIthConfig):
51
61
  key: str
52
62
  operator: Operator
53
63
  values: list[str]
54
64
 
55
65
 
56
- class LabelSelector(BaseModel):
66
+ class LabelSelector(BaseModelWIthConfig):
57
67
  match_expressions: list[LabelSelectorRequirement]
58
68
  match_labels: dict[str, str]
59
69
 
60
70
 
61
- class ObjectMetaData(BaseModel):
71
+ class ObjectMetaData(BaseModelWIthConfig):
62
72
  generate_name: Optional[str]
63
73
  annotations: Optional[dict[str, str]]
64
74
  namespace: Optional[str] = "default"
65
75
 
66
76
 
67
- class EnvVar(BaseModel):
77
+ class EnvVar(BaseModelWIthConfig):
68
78
  name: str
69
79
  value: str
70
80
 
71
81
 
72
- class Request(BaseModel):
82
+ VendorGPU = Annotated[
83
+ Optional[int],
84
+ PlainSerializer(lambda x: str(x), return_type=str, when_used="unless-none"),
85
+ ]
86
+
87
+
88
+ class Request(BaseModelWIthConfig):
73
89
  """
74
90
  The default requests
75
91
  """
76
92
 
77
93
  memory: str = "1Gi"
78
94
  cpu: str = "250m"
95
+ gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")
79
96
 
80
97
 
81
- VendorGPU = Annotated[
82
- Optional[int],
83
- PlainSerializer(lambda x: str(x), return_type=str, when_used="unless-none"),
84
- ]
85
-
86
-
87
- class Limit(Request):
98
+ class Limit(BaseModelWIthConfig):
88
99
  """
89
100
  The default limits
90
101
  """
91
102
 
103
+ memory: str = "1Gi"
104
+ cpu: str = "250m"
92
105
  gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")
93
106
 
94
107
 
95
- class Resources(BaseModel):
108
+ class Resources(BaseModelWIthConfig):
96
109
  limits: Limit = Limit()
97
- requests: Request = Request()
110
+ requests: Optional[Request] = Field(default=None)
98
111
 
99
112
 
100
- class VolumeMount(BaseModel):
113
+ class VolumeMount(BaseModelWIthConfig):
101
114
  name: str
102
115
  mount_path: str
103
116
 
104
117
 
105
- class Container(BaseModel):
118
+ class Container(BaseModelWIthConfig):
106
119
  image: str
107
120
  env: list[EnvVar] = Field(default_factory=list)
108
- image_pull_policy: ImagePullPolicy = ImagePullPolicy.NEVER
121
+ image_pull_policy: ImagePullPolicy = Field(default=ImagePullPolicy.NEVER)
109
122
  resources: Resources = Resources()
110
123
  volume_mounts: Optional[list[VolumeMount]] = Field(default_factory=lambda: [])
111
124
 
112
125
 
113
- class HostPath(BaseModel):
126
+ class HostPath(BaseModelWIthConfig):
114
127
  path: str
115
128
 
116
129
 
117
- class HostPathVolume(BaseModel):
130
+ class HostPathVolume(BaseModelWIthConfig):
118
131
  name: str
119
132
  host_path: HostPath
120
133
 
121
134
 
122
- class PVCClaim(BaseModel):
135
+ class PVCClaim(BaseModelWIthConfig):
123
136
  claim_name: str
124
137
 
125
138
  model_config = ConfigDict(
@@ -129,12 +142,12 @@ class PVCClaim(BaseModel):
129
142
  )
130
143
 
131
144
 
132
- class PVCVolume(BaseModel):
145
+ class PVCVolume(BaseModelWIthConfig):
133
146
  name: str
134
147
  persistent_volume_claim: PVCClaim
135
148
 
136
149
 
137
- class K8sTemplateSpec(BaseModel):
150
+ class K8sTemplateSpec(BaseModelWIthConfig):
138
151
  active_deadline_seconds: int = Field(default=60 * 60 * 2) # 2 hours
139
152
  node_selector: Optional[dict[str, str]] = None
140
153
  tolerations: Optional[list[Toleration]] = None
@@ -146,12 +159,12 @@ class K8sTemplateSpec(BaseModel):
146
159
  container: Container
147
160
 
148
161
 
149
- class K8sTemplate(BaseModel):
162
+ class K8sTemplate(BaseModelWIthConfig):
150
163
  spec: K8sTemplateSpec
151
164
  metadata: Optional[ObjectMetaData] = None
152
165
 
153
166
 
154
- class Spec(BaseModel):
167
+ class Spec(BaseModelWIthConfig):
155
168
  active_deadline_seconds: Optional[int] = Field(default=60 * 60 * 2) # 2 hours
156
169
  backoff_limit: int = 6
157
170
  selector: Optional[LabelSelector] = None
@@ -248,7 +261,7 @@ class GenericK8sJobExecutor(GenericJobExecutor):
248
261
  command = utils.get_job_execution_command()
249
262
 
250
263
  container_env = [
251
- self._client.V1EnvVar(**env.model_dump(by_alias=True))
264
+ self._client.V1EnvVar(**env.model_dump())
252
265
  for env in self.job_spec.template.spec.container.env
253
266
  ]
254
267
 
@@ -257,8 +270,12 @@ class GenericK8sJobExecutor(GenericJobExecutor):
257
270
  env=container_env,
258
271
  name="default",
259
272
  volume_mounts=container_volume_mounts,
273
+ resources=self.job_spec.template.spec.container.resources.model_dump(
274
+ by_alias=True, exclude_none=True
275
+ ),
260
276
  **self.job_spec.template.spec.container.model_dump(
261
- exclude_none=True, exclude={"volume_mounts", "command", "env"}
277
+ exclude_none=True,
278
+ exclude={"volume_mounts", "command", "env", "resources"},
262
279
  ),
263
280
  )
264
281
 
@@ -266,14 +283,13 @@ class GenericK8sJobExecutor(GenericJobExecutor):
266
283
  self._volumes += self.job_spec.template.spec.volumes
267
284
 
268
285
  spec_volumes = [
269
- self._client.V1Volume(**vol.model_dump(by_alias=True))
270
- for vol in self._volumes
286
+ self._client.V1Volume(**vol.model_dump()) for vol in self._volumes
271
287
  ]
272
288
 
273
289
  tolerations = None
274
290
  if self.job_spec.template.spec.tolerations:
275
291
  tolerations = [
276
- self._client.V1Toleration(**toleration.model_dump(by_alias=True))
292
+ self._client.V1Toleration(**toleration.model_dump())
277
293
  for toleration in self.job_spec.template.spec.tolerations
278
294
  ]
279
295
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runnable"
3
- version = "0.28.2"
3
+ version = "0.28.4"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes