dagster-k8s 0.25.4rc0__py3-none-any.whl → 0.25.6__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 CHANGED
@@ -673,7 +673,6 @@ class DagsterKubernetesClient:
673
673
  # State checks below, see:
674
674
  # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#containerstate-v1-core
675
675
  state = container_status.state
676
-
677
676
  if state.running is not None:
678
677
  if wait_for_state == WaitForPodState.Ready:
679
678
  # ready is boolean field of container status
@@ -684,6 +683,11 @@ class DagsterKubernetesClient:
684
683
  continue
685
684
  else:
686
685
  ready_containers.add(container_status.name)
686
+ if container_status.name in initcontainers:
687
+ self.logger(
688
+ f'Init container "{container_status.name}" is ready, waiting for non-init containers...'
689
+ )
690
+ continue
687
691
  if initcontainers.issubset(exited_containers | ready_containers):
688
692
  self.logger(f'Pod "{pod_name}" is ready, done waiting')
689
693
  break
dagster_k8s/executor.py CHANGED
@@ -332,7 +332,7 @@ class K8sStepHandler(StepHandler):
332
332
  container_context = self._get_container_context(step_handler_context)
333
333
 
334
334
  status = self._api_client.get_job_status(
335
- namespace=container_context.namespace,
335
+ namespace=container_context.namespace, # pyright: ignore[reportArgumentType]
336
336
  job_name=job_name,
337
337
  )
338
338
  if not status:
dagster_k8s/launcher.py CHANGED
@@ -313,6 +313,11 @@ class K8sRunLauncher(RunLauncher, ConfigurableClass):
313
313
 
314
314
  self._launch_k8s_job_with_args(job_name, args, run)
315
315
 
316
+ def _get_resume_attempt_number(self, run: DagsterRun) -> Optional[int]:
317
+ if not self.supports_run_worker_crash_recovery:
318
+ return None
319
+ return self._instance.count_resume_run_attempts(run.run_id)
320
+
316
321
  def terminate(self, run_id):
317
322
  check.str_param(run_id, "run_id")
318
323
  run = self._instance.get_run_by_id(run_id)
@@ -325,7 +330,7 @@ class K8sRunLauncher(RunLauncher, ConfigurableClass):
325
330
  container_context = self.get_container_context_for_run(run)
326
331
 
327
332
  job_name = get_job_name_from_run_id(
328
- run_id, resume_attempt_number=self._instance.count_resume_run_attempts(run.run_id)
333
+ run_id, resume_attempt_number=self._get_resume_attempt_number(run)
329
334
  )
330
335
 
331
336
  try:
@@ -367,12 +372,10 @@ class K8sRunLauncher(RunLauncher, ConfigurableClass):
367
372
  self, run: DagsterRun, include_container_logs: Optional[bool] = True
368
373
  ) -> Optional[str]:
369
374
  container_context = self.get_container_context_for_run(run)
370
- if self.supports_run_worker_crash_recovery:
371
- resume_attempt_number = self._instance.count_resume_run_attempts(run.run_id)
372
- else:
373
- resume_attempt_number = None
374
375
 
375
- job_name = get_job_name_from_run_id(run.run_id, resume_attempt_number=resume_attempt_number)
376
+ job_name = get_job_name_from_run_id(
377
+ run.run_id, resume_attempt_number=self._get_resume_attempt_number(run)
378
+ )
376
379
  namespace = container_context.namespace
377
380
  pod_names = self._api_client.get_pod_names_in_job(job_name, namespace=namespace)
378
381
  full_msg = ""
@@ -397,7 +400,7 @@ class K8sRunLauncher(RunLauncher, ConfigurableClass):
397
400
  )
398
401
 
399
402
  else:
