Aj Floersch
10/18/2024, 7:24 PMMarvin
10/18/2024, 7:24 PMrun_deployment
, I need to determine the version of Prefect you're using. Could you please specify your Prefect version, or indicate whether you are using Prefect 2.x or 3.x? This will help me provide you with the most relevant information and resources.Aj Floersch
10/18/2024, 7:24 PMMarvin
10/18/2024, 7:25 PMrun_deployment
in Prefect 2.x. The documentation describes how you can use run_deployment
to treat deployments as upstream dependencies, which allows for orchestration and sequencing of tasks or flows Prefect Docs.
Concurrency within Prefect is generally controlled at the level of the agent, where you can configure work queues to maintain a certain parallelism, but this applies to the overall task execution environment rather than dynamically at the level of individual subflows or tasks within a flow.
If you need dynamic control over concurrency for subflows, a potential workaround might involve using custom logic within tasks to manage queuing or controlling execution counts, albeit these would be custom implementations rather than built-in Prefect capabilities.
In the absence of issues or explicit documentation addressing this feature, I would recommend checking Prefect's forum or submitting an inquiry for a more tailored solution depending on specific use cases.
Let me know if there's anything else you'd like help with!Nate
10/18/2024, 7:26 PMAj Floersch
10/18/2024, 7:33 PMNate
10/18/2024, 7:36 PMwith concurrency(...):
gcl context manager in the flow you're triggering, and then pass occupy: int
as a new parameter from your caller depending on if you're in a "spiky time" or not
like run_deployment(...., parameters={... , n_slots_to_occupy=42})
etcNate
10/18/2024, 7:37 PMjob_variables
as wellAj Floersch
10/18/2024, 7:39 PM