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.
- {runnable-0.28.2 → runnable-0.28.4}/PKG-INFO +1 -1
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/k8s.py +46 -30
- {runnable-0.28.2 → runnable-0.28.4}/pyproject.toml +1 -1
- {runnable-0.28.2 → runnable-0.28.4}/.gitignore +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/LICENSE +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/__init__.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/any_path.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/file_system.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/minio.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/pyproject.toml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/catalog/s3.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/__init__.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/k8s_job_spec.yaml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/local.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/local_container.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/job_executor/pyproject.toml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/nodes/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/nodes/nodes.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/nodes/pyproject.toml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/__init__.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/argo.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/local.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/local_container.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/mocked.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/pyproject.toml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/pipeline_executor/retry.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/__init__.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/any_path.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/chunked_fs.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/chunked_minio.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/db/implementation_FF.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/db/integration_FF.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/file_system.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/generic_chunked.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/minio.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/run_log_store/pyproject.toml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/secrets/README.md +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/secrets/dotenv.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/extensions/secrets/pyproject.toml +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/__init__.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/catalog.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/cli.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/context.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/datastore.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/defaults.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/entrypoints.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/exceptions.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/executor.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/graph.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/names.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/nodes.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/parameters.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/pickler.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/sdk.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/secrets.py +0 -0
- {runnable-0.28.2 → runnable-0.28.4}/runnable/tasks.py +0 -0
- {runnable-0.28.2 → 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,79 +57,82 @@ 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
|
|
71
81
|
|
72
|
-
|
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
|
-
|
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(
|
108
|
+
class Resources(BaseModelWIthConfig):
|
96
109
|
limits: Limit = Limit()
|
97
|
-
requests: Request =
|
110
|
+
requests: Optional[Request] = Field(default=None)
|
98
111
|
|
99
112
|
|
100
|
-
class VolumeMount(
|
113
|
+
class VolumeMount(BaseModelWIthConfig):
|
101
114
|
name: str
|
102
115
|
mount_path: str
|
103
116
|
|
104
117
|
|
105
|
-
class Container(
|
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(
|
126
|
+
class HostPath(BaseModelWIthConfig):
|
114
127
|
path: str
|
115
128
|
|
116
129
|
|
117
|
-
class HostPathVolume(
|
130
|
+
class HostPathVolume(BaseModelWIthConfig):
|
118
131
|
name: str
|
119
132
|
host_path: HostPath
|
120
133
|
|
121
134
|
|
122
|
-
class PVCClaim(
|
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(
|
145
|
+
class PVCVolume(BaseModelWIthConfig):
|
133
146
|
name: str
|
134
147
|
persistent_volume_claim: PVCClaim
|
135
148
|
|
136
149
|
|
137
|
-
class K8sTemplateSpec(
|
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(
|
162
|
+
class K8sTemplate(BaseModelWIthConfig):
|
150
163
|
spec: K8sTemplateSpec
|
151
164
|
metadata: Optional[ObjectMetaData] = None
|
152
165
|
|
153
166
|
|
154
|
-
class Spec(
|
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(
|
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,
|
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(
|
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(
|
292
|
+
self._client.V1Toleration(**toleration.model_dump())
|
277
293
|
for toleration in self.job_spec.template.spec.tolerations
|
278
294
|
]
|
279
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
|