Comments (9)
Great - I need this functionality so I'll push a new PR with these changes. Should it also support annotations? That's the only other metadata attribute that looks like it might be useful at this stage.
from hera.
@flaviuvadan Is this as simple as adding a labels attribute to the Task, Workflow and CronWorkflow objects and passing it through to the V1ObjectMeta? I'd be happy to take this as I could really use label support for my application.
from hera.
@bobh66 that is correct! The way I think about this is presenting a simple interface to users so they can set an arbitrary mapping labels: Dict[str, str] = {}
on a workflow object, which then propagates the labels to the tasks! I'd be excited for your contribution 🙂 and thank you for the other PRs you have submitted thus far!
from hera.
I think it'd be fine if your PR only supported labels
for now. The annotation support could come in a future PR (and use your PR as an example)
from hera.
I don't see a way to label Tasks as they don't have V1ObjectMeta objects. It appears that we can support labels for Workflows, CronWorkflows and Volumes (the PVC gets the label).
from hera.
I don't see a way to label Tasks as they don't have V1ObjectMeta objects. It appears that we can support labels for Workflows, CronWorkflows and Volumes (the PVC gets the label).
The Task
template has a field called metadata that takes a V1alpha1Metadata
! 🙂 That object has these OpenAPI types on it:
openapi_types = {
'annotations': 'dict(str, str)',
'labels': 'dict(str, str)'
}
Perhaps we can instantiate an empty V1alpha1Metadata
on the Task
and then set the labels
on it through the Workflow
/CronWorkflow
?
from hera.
I think it'd be fine if your PR only supported
labels
for now. The annotation support could come in a future PR (and use your PR as an example)
I will echo what @dmerrick mentioned here 🙂 Let's release these in separate PRs so we (1) keep PRs small (easy to review and add tests for), and (2) incrementally add features (opportunity to write an Issue to for a well-defined use case)!
from hera.
OK - I'll work on this as soon as the timezone patch is merged so I don't have a merge conflict with the version file.
Do we want each Task to inherit the labels of the workflow? Or should each Task be able to have it's own labels? I assume the latter. Thanks
from hera.
Do we want each Task to inherit the labels of the workflow? Or should each Task be able to have it's own labels? I assume the latter. Thanks
I think the default behavior of Argo is if a workflow specified labels, they are applied to all tasks and tasks have the ability to overwrite those labels. So, I agree with what you mentioned - the latter option seems like the way to go! 🙂
from hera.
Related Issues (20)
- Help needed: logo for Hera! 🚀 HOT 2
- Examples are not working properly HOT 1
- Support Optional/Union types in script runner
- Allow `get_parameter` usage on `TemplateRef` steps/tasks
- Hera's token handling feels a bit awkward HOT 2
- Script decorator breaks type hints
- Add LocalVolume to supported volume types HOT 2
- Incompatible with pydantic 1.10.15 HOT 2
- Dependabot commits making commit history noisy HOT 2
- Runner IO (RunnerOutput) misbehaves for artifacts HOT 2
- with_param has reverted back to ignoring kwargs HOT 1
- HEP0001 - new script decorator
- HEP0001 - new DAG decorator
- HEP0001 - new Steps decorator
- HEP0001 - TemplateSets
- Allowing extra information to Parameter/Artifact HOT 2
- Add governance and membership pathway documentation
- HEP0001 - new container decorator
- HEP0001 documentation
- Workflow parameter interpolation issue in WorkflowTemplates HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hera.