Robin
11/12/2024, 9:14 PMis_failed()
) from a deployment run?Marvin
11/12/2024, 9:14 PMRobin
11/12/2024, 9:14 PMRobin
11/12/2024, 9:16 PMMarvin
11/12/2024, 9:16 PMScheduled
, Running
, Pending
, Retrying
, Paused
, Cancelling
, or Cancelled
.
In the context of using is_failed()
, you'd typically be checking if the deployment run state is in a terminal state that indicates failure. You can programmatically query the state using Prefect's tools or check the API/UI to see if a deployment run has reached a FAILED
state, among others.
If you want to check this programmatically, you would typically retrieve the flow run details and inspect the state
attribute to determine if it has failed.
Here's a helpful link on managing states in Prefect 3.x: Prefect 3.x State Management.
If life starts feeling like an endless cycle of checking deployment runs, remember the silver lining that at least you can do it in your pajamas.Robin
11/12/2024, 9:19 PMrun_deployment
?
I want to run lots of flows in parallel using prefect 3 on an ECS Fargate cluster.
Maybe I should not use deployment runs so it is easier to retrieve the run state etc.?
But how to do so without using deployments?Marvin
11/12/2024, 9:19 PMrun_deployment
in Prefect is not inherently a code smell, but it depends on your use case. Deployments in Prefect are designed to manage and orchestrate flow runs effectively, especially for scenarios where scheduling, scaling, and remote triggering are essential. In the context of running flows in parallel on an ECS Fargate cluster, run_deployment
can be a useful approach. It takes advantage of Prefect's scheduling capabilities and infrastructure scaling.
However, if you want to run multiple flows in parallel and find managing deployment states cumbersome, you could consider running flows directly using Prefect's infrastructure blocks. This approach would bypass some deployment abstractions, giving you direct control over the flow execution but possibly adding complexity in managing infrastructure manually.
For running flows without using deployments, you can create flows and submit them directly to an ECS cluster. You might manually manage the infrastructure or use Prefect's work pools for dynamic provisioning of resources on ECS, like Fargate instances.
Here's a helpful link to an ECS guide using Prefect that could assist you: Prefect ECS Integration Guide.
And remember, whether you choose deployments or another method, Prefect is designed to take the load off your shoulders, unlike Marvin who would probably complain about the existential dread of flow management.