dagster-k8s 0.26.11rc1__py3-none-any.whl → 0.26.13__py3-none-any.whl
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/client.py +27 -4
- dagster_k8s/launcher.py +2 -2
- dagster_k8s/pipes.py +1 -1
- dagster_k8s/version.py +1 -1
- {dagster_k8s-0.26.11rc1.dist-info → dagster_k8s-0.26.13.dist-info}/METADATA +14 -6
- {dagster_k8s-0.26.11rc1.dist-info → dagster_k8s-0.26.13.dist-info}/RECORD +9 -9
- {dagster_k8s-0.26.11rc1.dist-info → dagster_k8s-0.26.13.dist-info}/WHEEL +1 -1
- {dagster_k8s-0.26.11rc1.dist-info → dagster_k8s-0.26.13.dist-info/licenses}/LICENSE +0 -0
- {dagster_k8s-0.26.11rc1.dist-info → dagster_k8s-0.26.13.dist-info}/top_level.txt +0 -0
dagster_k8s/client.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import os
|
|
2
3
|
import sys
|
|
3
4
|
import time
|
|
4
5
|
from enum import Enum
|
|
@@ -7,6 +8,7 @@ from typing import Any, Callable, Optional, TypeVar
|
|
|
7
8
|
import kubernetes.client
|
|
8
9
|
import kubernetes.client.rest
|
|
9
10
|
import six
|
|
11
|
+
import urllib3.exceptions
|
|
10
12
|
from dagster import (
|
|
11
13
|
DagsterInstance,
|
|
12
14
|
_check as check,
|
|
@@ -22,12 +24,14 @@ try:
|
|
|
22
24
|
except ImportError:
|
|
23
25
|
K8S_EVENTS_API_PRESENT = False
|
|
24
26
|
|
|
27
|
+
logger = logging.getLogger(__name__)
|
|
25
28
|
|
|
26
29
|
T = TypeVar("T")
|
|
27
30
|
|
|
28
31
|
DEFAULT_WAIT_TIMEOUT = 86400.0 # 1 day
|
|
29
32
|
DEFAULT_WAIT_BETWEEN_ATTEMPTS = 10.0 # 10 seconds
|
|
30
33
|
DEFAULT_JOB_POD_COUNT = 1 # expect job:pod to be 1:1 by default
|
|
34
|
+
DEFAULT_JOB_CREATION_TIMEOUT = 10.0 # 10 seconds
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
class WaitForPodState(Enum):
|
|
@@ -222,6 +226,20 @@ def k8s_api_retry_creation_mutation(
|
|
|
222
226
|
k8s_api_exception=e,
|
|
223
227
|
original_exc_info=sys.exc_info(),
|
|
224
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
|
|
225
243
|
check.failed("Unreachable.")
|
|
226
244
|
|
|
227
245
|
|
|
@@ -740,13 +758,16 @@ class DagsterKubernetesClient:
|
|
|
740
758
|
elif state.terminated is not None:
|
|
741
759
|
container_name = container_status.name
|
|
742
760
|
if state.terminated.exit_code != 0:
|
|
761
|
+
tail_lines = int(
|
|
762
|
+
os.getenv("DAGSTER_K8S_WAIT_FOR_POD_FAILURE_LOG_LINE_COUNT", "100")
|
|
763
|
+
)
|
|
743
764
|
raw_logs = self.retrieve_pod_logs(
|
|
744
|
-
pod_name, namespace, container_name=container_name
|
|
765
|
+
pod_name, namespace, container_name=container_name, tail_lines=tail_lines
|
|
745
766
|
)
|
|
746
767
|
message = state.terminated.message
|
|
747
768
|
msg = (
|
|
748
|
-
f'Container "{container_name}" failed with message: "{message}" '
|
|
749
|
-
f'
|
|
769
|
+
f'Container "{container_name}" failed with message: "{message}". '
|
|
770
|
+
f'Last {tail_lines} log lines: "{raw_logs}"'
|
|
750
771
|
)
|
|
751
772
|
|
|
752
773
|
self.logger(msg)
|
|
@@ -1011,7 +1032,9 @@ class DagsterKubernetesClient:
|
|
|
1011
1032
|
wait_time_between_attempts: float = DEFAULT_WAIT_BETWEEN_ATTEMPTS,
|
|
1012
1033
|
) -> None:
|
|
1013
1034
|
k8s_api_retry_creation_mutation(
|
|
1014
|
-
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
|
+
),
|
|
1015
1038
|
max_retries=3,
|
|
1016
1039
|
timeout=wait_time_between_attempts,
|
|
1017
1040
|
)
|
dagster_k8s/launcher.py
CHANGED
|
@@ -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)
|
dagster_k8s/pipes.py
CHANGED
|
@@ -526,7 +526,7 @@ class PipesK8sClient(PipesClient, TreatAsResourceParam):
|
|
|
526
526
|
pod_name=pod_name,
|
|
527
527
|
enable_multi_container_logs=enable_multi_container_logs,
|
|
528
528
|
):
|
|
529
|
-
#
|
|
529
|
+
# wait until the pod is fully terminated (or raise an exception if it failed)
|
|
530
530
|
client.wait_for_pod(
|
|
531
531
|
pod_name,
|
|
532
532
|
namespace,
|
dagster_k8s/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.26.
|
|
1
|
+
__version__ = "0.26.13"
|
|
@@ -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.13
|
|
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,7 +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
|
|
18
|
-
Requires-Dist: kubernetes
|
|
19
|
-
Requires-Dist: google-auth
|
|
20
|
-
|
|
17
|
+
Requires-Dist: dagster==1.10.13
|
|
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
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
dagster_k8s/__init__.py,sha256=1Vi9HXEW9fatVuNzWTr6Oq-JEHmyDrVkonZuELsQ1C0,751
|
|
2
|
-
dagster_k8s/client.py,sha256
|
|
2
|
+
dagster_k8s/client.py,sha256=-Ns2saJri4Xxu-OpQ_T93e2K6aVnZvU19tj0iaMmTg8,40901
|
|
3
3
|
dagster_k8s/container_context.py,sha256=399bdqmV3Ce6lNbfuxnhdyJSCy9keRRPJfVjDGn2U4I,22642
|
|
4
4
|
dagster_k8s/executor.py,sha256=yOvA5KuGi9O5C3KGz6IP8HVPwt2CSD9NU7ITcWxe53M,14872
|
|
5
5
|
dagster_k8s/job.py,sha256=v7RXYLZHzy2sTC7HYdz_INqbLWyZxUz9QIMwORArjJg,43065
|
|
6
6
|
dagster_k8s/kubernetes_version.py,sha256=T7MDA5pOOVE_woRUkKWxtiRj4RCLAVfjSn6ZXUr6sAA,38
|
|
7
|
-
dagster_k8s/launcher.py,sha256=
|
|
7
|
+
dagster_k8s/launcher.py,sha256=LlbXu3WYemmt_H7kOmbbKPNLnsQHszipQz_JmTMXdEA,16691
|
|
8
8
|
dagster_k8s/models.py,sha256=REKzAY103pZw0pQFqvHaM6lL02hgbi0rxmm71qds4W8,6338
|
|
9
|
-
dagster_k8s/pipes.py,sha256=
|
|
9
|
+
dagster_k8s/pipes.py,sha256=kb1So6erUgjTDkicALpU1T5mG9xa9n8aeI4lPUVeU2o,34031
|
|
10
10
|
dagster_k8s/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
11
11
|
dagster_k8s/test.py,sha256=cNtcbzxytiZtd01wY5ip7KPi01y0BUQuQhohoIfAFUM,684
|
|
12
12
|
dagster_k8s/utils.py,sha256=c1bHqh5f1p5RZ0JCT6WEbPPjDvbgUp3pl4nYZRaaI4s,786
|
|
13
|
-
dagster_k8s/version.py,sha256=
|
|
13
|
+
dagster_k8s/version.py,sha256=EDf5CcPxrnkRq2ViErwz2GB5gPrihrLuUdZnXlor9gM,24
|
|
14
14
|
dagster_k8s/ops/__init__.py,sha256=ur-9GrE_DRfnsFCpYan03qOY9cWbjagC8KHZFZuiCmc,113
|
|
15
15
|
dagster_k8s/ops/k8s_job_op.py,sha256=CQHtTowGGLAHH5EUGNfqZxDT1MYMqslAJ9u11SzCf-I,22036
|
|
16
|
-
dagster_k8s-0.26.
|
|
17
|
-
dagster_k8s-0.26.
|
|
18
|
-
dagster_k8s-0.26.
|
|
19
|
-
dagster_k8s-0.26.
|
|
20
|
-
dagster_k8s-0.26.
|
|
16
|
+
dagster_k8s-0.26.13.dist-info/licenses/LICENSE,sha256=TMatHW4_G9ldRdodEAp-l2Xa2WvsdeOh60E3v1R2jis,11349
|
|
17
|
+
dagster_k8s-0.26.13.dist-info/METADATA,sha256=pXbhkX0a9rboKfXe63XzpMA7gDwQ0giPW3kDffMbVQc,912
|
|
18
|
+
dagster_k8s-0.26.13.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
|
|
19
|
+
dagster_k8s-0.26.13.dist-info/top_level.txt,sha256=wFPjskoWPlk2hOLugYCaoZhSiZdUcbCA1QZe9I4dals,12
|
|
20
|
+
dagster_k8s-0.26.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|