Hi Experts, any idea why this code cannot trigger ...
# prefect-server
a
Hi Experts, any idea why this code cannot trigger "Quick run" via Prefect UI? this job stays
scheduled
forever without getting triggered, , any idea?
Copy code
import prefect
from prefect.tasks.shell import ShellTask
from prefect import task, Flow

task = ShellTask(helper_script="cd /prefect")

with Flow("ShellScriptTest") as f:
    mv_file = task(command='cp -rf /prefect/test.py /prefect/kubernetes/')

out = f.register(project_name="ShellScriptTest")
This is how UI looks
what's missing in my code?🤔
But this code works fine locally when used
f.run()
never see job gets deploying at agent console also
d
Hi @Ajith Kumara Beragala Acharige Lal! Have you started an agent?
a
Yup... @Dylan, except those scripts with ShellTask..others work fine
These jobs with no
ShellTask
d
Great! The next step is to make sure that your Flow’s labels match your agent’s labels
a
d
Does that Flow have any labels on it? Do your agents?
a
ahaa.. those that DON"T works has a label
not sure how it was automatically got the label
don't remember setting labels
@Dylan ^^
@Dylan thanks
d
Removing the label should work 👍
Anytime!
j
Where do these labels come from? I started a flow run from the CLI and it was given my machine's hostname as a label. The Agent is configured with no labels. How do you turn labels off?
Here are the docs on labels
j
I saw that, but it doesn't say anything about Prefect adding labels that I didn't explicitly configure.
My best guess is that what I'm seeing is this: https://github.com/PrefectHQ/prefect/issues/2653
d
If you register your Flow without configuring storage, the Flow code is only present on one machine (yours) so Prefect gives a label to your Flow so that other agents don’t pick up the Flow Runs that they’re unable to execute
j
That's what the issue says. The documentation is silent on this.
d
We are always open to documentation patches and contributions! 😄
j
Point me to the documentation source and I'll make a PR.
At least, I assume the documentation on the website must be generated from that.
Does the Local Agent automatically use the hostname label, or does it have to be explicitly told to use it?
d
hmm I am not sure
j
Thanks.
d
Anytime!
j