-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
KubernetesPodOperator new callbacks and allow multiple callbacks #44357
Conversation
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.
Good start!
Can you add few test cases that test more scenarios of more than 1 callback?
- Few sync callbacks
- Few async
- Combination of both - trying to assert for order
Some static checks to solve after rebase |
Note: We are in the process of moving all providers to a new structure - as part of #46045 so if you would like to avoid having to resolve conflicts, speedy fix and rebase is something that you might want to do @johnhoran |
See also devlist announcement: https://lists.apache.org/thread/dzbj5yx5kwpbwyr5yscp4wnlsp6p9v8l |
I fixed the static checks but the PR has conflicts @johnhoran can you please revase and resolve them? |
Failures are on papermill provider, not related to this PR |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Yep. already fixed in main |
I would like to have multiple callbacks in the kubernetes pod operator, and add two new callbacks.
on_manifest_finalization
would allow the callback to make changes just before the manifest is turned into a pod.on_pod_wrapup
would happen after the calls toon_pod_completion
but just before the pod is deleted.Adding both of these plus allowing multiple callbacks would allow you to do things in the kubernetes pod operator akin to how it approaches XComs but in a modular way. My use case here is I'm running DBT in kpo, and I want to do multiple things to the DBT artefacts after the DBT job has run, I could use
on_manifest_finalization
to insert an alpine sidecar with volumes mounted with the same intention as the XCom sidecar, where the sidecar keeps the volumes alive as files are extracted from it.on_pod_wrapup
would allow me to insert a single sidecar and have multiple callbacks run theiron_pod_completion
beforeon_pod_wrapup
kills the sidecar.