-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Make the launcher a cached_property and minor change to improve how pod name is retrieved #58646
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
Make the launcher a cached_property and minor change to improve how pod name is retrieved #58646
Conversation
…hange to improve how pod name is retrieved in spark_kubernetes.py, add unit tests
Nataneljpwd
left a comment
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.
Minor nitpicks, other than that seems good!
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py
Outdated
Show resolved
Hide resolved
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py
Outdated
Show resolved
Hide resolved
jscheffl
left a comment
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.
Thanks for the fix, looks good to me!
|
Adjusted title for better changelog, we do not use conventional commits. |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
…od name is retrieved (apache#58646) * fix(cncf-kubernetes): make the launcher a cached_property and minor change to improve how pod name is retrieved in spark_kubernetes.py, add unit tests * chore: use removesuffix to set self.name and job_name variables as suggested by @Nataneljpwd
…od name is retrieved (apache#58646) * fix(cncf-kubernetes): make the launcher a cached_property and minor change to improve how pod name is retrieved in spark_kubernetes.py, add unit tests * chore: use removesuffix to set self.name and job_name variables as suggested by @Nataneljpwd
…od name is retrieved (apache#58646) * fix(cncf-kubernetes): make the launcher a cached_property and minor change to improve how pod name is retrieved in spark_kubernetes.py, add unit tests * chore: use removesuffix to set self.name and job_name variables as suggested by @Nataneljpwd
launcherobject used to create and delete Kubernetes objects related to Spark.closes: #58228
related: #56291
This PR should fix the issues mentioned above by caching the
launcherobject being used to create and delete Kubernetes objects. Without this PR:reattach_on_restart=Trueis set, theself.launcheris never instantiated and so the error mentioned in the issues is raised.deferrable=True, the worker pod might get deleted while the job is deferred, and when the worker pod is used again to handle the deletion of the pod at the end, then the error mentioned in the issues is raised because theself.launcheris never instantiated.^ 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 airflow-core/newsfragments.