Giter Site home page Giter Site logo

Comments (9)

bobh66 avatar bobh66 commented on May 23, 2024 1

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.

bobh66 avatar bobh66 commented on May 23, 2024

@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.

flaviuvadan avatar flaviuvadan commented on May 23, 2024

@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.

dmerrick avatar dmerrick commented on May 23, 2024

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.

bobh66 avatar bobh66 commented on May 23, 2024

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.

flaviuvadan avatar flaviuvadan commented on May 23, 2024

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.

flaviuvadan avatar flaviuvadan commented on May 23, 2024

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.

bobh66 avatar bobh66 commented on May 23, 2024

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.

flaviuvadan avatar flaviuvadan commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.