cuddly-jelly-27016
04/21/2025, 11:23 AMpyflyte run --labels ... --annotations ...
This applies the metadata to all K8s objects in a flyte workflow execution, including task pods and task CRD objects. However, this mechanism doesn't work on an individual task level.
## What changes were proposed in this pull request?
As a Flyte user, I would like to be able to specify specific labels/annotations for individual k8s task CRD objects like pytorch jobs, ray job, ... (the same way I already can today for pods via the pod template). For this aim, the following arguments are added to the task decorator:
@task(
labels=...,
annotations=...,
)
def test_task():
...
These labels and annotations are added to the object metadata of the object executing the task (Pod or CRD object).
This PR adds a metadata field of type K8sObjectMetadata to the TaskMetadata proto message and applies this additional metadata in the plugin manager's addObjectMetadata function.
## How was this patch tested?
• Executed flyteadmin and flytpropeller with these changes and the corresponding changes in flytekit.
• Adapted unit tests
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
## Related PRs
flyteorg/flytekit#3243
### Summary by Bito
This pull request adds a new metadata field to the TaskMetadata proto, enabling users to apply custom labels and annotations to Kubernetes objects. The enhancement spans multiple language implementations including Go, TypeScript, Python, and Rust, providing more granular control over metadata for both pods and custom resources.
Unit tests added: False
Estimated effort to review (1-5, lower is better): 5
flyteorg/flytecuddly-jelly-27016
04/21/2025, 11:23 AMcuddly-jelly-27016
04/30/2025, 8:02 AM