F

Flyte enables you to build & deploy data & ML pipelines, hassle-free. The infinitely scalable and flexible workflow orchestration platform that seamlessly unifies data, ML and analytics stacks. Explore and Join the Flyte Community!

Workflow Labels and Annotations Request

Summary

The user is asking about setting workflow labels and annotations for the default launch plan in Flyte through code, having faced an error indicating that only named launch plans can have additional properties. They prefer not to create a new launch plan with labels to keep the user experience simple. The user mentions that labels are only supported on the default launch plan and discusses the reasons for this limitation, such as challenges in natural specification and the need for consistency. They suggest that it would be helpful to have an argument in the @workflow decorator to specify labels directly in the workflow definition and propose creating an issue for this suggestion.

Status
resolved
Tags
    Source
    #ask-the-community
      y

      ytong

      9/25/2024

      i remember the thinking was it wasn’t pure… like the workflow decorator should only affect the workflow, not the launch plan. but I think it’s the right time to revisit that, and maybe be more flexible about it, esp since we already extract out default args to the workflow into the default launch plan as well.

      s

      swarup

      9/25/2024

      will do!

      y

      ytong

      9/25/2024

      mind making an issue for this?

      s

      swarup

      9/25/2024

      yeah that makes sense - for us we would love to specify it somewhere in the workflow definition itself so I'd hope the isolation point would hold there

      s

      swarup

      9/25/2024

      something like an argument in the @workflow would be ideal!

      y

      ytong

      9/25/2024

      iirc there were multiple reasons, not sure how strict they are today. one was because it was difficult to find a natural way to specify it. How would you like to specify it? (like what syntax?) Also there may have been the thought that the default launch plan should be create-able in isolation, with only the workflow definition - if the backend created a default launch plan and flytekit created one, they should be identical.

      d

      david.espejo

      9/25/2024

      <@U04UAHP1WNA> unfortunately that seem to be the case, after looking at the <https://github.com/flyteorg/flytekit/blob/b6f30e6165e2d1d88cb939db865c3473311d6273/flytekit/core/launch_plan.py#L238-L254|relevant code> it seems like labels are only supported on the default launchplan. Not exactly sure why

      s

      swarup

      9/24/2024

      creating a new launch plan with the label (that isn't the default plan) isn't ideal since users now have to explicitly switch the launch plan when launching the workflow

      s

      swarup

      9/24/2024

      hey sorry for the delay here! so I tried that but I got this error: ValueError: Only named launchplans can be created that have other properties. it seems like we're not able to add labels to the default launch plan, only explicitly named ones

      s

      swarup

      9/20/2024

      :wave: is there any way to set <https://docs.flyte.org/en/latest/user_guide/productionizing/workflow_labels_and_annotations.html|workflow labels/annotations> for the <https://docs.flyte.org/en/latest/flyte_fundamentals/tasks_workflows_and_launch_plans.html#launch-plans|default launch plan> created during registration?

      s

      swarup

      9/20/2024

      if we could set it when we define the workflow in code that would be ideal!