Jason Kim
09/01/2021, 2:21 AMKevin Kho
Jason Kim
09/01/2021, 2:33 AMRunConfig
objects can be configured with zero or more labels. Labels can be used to determine which agent (or agents) can execute a flow; for an agent to receive a flow run to execute, the labels set on the agent must be a superset of those set on the RunConfig
.
For example, here we configure a flow with `labels=["dev", "ml"]`:
from prefect import Flow
from prefect.run_configs import LocalRun
# Configure a flow with a `dev` label
flow = Flow(
"example",
run_config=LocalRun(labels=["dev", "ml"])
)
Copied!
An agent running with labels=["dev", "staging", "ml"]
would be able to execute this flow, since the agent's labels are a superset of those on the flow. In contrast, an agent running with labels=["dev", "staging"]
would not, since the agent's labels are not a superset of those on the flow.Jason Kim
09/01/2021, 2:33 AMKevin Kho