400
- job_debug_info = self._api_client.get_job_debug_info(job_name, namespace=namespace)
403
+ job_debug_info = self._api_client.get_job_debug_info(job_name, namespace=namespace) # pyright: ignore[reportArgumentType]
401
404
  full_msg = (
402
405
  full_msg
403
406
  + "\n\n"
@@ -411,15 +414,12 @@ class K8sRunLauncher(RunLauncher, ConfigurableClass):
411
414
  def check_run_worker_health(self, run: DagsterRun):
412
415
  container_context = self.get_container_context_for_run(run)
413
416
 
414
- if self.supports_run_worker_crash_recovery:
415
- resume_attempt_number = self._instance.count_resume_run_attempts(run.run_id)
416
- else:
417
- resume_attempt_number = None
418
-
419
- job_name = get_job_name_from_run_id(run.run_id, resume_attempt_number=resume_attempt_number)
417
+ job_name = get_job_name_from_run_id(
418
+ run.run_id, resume_attempt_number=self._get_resume_attempt_number(run)
419
+ )
420
420
  try:
421
421
  status = self._api_client.get_job_status(
422
- namespace=container_context.namespace,
422
+ namespace=container_context.namespace, # pyright: ignore[reportArgumentType]
423
423
  job_name=job_name,
424
424
  )
425
425
  except Exception:
dagster_k8s/models.py CHANGED
@@ -69,7 +69,7 @@ def _k8s_parse_value(data: Any, classname: str, attr_name: str) -> Any:
69
69
  elif klass == object:
70
70
  return data
71
71
  elif klass == datetime.date:
72
- return parse(data).date()
72
+ return parse(data).date() # pyright: ignore[reportAttributeAccessIssue]
73
73
  elif klass == datetime.datetime:
74
74
  return parse(data)
75
75
  else:
@@ -371,7 +371,10 @@ def execute_k8s_job(
371
371
  watch = kubernetes.watch.Watch() # consider moving in to api_client
372
372
 
373
373
  api_client.wait_for_pod(
374
- pod_to_watch, namespace, wait_timeout=timeout, start_time=start_time
374
+ pod_to_watch,
375
+ namespace, # pyright: ignore[reportArgumentType]
376
+ wait_timeout=timeout,
377
+ start_time=start_time, # pyright: ignore[reportArgumentType]
375
378
  )
376
379
 
377
380
  log_stream = watch.stream(
@@ -416,6 +419,20 @@ def execute_k8s_job(
416
419
  num_pods_to_wait_for=num_pods_to_wait_for,
417
420
  )
418
421
  except (DagsterExecutionInterruptedError, Exception) as e:
422
+ try:
423
+ pods = api_client.get_pod_names_in_job(job_name=job_name, namespace=namespace)
424
+ pod_debug_info = "\n\n".join(
425
+ [api_client.get_pod_debug_info(pod_name, namespace) for pod_name in pods]
426
+ )
427
+ except Exception:
428
+ context.log.exception(
429
+ f"Error trying to get pod debug information for failed k8s job {job_name}"
430
+ )
431
+ else:
432
+ context.log.error(
433
+ f"Debug information for failed k8s job {job_name}:\n\n{pod_debug_info}"
434
+ )
435
+
419
436
  if delete_failed_k8s_jobs:
420
437
  context.log.info(
421
438
  f"Deleting Kubernetes job {job_name} in namespace {namespace} due to exception"
dagster_k8s/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.25.4rc0"
1
+ __version__ = "0.25.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dagster-k8s
3
- Version: 0.25.4rc0
3
+ Version: 0.25.6
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,7 @@ 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.9.4rc0
17
+ Requires-Dist: dagster ==1.9.6
18
18
  Requires-Dist: kubernetes <32
19
19
  Requires-Dist: google-auth !=2.23.1
20
20
 
@@ -0,0 +1,20 @@
1
+ dagster_k8s/__init__.py,sha256=7LyrMxxhXKdGQYClq7OJwMiVJW0KYPP-8lTDrWLwyzU,750
2
+ dagster_k8s/client.py,sha256=t7hktemOBbS7dP7CYbfR7FqcMOQ-j1kfnRZ9Bl6El30,40044
3
+ dagster_k8s/container_context.py,sha256=47gts4BKPrlL624rT8MMKOn8kQtY3_f2FI2nmgsDPvU,22637
4
+ dagster_k8s/executor.py,sha256=Z8aeAHl5dMVjh_lkz0nimGAEfPaSTfmR9pLqSkGHt18,14719
5
+ dagster_k8s/job.py,sha256=-GzUcz80cwF9NwDAv3QdE6GezSSpUzF0kLRkj1oTO34,43046
6
+ dagster_k8s/kubernetes_version.py,sha256=jIBF12yvVweYUCmhC5AJ2Lb1JPcHxJfohJ1_hHfzS4o,38
7
+ dagster_k8s/launcher.py,sha256=6PIlu8b9NyXAFRlw2OKhF-Mb6-QO5gL9mkXmdmlXoCw,16589
8
+ dagster_k8s/models.py,sha256=2ZFgAhcSR06qLlMzLnEtMgZVJ8R2PKsVGu_f6K5nx3E,6317
9
+ dagster_k8s/pipes.py,sha256=kRHLYJfZi23GJe1_TW3Z3FglEpMrMLT43UV7YpTmKr8,30439
10
+ dagster_k8s/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
11
+ dagster_k8s/test.py,sha256=cNtcbzxytiZtd01wY5ip7KPi01y0BUQuQhohoIfAFUM,684
12
+ dagster_k8s/utils.py,sha256=c1bHqh5f1p5RZ0JCT6WEbPPjDvbgUp3pl4nYZRaaI4s,786
13
+ dagster_k8s/version.py,sha256=mgi0NAwnQWP7UdrUf2L9Xln12B8NoCQbqDnalCRZMpE,23
14
+ dagster_k8s/ops/__init__.py,sha256=ur-9GrE_DRfnsFCpYan03qOY9cWbjagC8KHZFZuiCmc,113
15
+ dagster_k8s/ops/k8s_job_op.py,sha256=ZZUz_fYXL6cxOmKJfL56wa_q6Kvh-qjYYBaYEZIMK2s,21815
16
+ dagster_k8s-0.25.6.dist-info/LICENSE,sha256=TMatHW4_G9ldRdodEAp-l2Xa2WvsdeOh60E3v1R2jis,11349
17
+ dagster_k8s-0.25.6.dist-info/METADATA,sha256=aq_AlQiqOR7iSnSZPV8K2p6wuwhAAhMBWy979LA6Mmw,732
18
+ dagster_k8s-0.25.6.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
19
+ dagster_k8s-0.25.6.dist-info/top_level.txt,sha256=wFPjskoWPlk2hOLugYCaoZhSiZdUcbCA1QZe9I4dals,12
20
+ dagster_k8s-0.25.6.dist-info/RECORD,,
@@ -1,20 +0,0 @@
1
- dagster_k8s/__init__.py,sha256=7LyrMxxhXKdGQYClq7OJwMiVJW0KYPP-8lTDrWLwyzU,750
2
- dagster_k8s/client.py,sha256=YA24A2uSmjesCAI3Y40Y8yy3-OcWs5UMvPVd8iyqRM8,39748
3
- dagster_k8s/container_context.py,sha256=47gts4BKPrlL624rT8MMKOn8kQtY3_f2FI2nmgsDPvU,22637
4
- dagster_k8s/executor.py,sha256=Py2t7VVHdL542fL5YIQLEPmFWD6f21oG0N-AUTrXfbw,14680
5
- dagster_k8s/job.py,sha256=-GzUcz80cwF9NwDAv3QdE6GezSSpUzF0kLRkj1oTO34,43046
6
- dagster_k8s/kubernetes_version.py,sha256=jIBF12yvVweYUCmhC5AJ2Lb1JPcHxJfohJ1_hHfzS4o,38
7
- dagster_k8s/launcher.py,sha256=Mfs4lD8pSjqC0S39d0csPJk6g-ieVuiyv680nWtSezw,16621
8
- dagster_k8s/models.py,sha256=OPksL8WjsdqJtGcw4WLkvsnrm1WA6vCUjqHL9dA2oYQ,6270
9
- dagster_k8s/pipes.py,sha256=kRHLYJfZi23GJe1_TW3Z3FglEpMrMLT43UV7YpTmKr8,30439
10
- dagster_k8s/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
11
- dagster_k8s/test.py,sha256=cNtcbzxytiZtd01wY5ip7KPi01y0BUQuQhohoIfAFUM,684
12
- dagster_k8s/utils.py,sha256=c1bHqh5f1p5RZ0JCT6WEbPPjDvbgUp3pl4nYZRaaI4s,786
13
- dagster_k8s/version.py,sha256=v8qyODIT075TCv5v2_8Yh-a1u1B20HmYXWcGIfo8nRw,26
14
- dagster_k8s/ops/__init__.py,sha256=ur-9GrE_DRfnsFCpYan03qOY9cWbjagC8KHZFZuiCmc,113
15
- dagster_k8s/ops/k8s_job_op.py,sha256=uLpQE3ZJbXDiGyyRZydyp-oDQn5XvQuhRcUwd2qiJho,21124
16
- dagster_k8s-0.25.4rc0.dist-info/LICENSE,sha256=TMatHW4_G9ldRdodEAp-l2Xa2WvsdeOh60E3v1R2jis,11349
17
- dagster_k8s-0.25.4rc0.dist-info/METADATA,sha256=aovnqPbjflVxSKfLnUAcPU1bDfUFuja7UZ3xM0HLrVg,738
18
- dagster_k8s-0.25.4rc0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
19
- dagster_k8s-0.25.4rc0.dist-info/top_level.txt,sha256=wFPjskoWPlk2hOLugYCaoZhSiZdUcbCA1QZe9I4dals,12
20
- dagster_k8s-0.25.4rc0.dist-info/RECORD,,