can I skip this step if I run this in my flow .py ...
# prefect-community
e
can I skip this step if I run this in my flow .py ?
n
Hi @Eric - yes! Those are two variations of the same command, one for programmatic registration and the other for Cli registration
e
ah great okay thank you. is it safe to just keep the registration in the flow.py and then I guess do git commit, push, then run the ptyhon code (thus registering the flow)?
n
Yup, that should be fine 👍
e
thank you for answering ona weekend!
are you familiar with the github storage backend?
n
Yup, so long as the structure of your flow doesn’t change, you won’t need to reregister with intra-task code changes.
e
any thoughts why my flow just stays in the flow run scheduled state?
i'm now, this is my first flow, running on cloud version with github backend
i set up my secret and am usign the storage like this:
flow.run() runs fine locally
agent is running on EKS, seems fine
but not picking up the job, just stuck in scheduled state
n
Definitely - what are the labels attached to your flow? You can see these from the details tile on the Flow page.
e
n
There it is - go ahead and remove that github-flow-storage label
For an agent to pick up any given flow, it must have all of the labels of that flow
e
is it bad practice to not use labels at all? also how did this label get set? i didnt set it
also how can you set the Agent's label?
n
Not bad practice at all - labels are a way of organizing flows and separating environments, and as such they're completely optional. This one was set because certain storage and environments automatically set labels on registration.
e
can i override that so it defaults to None?
n
You can set labels on your agent using the
--l
flag: you can view all the agent options here: https://docs.prefect.io/api/latest/cli/agent.html#agent
e
so my agent will pick it up?
n
You can just remove it from the flow page and your agent should pick it up
e
going forward can i set the label to None in code so I dont have to remember to remove the label manually in the UI?
ah okay they are running now after I removed the filter
I tried setting th elabel to None, but still passing github-flow-storage when registering
i set up another agent with this label
so workaround for now, let me know if you have a way to set the labels to None when registering a flow using Github storage 🙂 thank you!!
n
Hi @Eric - sorry for the delay here! You can remove default labels by passing
add_default_label=False
to your storage call, like this:
Copy code
flow.storage = GitHub(
    repo="some_repo",
    path="flows/my_flow.py",
    secrets=["github_token"],
    add_default_labels=False,
)