dagster-k8s 0.26.12__tar.gz → 0.26.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dagster-k8s might be problematic. Click here for more details.
- {dagster-k8s-0.26.12/dagster_k8s.egg-info → dagster_k8s-0.26.14}/PKG-INFO +14 -2
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/client.py +20 -1
- dagster_k8s-0.26.14/dagster_k8s/component.py +57 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/launcher.py +2 -2
- dagster_k8s-0.26.14/dagster_k8s/version.py +1 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14/dagster_k8s.egg-info}/PKG-INFO +14 -2
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s.egg-info/SOURCES.txt +1 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s.egg-info/requires.txt +1 -1
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/setup.py +1 -1
- dagster-k8s-0.26.12/dagster_k8s/version.py +0 -1
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/LICENSE +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/MANIFEST.in +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/README.md +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/__init__.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/container_context.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/executor.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/job.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/kubernetes_version.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/models.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/ops/__init__.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/ops/k8s_job_op.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/pipes.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/py.typed +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/test.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s/utils.py +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s.egg-info/dependency_links.txt +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s.egg-info/not-zip-safe +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/dagster_k8s.egg-info/top_level.txt +0 -0
- {dagster-k8s-0.26.12 → dagster_k8s-0.26.14}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-k8s
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.14
|
|
4
4
|
Summary: A Dagster integration for k8s
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-k8s
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -14,3 +14,15 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Requires-Python: >=3.9,<3.13
|
|
16
16
|
License-File: LICENSE
|
|
17
|
+
Requires-Dist: dagster==1.10.14
|
|
18
|
+
Requires-Dist: kubernetes<33
|
|
19
|
+
Requires-Dist: google-auth!=2.23.1
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: home-page
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
Dynamic: summary
|
|
@@ -8,6 +8,7 @@ from typing import Any, Callable, Optional, TypeVar
|
|
|
8
8
|
import kubernetes.client
|
|
9
9
|
import kubernetes.client.rest
|
|
10
10
|
import six
|
|
11
|
+
import urllib3.exceptions
|
|
11
12
|
from dagster import (
|
|
12
13
|
DagsterInstance,
|
|
13
14
|
_check as check,
|
|
@@ -23,12 +24,14 @@ try:
|
|
|
23
24
|
except ImportError:
|
|
24
25
|
K8S_EVENTS_API_PRESENT = False
|
|
25
26
|
|
|
27
|
+
logger = logging.getLogger(__name__)
|
|
26
28
|
|
|
27
29
|
T = TypeVar("T")
|
|
28
30
|
|
|
29
31
|
DEFAULT_WAIT_TIMEOUT = 86400.0 # 1 day
|
|
30
32
|
DEFAULT_WAIT_BETWEEN_ATTEMPTS = 10.0 # 10 seconds
|
|
31
33
|
DEFAULT_JOB_POD_COUNT = 1 # expect job:pod to be 1:1 by default
|
|
34
|
+
DEFAULT_JOB_CREATION_TIMEOUT = 10.0 # 10 seconds
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
class WaitForPodState(Enum):
|
|
@@ -223,6 +226,20 @@ def k8s_api_retry_creation_mutation(
|
|
|
223
226
|
k8s_api_exception=e,
|
|
224
227
|
original_exc_info=sys.exc_info(),
|
|
225
228
|
) from e
|
|
229
|
+
except urllib3.exceptions.HTTPError as e:
|
|
230
|
+
# Temporary for recovery detection
|
|
231
|
+
logger.error(
|
|
232
|
+
f"k8s_api_retry_creation_mutation: {e.__module__}.{e.__class__.__name__}: {e!s}"
|
|
233
|
+
)
|
|
234
|
+
if remaining_attempts > 0:
|
|
235
|
+
time.sleep(timeout)
|
|
236
|
+
else:
|
|
237
|
+
raise DagsterK8sAPIRetryLimitExceeded(
|
|
238
|
+
msg_fn(),
|
|
239
|
+
k8s_api_exception=e,
|
|
240
|
+
max_retries=max_retries,
|
|
241
|
+
original_exc_info=sys.exc_info(),
|
|
242
|
+
) from e
|
|
226
243
|
check.failed("Unreachable.")
|
|
227
244
|
|
|
228
245
|
|
|
@@ -1015,7 +1032,9 @@ class DagsterKubernetesClient:
|
|
|
1015
1032
|
wait_time_between_attempts: float = DEFAULT_WAIT_BETWEEN_ATTEMPTS,
|
|
1016
1033
|
) -> None:
|
|
1017
1034
|
k8s_api_retry_creation_mutation(
|
|
1018
|
-
lambda: self.batch_api.create_namespaced_job(
|
|
1035
|
+
lambda: self.batch_api.create_namespaced_job(
|
|
1036
|
+
body=body, namespace=namespace, _request_timeout=DEFAULT_JOB_CREATION_TIMEOUT
|
|
1037
|
+
),
|
|
1019
1038
|
max_retries=3,
|
|
1020
1039
|
timeout=wait_time_between_attempts,
|
|
1021
1040
|
)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from collections.abc import Mapping, Sequence
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from functools import cached_property
|
|
4
|
+
from typing import Any, Optional, Union
|
|
5
|
+
|
|
6
|
+
from dagster import AssetExecutionContext, AssetsDefinition, Definitions, multi_asset
|
|
7
|
+
from dagster.components import Component, ComponentLoadContext, Resolvable, ResolvedAssetSpec
|
|
8
|
+
|
|
9
|
+
from dagster_k8s.pipes import PipesK8sClient, build_pod_body
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class PipesK8sComponent(Component, Resolvable):
|
|
14
|
+
"""Component that creates assets backed by kubernetes pod execution via Dagster Pipes."""
|
|
15
|
+
|
|
16
|
+
name: str
|
|
17
|
+
assets: Sequence[ResolvedAssetSpec]
|
|
18
|
+
image: Optional[str] = None
|
|
19
|
+
command: Optional[Union[str, Sequence[str]]] = None
|
|
20
|
+
namespace: Optional[str] = None
|
|
21
|
+
env: Optional[Mapping[str, str]] = None
|
|
22
|
+
base_pod_meta: Optional[Mapping[str, Any]] = None
|
|
23
|
+
base_pod_spec: Optional[Mapping[str, Any]] = None
|
|
24
|
+
|
|
25
|
+
def __post_init__(self):
|
|
26
|
+
# validate that we can build a pod for the given args
|
|
27
|
+
# i.e. image or base_pod_self.image
|
|
28
|
+
build_pod_body(
|
|
29
|
+
pod_name=self.name,
|
|
30
|
+
image=self.image,
|
|
31
|
+
command=self.command,
|
|
32
|
+
env_vars=self.env or {},
|
|
33
|
+
base_pod_meta=self.base_pod_meta,
|
|
34
|
+
base_pod_spec=self.base_pod_spec,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
@cached_property
|
|
38
|
+
def client(self):
|
|
39
|
+
return PipesK8sClient()
|
|
40
|
+
|
|
41
|
+
def build_defs(self, context: ComponentLoadContext):
|
|
42
|
+
return Definitions(assets=[self.build_asset()])
|
|
43
|
+
|
|
44
|
+
def build_asset(self) -> AssetsDefinition:
|
|
45
|
+
@multi_asset(name=self.name, specs=self.assets)
|
|
46
|
+
def _asset(context: AssetExecutionContext):
|
|
47
|
+
return self.client.run(
|
|
48
|
+
context=context,
|
|
49
|
+
image=self.image,
|
|
50
|
+
command=self.command,
|
|
51
|
+
namespace=self.namespace,
|
|
52
|
+
env=self.env,
|
|
53
|
+
base_pod_meta=self.base_pod_meta,
|
|
54
|
+
base_pod_spec=self.base_pod_spec,
|
|
55
|
+
).get_results()
|
|
56
|
+
|
|
57
|
+
return _asset
|
|
@@ -445,8 +445,8 @@ class K8sRunLauncher(RunLauncher, ConfigurableClass):
|
|
|
445
445
|
WorkerStatus.FAILED, "Run has not completed but K8s job has no active pods"
|
|
446
446
|
)
|
|
447
447
|
|
|
448
|
-
if status.failed:
|
|
449
|
-
return CheckRunHealthResult(WorkerStatus.FAILED, "K8s job failed")
|
|
450
448
|
if status.succeeded:
|
|
451
449
|
return CheckRunHealthResult(WorkerStatus.SUCCESS)
|
|
450
|
+
if status.failed and not status.active:
|
|
451
|
+
return CheckRunHealthResult(WorkerStatus.FAILED, "K8s job failed")
|
|
452
452
|
return CheckRunHealthResult(WorkerStatus.RUNNING)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.26.14"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-k8s
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.14
|
|
4
4
|
Summary: A Dagster integration for k8s
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-k8s
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -14,3 +14,15 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Requires-Python: >=3.9,<3.13
|
|
16
16
|
License-File: LICENSE
|
|
17
|
+
Requires-Dist: dagster==1.10.14
|
|
18
|
+
Requires-Dist: kubernetes<33
|
|
19
|
+
Requires-Dist: google-auth!=2.23.1
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: home-page
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
Dynamic: summary
|
|
@@ -42,7 +42,7 @@ setup(
|
|
|
42
42
|
include_package_data=True,
|
|
43
43
|
python_requires=">=3.9,<3.13",
|
|
44
44
|
install_requires=[
|
|
45
|
-
"dagster==1.10.
|
|
45
|
+
"dagster==1.10.14",
|
|
46
46
|
f"kubernetes<{KUBERNETES_VERSION_UPPER_BOUND}",
|
|
47
47
|
# exclude a google-auth release that added an overly restrictive urllib3 pin that confuses dependency resolvers
|
|
48
48
|
"google-auth!=2.23.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.26.12"
|
|
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
|