Push to xcom before KubernetesPodOperator deferral - #34209
Merged
Conversation
vchiapaikeo
requested review from
hussein-awala and
jedcunningham
as code owners
September 8, 2023 12:30
vchiapaikeo
force-pushed
the
vchiapaikeo/k8s-def-xcom-v1
branch
from
September 8, 2023 12:32
66c0927 to
1efa1d3
Compare
vchiapaikeo
force-pushed
the
vchiapaikeo/k8s-def-xcom-v1
branch
from
September 8, 2023 12:35
1efa1d3 to
cc7e2ea
Compare
Contributor
Author
|
@hussein-awala , @eladkal - thoughts on this when you have a moment please. This would help us out a lot on the observability front when moving KPO to deferrable mode and streaming logs of in flight pods. |
Member
|
FYI, I'm working on loading the logs in async mode without waiting for pod termination, it will be possible soon. |
Contributor
Author
KubernetesPodOperator deferral
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, deferrable KPO will not allow users to see logs of the underlying base container until completion (even with get_logs=True). This is because logs are not streamed until the trigger event successfully fires and execute_complete is called. What's worse is that we do not know what the pod_name or the pod_namespace is until execute_complete is called as well. With synchronous KPO, this happens immediately after get_or_create_pod is called. We should do the same with the deferrable flow. Therefore, users can add extra_links to the KPO (retrieving pod_name and pod_namespace from xcom) and stream in-flight logs from their monitoring tool of choice (for us, it is Cloud Monitoring because we use GKE).
This moves the xcom_push calls up to execute_async. To test, I used this dag and observed xcom appear during deferral state.
^ 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.