flyteorg / flyte

Scalable and flexible workflow orchestration platform that seamlessly unifies data, ML and analytics stacks.
https://flyte.org
Apache License 2.0
5.65k stars 626 forks source link

[BUG] missing button to rerun subworkflow #5852

Open marcellomonachesi-tomtom opened 1 hour ago

marcellomonachesi-tomtom commented 1 hour ago

Describe the bug

I don't know if this is by design, but the "Rerun Task" button doesn't appear in the sub-workflow. It appears in the parent workflow: image

But it doesn't appear in the sub-workflow: image

If this is by design, how to structure the workflow to relaunch a dynamic sub-workflow?

Use case: the "multiple" (dynamic) workflow launches many "single" (dynamic) workflows. The "single" workflow is independent from the others. If one single workflow fails others should continue. Then we would like to relaunch the failed single workflow. The "recover" function doesn't work for this use case. Please check the example code below.

Expected behavior

The UI provides a button to relaunch the subworkflow.

Additional context to reproduce

This is the example to replicate the issue:

from flytekit import (
    task,
    dynamic,
    Resources,
)
import typing

def get_resources() -> dict:
    # This is hardcoded but should be loaded from a file
    return {"job_a": {"cpu": "1", "mem": "1Gi"}, "job_b": {"cpu": "2", "mem": "2Gi"}}

@dynamic
def multiple(jobs: typing.List[str]):
    resources = get_resources()
    for job in jobs:
        single(job=job, resources=resources[job])

@dynamic
def single(job: str, resources: dict):
    process(job=job).with_overrides(
        requests=Resources(cpu=resources["cpu"], mem=resources["mem"])
    )
    # other tasks...

@task
def process(job: str):
    print("Process job", job)

Screenshots

No response

Are you sure this issue hasn't been raised already?

Have you read the Code of Conduct?

welcome[bot] commented 1 hour ago

Thank you for opening your first issue here! 🛠