Dzmitry Aliashkevich
02/08/2023, 3:24 PMHaotian Li
02/08/2023, 4:07 PMGeorge Coyne
02/08/2023, 7:22 PMKyle McChesney
02/08/2023, 7:39 PMGeorge Coyne
02/08/2023, 7:41 PMDzmitry Aliashkevich
02/09/2023, 7:38 AMcreate_flow_run
so, it allows to implement some form of round-robin, Iāve ended up with assigning additional unique labels for each agent, and when creating flow run - just randomly pick one of it and add to default labels list, something like:
@task()
def process_flow_batch():
default_labels = ["ec2", ... ]
agent_specific_labels = ["agent1", ... ]
flow_update_batch = create_flow_run.run(
flow_name="some_flow_name",
project_name="some_project_name",
labels=default_labels.append(agent_specific_labels[random.randint(0, len(agent_specific_labels) - 1)]
)
wait_for_flow_run.run(
flow_update_batch
)