merlin
01/16/2024, 6:24 PMMarvin
01/16/2024, 6:25 PMprefect deployment
CLI command and its options, or even reaching out to Prefect's community support for guidance on how to achieve concurrency control that meets your specific needs.
If you would like, I can continue to search for a more definitive answer within Prefect's documentation or by searching through Prefect GitHub issues for similar problems and solutions. Would you like me to do that?merlin
01/16/2024, 6:34 PMNate
01/16/2024, 6:42 PMmerlin
01/16/2024, 7:21 PMmerlin
01/16/2024, 7:23 PMmerlin
01/16/2024, 7:25 PMconcurrency = 1
. But the deployment starts multiple flows as part of async TaskGroup, which is desired. Will the work-pool concurrency then force those subflows to run sequentially?Nate
01/16/2024, 7:40 PMrun_deployment
calls?
starts multiple flows as part of async TaskGroup
Nate
01/16/2024, 7:41 PMmerlin
01/17/2024, 2:46 AM@flow
async def run_from_spec(deployment_list):
async with asyncio.TaskGroup() as tg:
flow_runs = []
for deployment in deployment_list:
task = tg.create_task(
run_deployment(
name=deployment.get('slug')
, parameters=deployment.get('params')
, tags=tag_from_deploy_object(deployment)
, timeout=TIMEOUT_SECONDS
)
)
await asyncio.sleep(1)
flow_runs.append(task)
merlin
01/17/2024, 3:07 AMrun_from_spec
deployment from starting several identical jobs simultaneously after a failure on the server where the agent/work-pool is running. This has happened once recently and I cant find the obvious way to manage this.
The deployment_list
is a list of many deployments that should be run in parallel, so the concurrency limited work-pool is an incomplete solution.