-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix 'do_xcom_push' and 'get_logs' functionality for KubernetesJobOperator #40814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
39e1ebc to
8f101ae
Compare
|
Hi @romsharon98 and @amoghrajesh ! can you please check changes here? Thanks! |
|
Hi @romsharon98, @amoghrajesh @potiuk @eladkal @hussein-awala ! |
|
Not working on GKE Autopilot. Need to set get_logs=False. ERROR - Task failed with exception |
| if self.pod is None: | ||
| self.pod = self.get_or_create_pod( # must set `self.pod` for `on_kill` | ||
| pod_request_obj=self.pod_request_obj, | ||
| context=context, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work if the pod wasn't already created by the time this is reached? Won't 2 pods eventually get created (when the job eventually creates the pod)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same question. I thought the K8s Job will manage the pod creations, why would we need creating the pod manually again? I'm actually running into bugs where I set parallelism to more than 1 and this line triggers self.find_pods() which triggers
airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py
Line 563 in 56fbe90
| raise AirflowException(f"More than one pod running with labels {label_selector}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@steinwaywhw can you explain your problem more? Would you like to take a stab at fixing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @steinwaywhw,
It's a known issue #44994 and the fix was already prepared by this PR #49899
In this PR I have fixed usage for
do_xcom_pushandget_logsfunctionality forKubernetesJobOperatorin deferrable and non-deferrable modes.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.