runnable 0.28.3__tar.gz → 0.28.4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {runnable-0.28.3 → runnable-0.28.4}/PKG-INFO +1 -1
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/k8s.py +37 -24
- {runnable-0.28.3 → runnable-0.28.4}/pyproject.toml +1 -1
- {runnable-0.28.3 → runnable-0.28.4}/.gitignore +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/LICENSE +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/__init__.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/catalog/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/catalog/any_path.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/catalog/file_system.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/catalog/minio.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/catalog/pyproject.toml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/catalog/s3.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/__init__.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/k8s_job_spec.yaml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/local.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/local_container.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/job_executor/pyproject.toml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/nodes/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/nodes/nodes.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/nodes/pyproject.toml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/__init__.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/argo.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/local.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/local_container.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/mocked.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/pyproject.toml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/pipeline_executor/retry.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/__init__.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/any_path.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/chunked_fs.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/chunked_minio.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/db/implementation_FF.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/db/integration_FF.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/file_system.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/generic_chunked.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/minio.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/run_log_store/pyproject.toml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/secrets/README.md +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/secrets/dotenv.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/extensions/secrets/pyproject.toml +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/__init__.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/catalog.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/cli.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/context.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/datastore.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/defaults.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/entrypoints.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/exceptions.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/executor.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/graph.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/names.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/nodes.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/parameters.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/pickler.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/sdk.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/secrets.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/tasks.py +0 -0
- {runnable-0.28.3 → runnable-0.28.4}/runnable/utils.py +0 -0
@@ -39,7 +39,17 @@ class TolerationOperator(str, Enum):
|
|
39
39
|
EQUAL = "Equal"
|
40
40
|
|
41
41
|
|
42
|
-
class
|
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,24 +57,24 @@ class Toleration(BaseModel):
|
|
47
57
|
toleration_seconds: Optional[int] = Field(default=None)
|
48
58
|
|
49
59
|
|
50
|
-
class LabelSelectorRequirement(
|
60
|
+
class LabelSelectorRequirement(BaseModelWIthConfig):
|
51
61
|
key: str
|
52
62
|
operator: Operator
|
53
63
|
values: list[str]
|
54
64
|
|
55
65
|
|
56
|
-
class LabelSelector(
|
66
|
+
class LabelSelector(BaseModelWIthConfig):
|
57
67
|
match_expressions: list[LabelSelectorRequirement]
|
58
68
|
match_labels: dict[str, str]
|
59
69
|
|
60
70
|
|
61
|
-
class ObjectMetaData(
|
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(
|
77
|
+
class EnvVar(BaseModelWIthConfig):
|
68
78
|
name: str
|
69
79
|
value: str
|
70
80
|
|
@@ -75,7 +85,7 @@ VendorGPU = Annotated[
|
|
75
85
|
]
|
76
86
|
|
77
87
|
|
78
|
-
class Request(
|
88
|
+
class Request(BaseModelWIthConfig):
|
79
89
|
"""
|
80
90
|
The default requests
|
81
91
|
"""
|
@@ -85,7 +95,7 @@ class Request(BaseModel):
|
|
85
95
|
gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")
|
86
96
|
|
87
97
|
|
88
|
-
class Limit(
|
98
|
+
class Limit(BaseModelWIthConfig):
|
89
99
|
"""
|
90
100
|
The default limits
|
91
101
|
"""
|
@@ -95,34 +105,34 @@ class Limit(BaseModel):
|
|
95
105
|
gpu: VendorGPU = Field(default=None, serialization_alias="nvidia.com/gpu")
|
96
106
|
|
97
107
|
|
98
|
-
class Resources(
|
108
|
+
class Resources(BaseModelWIthConfig):
|
99
109
|
limits: Limit = Limit()
|
100
|
-
requests: Request =
|
110
|
+
requests: Optional[Request] = Field(default=None)
|
101
111
|
|
102
112
|
|
103
|
-
class VolumeMount(
|
113
|
+
class VolumeMount(BaseModelWIthConfig):
|
104
114
|
name: str
|
105
115
|
mount_path: str
|
106
116
|
|
107
117
|
|
108
|
-
class Container(
|
118
|
+
class Container(BaseModelWIthConfig):
|
109
119
|
image: str
|
110
120
|
env: list[EnvVar] = Field(default_factory=list)
|
111
|
-
image_pull_policy: ImagePullPolicy = ImagePullPolicy.NEVER
|
121
|
+
image_pull_policy: ImagePullPolicy = Field(default=ImagePullPolicy.NEVER)
|
112
122
|
resources: Resources = Resources()
|
113
123
|
volume_mounts: Optional[list[VolumeMount]] = Field(default_factory=lambda: [])
|
114
124
|
|
115
125
|
|
116
|
-
class HostPath(
|
126
|
+
class HostPath(BaseModelWIthConfig):
|
117
127
|
path: str
|
118
128
|
|
119
129
|
|
120
|
-
class HostPathVolume(
|
130
|
+
class HostPathVolume(BaseModelWIthConfig):
|
121
131
|
name: str
|
122
132
|
host_path: HostPath
|
123
133
|
|
124
134
|
|
125
|
-
class PVCClaim(
|
135
|
+
class PVCClaim(BaseModelWIthConfig):
|
126
136
|
claim_name: str
|
127
137
|
|
128
138
|
model_config = ConfigDict(
|
@@ -132,12 +142,12 @@ class PVCClaim(BaseModel):
|
|
132
142
|
)
|
133
143
|
|
134
144
|
|
135
|
-
class PVCVolume(
|
145
|
+
class PVCVolume(BaseModelWIthConfig):
|
136
146
|
name: str
|
137
147
|
persistent_volume_claim: PVCClaim
|
138
148
|
|
139
149
|
|
140
|
-
class K8sTemplateSpec(
|
150
|
+
class K8sTemplateSpec(BaseModelWIthConfig):
|
141
151
|
active_deadline_seconds: int = Field(default=60 * 60 * 2) # 2 hours
|
142
152
|
node_selector: Optional[dict[str, str]] = None
|
143
153
|
tolerations: Optional[list[Toleration]] = None
|
@@ -149,12 +159,12 @@ class K8sTemplateSpec(BaseModel):
|
|
149
159
|
container: Container
|
150
160
|
|
151
161
|
|
152
|
-
class K8sTemplate(
|
162
|
+
class K8sTemplate(BaseModelWIthConfig):
|
153
163
|
spec: K8sTemplateSpec
|
154
164
|
metadata: Optional[ObjectMetaData] = None
|
155
165
|
|
156
166
|
|
157
|
-
class Spec(
|
167
|
+
class Spec(BaseModelWIthConfig):
|
158
168
|
active_deadline_seconds: Optional[int] = Field(default=60 * 60 * 2) # 2 hours
|
159
169
|
backoff_limit: int = 6
|
160
170
|
selector: Optional[LabelSelector] = None
|
@@ -251,7 +261,7 @@ class GenericK8sJobExecutor(GenericJobExecutor):
|
|
251
261
|
command = utils.get_job_execution_command()
|
252
262
|
|
253
263
|
container_env = [
|
254
|
-
self._client.V1EnvVar(**env.model_dump(
|
264
|
+
self._client.V1EnvVar(**env.model_dump())
|
255
265
|
for env in self.job_spec.template.spec.container.env
|
256
266
|
]
|
257
267
|
|
@@ -260,8 +270,12 @@ class GenericK8sJobExecutor(GenericJobExecutor):
|
|
260
270
|
env=container_env,
|
261
271
|
name="default",
|
262
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
|
+
),
|
263
276
|
**self.job_spec.template.spec.container.model_dump(
|
264
|
-
exclude_none=True,
|
277
|
+
exclude_none=True,
|
278
|
+
exclude={"volume_mounts", "command", "env", "resources"},
|
265
279
|
),
|
266
280
|
)
|
267
281
|
|
@@ -269,14 +283,13 @@ class GenericK8sJobExecutor(GenericJobExecutor):
|
|
269
283
|
self._volumes += self.job_spec.template.spec.volumes
|
270
284
|
|
271
285
|
spec_volumes = [
|
272
|
-
self._client.V1Volume(**vol.model_dump(
|
273
|
-
for vol in self._volumes
|
286
|
+
self._client.V1Volume(**vol.model_dump()) for vol in self._volumes
|
274
287
|
]
|
275
288
|
|
276
289
|
tolerations = None
|
277
290
|
if self.job_spec.template.spec.tolerations:
|
278
291
|
tolerations = [
|
279
|
-
self._client.V1Toleration(**toleration.model_dump(
|
292
|
+
self._client.V1Toleration(**toleration.model_dump())
|
280
293
|
for toleration in self.job_spec.template.spec.tolerations
|
281
294
|
]
|
282
295
|
|
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
|
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
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|