not to rant, but Prefect’s web app is by far the m...
# ask-community
m
not to rant, but Prefect’s web app is by far the most frustrating part about using prefect, and is one of the most frustrating tools i’ve ever worked with. trying to restart a flow and the restart pop-up just hangs indefinitely. no error anywhere, including in the console. I’ve tried going through incognito and using a different browser but i get the same thing. a basic REST API that just worked reliably would be such a better alternative to a GUI that doesn’t work half the time.
a
I can share this with the UI team. But in general, if you have any issues with Prefect, you can always open a Github issue. Also providing more details about what Prefect version do you use, how does your flow in question look like (e.g. which Results do you use, which agent is this running on), etc would make it easier to reproduce and solve the issue.
m
thanks Anna. we’re using prefect 0.15.6, and this is a flow of flows which is fairly straightforward, this is essentially the entire thing:
Copy code
from prefect import Flow
from prefect.engine.results import PrefectResult
from prefect.executors import LocalDaskExecutor
from prefect.schedules import Schedule
from prefect.schedules.clocks import CronClock
from prefect.tasks.prefect import StartFlowRun
from prefect.utilities.notifications import slack_notifier

from pdl.common.config.env import get_stage
from pdl.core_compute.prefect.flows.shared import terminate_on_cancel

person_build_flow = StartFlowRun(flow_name="person-build", project_name=get_stage(), wait=True)
release_flow = StartFlowRun(flow_name="release", project_name=get_stage(), wait=True)
company_insights_flow = StartFlowRun(flow_name="company-insights", project_name=get_stage(), wait=True)
autocomplete_flow = StartFlowRun(flow_name="autocomplete", project_name=get_stage(), wait=True)

with Flow(
    "build-then-release",
    executor=LocalDaskExecutor(num_workers=8),
    result=PrefectResult(),
    schedule=Schedule(clocks=[CronClock("0 6 14-20 * 1", day_or=False)]),
    state_handlers=[slack_notifier, terminate_on_cancel],
) as flow:
    RELEASE_FLOW_IS_COMPLETE = release_flow(upstream_tasks=[person_build_flow], parameters={"is_development": "false"})
    company_insights_flow(upstream_tasks=[RELEASE_FLOW_IS_COMPLETE])
    autocomplete_flow(upstream_tasks=[RELEASE_FLOW_IS_COMPLETE])
in this particular case, i had started the flow and it failed during the first subflow. I finished the subflow separately and then marked it as successful, and when trying to restart the flow of flows i get this. i will say that the difficulty in reproducibility is precisely what makes this frustrating: I had an identical issue yesterday where I was unable to restart a regular flow (the first subflow) for the same reason, and I eventually asked a co-worker if he was able to give it a try, and it worked for him on his first try. (i saw the flow immediately update from failed to scheduled after he restarted the flow, and no amount of refreshing would change the state when I was trying to restart it)
a
Prefect UI seems to like Evgeny more than you 😂 Jokes aside: In the current Prefect, subflows are actually super hard to restart because flows don’t return anything and the entire restart functionality is built for tasks rather than flows. I would honestly recommend either rerunning the whole parent flow (starting a new flow run rather than restarting) or restarting individual subflows one by one. This should work fine. Having said that, Orion (Prefect 2.0) is a game changer for subflows - it will be much easier to restart flow runs with subflows in Orion. Feel free to have a look at Orion subflows (here is a

video

) and give us feedback.
😅 1
m
yeah, we’ve noticed that flows of flows seem rather half-bakes currently so I’ve been generally avoiding using them for now. the issue in this case happened in a flow of flows, but it’s happened in regular flows in the past (though i don’t remember it being so stubborn to restart, usually reloading the page and clicking the restart button 2-3 times tends to get things going) Orion can’t come soon enough, especially because flows of flows was one of the deciding factors in use choosing to go with prefect over alternatives. is orion ready for use yet? what does/will the upgrade process look like?
a
Orion will be production ready next year and there will be a migration guide. I wouldn’t be as critical saying that our subflows are half baked - only retries are a bit challenging. Imho Prefect has the best implementation of subflows that is currently out there (at least in the Python/open-source scene). I could point you to some blog posts if you’re interested. btw, did you know that we have a bit more recent implementation of subflows? the tasks are called create_flow_run, wait_for_flow_run and get_task_results. It’s discussed in those blog posts: • https://www.prefect.io/blog/prefect-0-15-0-a-new-flow-run-experience/https://www.prefect.io/blog/flow-of-flows-orchestrating-elt-with-prefect-and-dbt/https://www.prefect.io/blog/orchestrating-elt-on-kubernetes-with-prefect-dbt-and-snowflake-part-2 e.g. this allows you to see child flow run logs directly in the parent flow - wait_for_flow_run(stream_logs=True, raise_final_state=True)
👀 1
m
thanks, i’ll take a look at the new implementation. does it work better with flow restarts?
a
I haven’t tested it yet with restarts