Skip to content

More meaningful @task.kubernetes pod naming#46535

Merged
potiuk merged 2 commits into
apache:mainfrom
insomnes:task-k8s-pod-naming
Feb 8, 2025
Merged

More meaningful @task.kubernetes pod naming#46535
potiuk merged 2 commits into
apache:mainfrom
insomnes:task-k8s-pod-naming

Conversation

@insomnes

@insomnes insomnes commented Feb 6, 2025

Copy link
Copy Markdown
Contributor

Use name based on decorated python callable in @task.kubernetes pod name generation

  • generate attribute and metadata pod name based on decorated python callable
  • drop uuid usage as a random suffix in favor of random_name_suffix argument
  • add specific pod naming tests for decorator flow because the decorator distinguishes between name=None and no name argument provided

Re-implementation of the previous PR messed up by new providers structure rebasing
#46462

closes: #46464


^ 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.rst or {issue_number}.significant.rst, in newsfragments.

- use decorated `python_callable.__name__` as part of the name created for pod by default.
- drop `uuid` usage in favor of present `random_name_suffix` argument
@boring-cyborg boring-cyborg Bot added the provider:cncf-kubernetes Kubernetes (k8s) provider related issues label Feb 6, 2025
@insomnes

insomnes commented Feb 6, 2025

Copy link
Copy Markdown
Contributor Author

@RNHTTR I am sorry to bother you, but do you mind taking a look at the re-creation of the previous PR already approved by you? I've messed up a ton with rebasing for the new providers structure, so I've re-created it. Also, the CODEOWNERS file was broken at the moment, now this new PR is lost in limbo. Thank you!

The changes are the same, and now the tests are green after fixes in main.

@potiuk

potiuk commented Feb 8, 2025

Copy link
Copy Markdown
Member

Nice!

@potiuk potiuk merged commit 33c53d4 into apache:main Feb 8, 2025
@RNHTTR

RNHTTR commented Feb 10, 2025

Copy link
Copy Markdown
Contributor

Nice one @insomnes !

ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
* More meaningful default name for @task.kubernetes pods

- use decorated `python_callable.__name__` as part of the name created for pod by default.
- drop `uuid` usage in favor of present `random_name_suffix` argument

* Update task.kubernetes decorator doc-string
@insomnes insomnes deleted the task-k8s-pod-naming branch February 17, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More meaningful name for @task.kubernetes pods by default

3 participants