apache-airflow-providers-cncf-kubernetes 10.12.1rc1__py3-none-any.whl → 10.12.2__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.
- airflow/providers/cncf/kubernetes/__init__.py +1 -1
- airflow/providers/cncf/kubernetes/operators/pod.py +53 -25
- airflow/providers/cncf/kubernetes/triggers/pod.py +2 -4
- {apache_airflow_providers_cncf_kubernetes-10.12.1rc1.dist-info → apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info}/METADATA +9 -9
- {apache_airflow_providers_cncf_kubernetes-10.12.1rc1.dist-info → apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info}/RECORD +9 -9
- {apache_airflow_providers_cncf_kubernetes-10.12.1rc1.dist-info → apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_cncf_kubernetes-10.12.1rc1.dist-info → apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info}/entry_points.txt +0 -0
- {apache_airflow_providers_cncf_kubernetes-10.12.1rc1.dist-info → apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info}/licenses/LICENSE +0 -0
- {apache_airflow_providers_cncf_kubernetes-10.12.1rc1.dist-info → apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info}/licenses/NOTICE +0 -0
|
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
|
29
29
|
|
|
30
30
|
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
__version__ = "10.12.
|
|
32
|
+
__version__ = "10.12.2"
|
|
33
33
|
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
35
|
"2.11.0"
|
|
@@ -20,6 +20,7 @@ from __future__ import annotations
|
|
|
20
20
|
|
|
21
21
|
import asyncio
|
|
22
22
|
import datetime
|
|
23
|
+
import inspect
|
|
23
24
|
import json
|
|
24
25
|
import logging
|
|
25
26
|
import math
|
|
@@ -63,7 +64,7 @@ from airflow.providers.cncf.kubernetes.kubernetes_helper_functions import (
|
|
|
63
64
|
generic_api_retry,
|
|
64
65
|
)
|
|
65
66
|
from airflow.providers.cncf.kubernetes.pod_generator import PodGenerator
|
|
66
|
-
from airflow.providers.cncf.kubernetes.triggers.pod import KubernetesPodTrigger
|
|
67
|
+
from airflow.providers.cncf.kubernetes.triggers.pod import ContainerState, KubernetesPodTrigger
|
|
67
68
|
from airflow.providers.cncf.kubernetes.utils import xcom_sidecar
|
|
68
69
|
from airflow.providers.cncf.kubernetes.utils.container import (
|
|
69
70
|
container_is_succeeded,
|
|
@@ -852,7 +853,14 @@ class KubernetesPodOperator(BaseOperator):
|
|
|
852
853
|
ti.xcom_push(key="pod_name", value=self.pod.metadata.name)
|
|
853
854
|
ti.xcom_push(key="pod_namespace", value=self.pod.metadata.namespace)
|
|
854
855
|
|
|
855
|
-
|
|
856
|
+
# Check if invoke_defer_method accepts context parameter
|
|
857
|
+
# This might happen if the KPO is extended by for example old Google
|
|
858
|
+
# provider where invoke_defer_method does not accept context parameter
|
|
859
|
+
sig = inspect.signature(self.invoke_defer_method)
|
|
860
|
+
if "context" in sig.parameters:
|
|
861
|
+
self.invoke_defer_method(context=context)
|
|
862
|
+
else:
|
|
863
|
+
self.invoke_defer_method()
|
|
856
864
|
|
|
857
865
|
def convert_config_file_to_dict(self):
|
|
858
866
|
"""Convert passed config_file to dict representation."""
|
|
@@ -863,7 +871,9 @@ class KubernetesPodOperator(BaseOperator):
|
|
|
863
871
|
else:
|
|
864
872
|
self._config_dict = None
|
|
865
873
|
|
|
866
|
-
def invoke_defer_method(
|
|
874
|
+
def invoke_defer_method(
|
|
875
|
+
self, last_log_time: DateTime | None = None, context: Context | None = None
|
|
876
|
+
) -> None:
|
|
867
877
|
"""Redefine triggers which are being used in child classes."""
|
|
868
878
|
self.convert_config_file_to_dict()
|
|
869
879
|
|
|
@@ -882,29 +892,47 @@ class KubernetesPodOperator(BaseOperator):
|
|
|
882
892
|
self.log.info("Successfully resolved connection extras for deferral.")
|
|
883
893
|
|
|
884
894
|
trigger_start_time = datetime.datetime.now(tz=datetime.timezone.utc)
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
),
|
|
906
|
-
method_name="trigger_reentry",
|
|
895
|
+
|
|
896
|
+
trigger = KubernetesPodTrigger(
|
|
897
|
+
pod_name=self.pod.metadata.name, # type: ignore[union-attr]
|
|
898
|
+
pod_namespace=self.pod.metadata.namespace, # type: ignore[union-attr]
|
|
899
|
+
trigger_start_time=trigger_start_time,
|
|
900
|
+
kubernetes_conn_id=self.kubernetes_conn_id,
|
|
901
|
+
connection_extras=connection_extras,
|
|
902
|
+
cluster_context=self.cluster_context,
|
|
903
|
+
config_dict=self._config_dict,
|
|
904
|
+
in_cluster=self.in_cluster,
|
|
905
|
+
poll_interval=self.poll_interval,
|
|
906
|
+
get_logs=self.get_logs,
|
|
907
|
+
startup_timeout=self.startup_timeout_seconds,
|
|
908
|
+
startup_check_interval=self.startup_check_interval_seconds,
|
|
909
|
+
schedule_timeout=self.schedule_timeout_seconds,
|
|
910
|
+
base_container_name=self.base_container_name,
|
|
911
|
+
on_finish_action=self.on_finish_action.value,
|
|
912
|
+
last_log_time=last_log_time,
|
|
913
|
+
logging_interval=self.logging_interval,
|
|
914
|
+
trigger_kwargs=self.trigger_kwargs,
|
|
907
915
|
)
|
|
916
|
+
container_state = trigger.define_container_state(self.pod) if self.pod else None
|
|
917
|
+
if context and (
|
|
918
|
+
container_state == ContainerState.TERMINATED or container_state == ContainerState.FAILED
|
|
919
|
+
):
|
|
920
|
+
self.log.info("Skipping deferral as pod is already in a terminal state")
|
|
921
|
+
self.trigger_reentry(
|
|
922
|
+
context=context,
|
|
923
|
+
event={
|
|
924
|
+
"status": "failed" if container_state == ContainerState.FAILED else "success",
|
|
925
|
+
"namespace": trigger.pod_namespace,
|
|
926
|
+
"name": trigger.pod_name,
|
|
927
|
+
"message": "Container failed"
|
|
928
|
+
if container_state == ContainerState.FAILED
|
|
929
|
+
else "Container succeeded",
|
|
930
|
+
"last_log_time": last_log_time,
|
|
931
|
+
**(self.trigger_kwargs or {}),
|
|
932
|
+
},
|
|
933
|
+
)
|
|
934
|
+
else:
|
|
935
|
+
self.defer(trigger=trigger, method_name="trigger_reentry")
|
|
908
936
|
|
|
909
937
|
def trigger_reentry(self, context: Context, event: dict[str, Any]) -> Any:
|
|
910
938
|
"""
|
|
@@ -335,12 +335,10 @@ class KubernetesPodTrigger(BaseTrigger):
|
|
|
335
335
|
return AsyncPodManager(async_hook=self.hook)
|
|
336
336
|
|
|
337
337
|
def define_container_state(self, pod: V1Pod) -> ContainerState:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
if pod_containers is None:
|
|
338
|
+
if pod.status is None or pod.status.container_statuses is None:
|
|
341
339
|
return ContainerState.UNDEFINED
|
|
342
340
|
|
|
343
|
-
container = next(c for c in
|
|
341
|
+
container = next(c for c in pod.status.container_statuses if c.name == self.base_container_name)
|
|
344
342
|
|
|
345
343
|
for state in (ContainerState.RUNNING, ContainerState.WAITING, ContainerState.TERMINATED):
|
|
346
344
|
state_obj = getattr(container.state, state)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-airflow-providers-cncf-kubernetes
|
|
3
|
-
Version: 10.12.
|
|
3
|
+
Version: 10.12.2
|
|
4
4
|
Summary: Provider package apache-airflow-providers-cncf-kubernetes for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,cncf.kubernetes,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
@@ -23,16 +23,16 @@ Classifier: Topic :: System :: Monitoring
|
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: NOTICE
|
|
25
25
|
Requires-Dist: aiofiles>=23.2.0
|
|
26
|
-
Requires-Dist: apache-airflow>=2.11.
|
|
27
|
-
Requires-Dist: apache-airflow-providers-common-compat>=1.10.
|
|
26
|
+
Requires-Dist: apache-airflow>=2.11.0
|
|
27
|
+
Requires-Dist: apache-airflow-providers-common-compat>=1.10.1
|
|
28
28
|
Requires-Dist: asgiref>=3.5.2
|
|
29
29
|
Requires-Dist: cryptography>=41.0.0,<46.0.0
|
|
30
|
-
Requires-Dist: kubernetes>=
|
|
30
|
+
Requires-Dist: kubernetes>=35.0.0,<36.0.0
|
|
31
31
|
Requires-Dist: urllib3>=2.1.0,!=2.6.0
|
|
32
32
|
Requires-Dist: kubernetes_asyncio>=32.0.0,<35.0.0
|
|
33
33
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
34
|
-
Project-URL: Changelog, https://airflow.
|
|
35
|
-
Project-URL: Documentation, https://airflow.
|
|
34
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.12.2/changelog.html
|
|
35
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.12.2
|
|
36
36
|
Project-URL: Mastodon, https://fosstodon.org/@airflow
|
|
37
37
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
38
38
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
@@ -63,7 +63,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
|
63
63
|
|
|
64
64
|
Package ``apache-airflow-providers-cncf-kubernetes``
|
|
65
65
|
|
|
66
|
-
Release: ``10.12.
|
|
66
|
+
Release: ``10.12.2``
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
`Kubernetes <https://kubernetes.io/>`__
|
|
@@ -76,7 +76,7 @@ This is a provider package for ``cncf.kubernetes`` provider. All classes for thi
|
|
|
76
76
|
are in ``airflow.providers.cncf.kubernetes`` python package.
|
|
77
77
|
|
|
78
78
|
You can find package information and changelog for the provider
|
|
79
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.12.
|
|
79
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.12.2/>`_.
|
|
80
80
|
|
|
81
81
|
Installation
|
|
82
82
|
------------
|
|
@@ -123,5 +123,5 @@ Dependent package
|
|
|
123
123
|
================================================================================================================== =================
|
|
124
124
|
|
|
125
125
|
The changelog for the provider package can be found in the
|
|
126
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.12.
|
|
126
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.12.2/changelog.html>`_.
|
|
127
127
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
airflow/providers/cncf/kubernetes/__init__.py,sha256=
|
|
1
|
+
airflow/providers/cncf/kubernetes/__init__.py,sha256=6kcIzXO5-9ErEJ4ETdkUU7lJTGClhNoxTqtzlNSwOyA,1506
|
|
2
2
|
airflow/providers/cncf/kubernetes/callbacks.py,sha256=svvPFkkllJh3Qo7wIG5pnSf_19c3f5kzyKVYHkhyXoE,6456
|
|
3
3
|
airflow/providers/cncf/kubernetes/exceptions.py,sha256=iRrXBxaLPqYwUBt9zbadYgRbEDhGTo6I2mhLOa9F3DI,1707
|
|
4
4
|
airflow/providers/cncf/kubernetes/get_provider_info.py,sha256=_V-bvjuAW1yWM_RlJFLPEdDpjaBkMXFYjRr8dAKQZT0,16138
|
|
@@ -33,7 +33,7 @@ airflow/providers/cncf/kubernetes/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SB
|
|
|
33
33
|
airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py,sha256=ha3dC4DjAIs2wtmGC504EvViGA-GGce1iOdeS3y1ol0,15464
|
|
34
34
|
airflow/providers/cncf/kubernetes/operators/job.py,sha256=nprHUQ0Nmw3U5LuU6KvhVwLf-CR6Ix6uwjbtSFQMegQ,27482
|
|
35
35
|
airflow/providers/cncf/kubernetes/operators/kueue.py,sha256=E0ZqMQzH2dtNOAaA2W5bAuaS-zRz_ohfOElQ1N7NSTA,5560
|
|
36
|
-
airflow/providers/cncf/kubernetes/operators/pod.py,sha256=
|
|
36
|
+
airflow/providers/cncf/kubernetes/operators/pod.py,sha256=mYLAAwrNnvKIbhaFB27fG_l0dXo4ahvrPttcTKiWY0I,67989
|
|
37
37
|
airflow/providers/cncf/kubernetes/operators/resource.py,sha256=NHU8LtC1B8mq9V6SgIwo1GWZREtmC1-plQb1DALpmCc,7506
|
|
38
38
|
airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py,sha256=9DZnzju7KMXN9SG4JgHEKUAaxKXmR-XyImgN-GnIDnU,16513
|
|
39
39
|
airflow/providers/cncf/kubernetes/pod_template_file_examples/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
@@ -48,16 +48,16 @@ airflow/providers/cncf/kubernetes/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft
|
|
|
48
48
|
airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py,sha256=BGB5HzaSU1w1bDN3QnopiyJ_M-Gz2_QEwcCpOPfTS9g,5331
|
|
49
49
|
airflow/providers/cncf/kubernetes/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
50
50
|
airflow/providers/cncf/kubernetes/triggers/job.py,sha256=_lLP6ZYRV4kdwb7U0w5QFnlY1E9deZ5wtg-nrlfl6-8,7505
|
|
51
|
-
airflow/providers/cncf/kubernetes/triggers/pod.py,sha256=
|
|
51
|
+
airflow/providers/cncf/kubernetes/triggers/pod.py,sha256=KGyQS-jNXdyUUJw9waBRpbr7lKF1j5KPmNrbOf91_8I,15290
|
|
52
52
|
airflow/providers/cncf/kubernetes/utils/__init__.py,sha256=ClZN0VPjWySdVwS_ktH7rrgL9VLAcs3OSJSB9s3zaYw,863
|
|
53
53
|
airflow/providers/cncf/kubernetes/utils/container.py,sha256=tuhWyMZrqCGDUT4kzwjhEgJrr0JvD9lMXbFeuMDoh-4,4813
|
|
54
54
|
airflow/providers/cncf/kubernetes/utils/delete_from.py,sha256=poObZSoEJwQyaYWilEURs8f4CDY2sn_pfwS31Lf579A,5195
|
|
55
55
|
airflow/providers/cncf/kubernetes/utils/k8s_resource_iterator.py,sha256=pl-G-2WhZVbewKkwmL9AxPo1hAQWHHEPK43b-ruF4-w,1937
|
|
56
56
|
airflow/providers/cncf/kubernetes/utils/pod_manager.py,sha256=sk09s55ggGTnjlv1K1ZLgWc49CS8Rq5Lixsqc_nG3Ds,45853
|
|
57
57
|
airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py,sha256=k6bdmVJ21OrAwGmWwledRrAmaty9ZrmbuM-IbaI4mqo,2519
|
|
58
|
-
apache_airflow_providers_cncf_kubernetes-10.12.
|
|
59
|
-
apache_airflow_providers_cncf_kubernetes-10.12.
|
|
60
|
-
apache_airflow_providers_cncf_kubernetes-10.12.
|
|
61
|
-
apache_airflow_providers_cncf_kubernetes-10.12.
|
|
62
|
-
apache_airflow_providers_cncf_kubernetes-10.12.
|
|
63
|
-
apache_airflow_providers_cncf_kubernetes-10.12.
|
|
58
|
+
apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info/entry_points.txt,sha256=ByD3QJJyP9CfmTYtpNI1953akD38RUDgpGXLaq9vpOw,111
|
|
59
|
+
apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
|
60
|
+
apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info/licenses/NOTICE,sha256=_cWHznIoUSbLCY_KfmKqetlKlsoH0c2VBjmZjElAzuc,168
|
|
61
|
+
apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
62
|
+
apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info/METADATA,sha256=2mllqfPqucV8Aihg0UFXxZCc7ESWgEBP4sO4M0-teY4,5834
|
|
63
|
+
apache_airflow_providers_cncf_kubernetes-10.12.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|