https://prefect.io logo
#prefect-server
Title
# prefect-server
a

Ajith Kumara Beragala Acharige Lal

01/11/2021, 11:56 AM
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

Dylan

01/11/2021, 3:29 PM
Hi @Ajith Kumara Beragala Acharige Lal! Have you started an agent?
a

Ajith Kumara Beragala Acharige Lal

01/11/2021, 3:30 PM
Yup... @Dylan, except those scripts with ShellTask..others work fine
These jobs with no
ShellTask
d

Dylan

01/11/2021, 3:31 PM
Great! The next step is to make sure that your Flow’s labels match your agent’s labels
a

Ajith Kumara Beragala Acharige Lal

01/11/2021, 3:31 PM
d

Dylan

01/11/2021, 3:32 PM
Does that Flow have any labels on it? Do your agents?
a

Ajith Kumara Beragala Acharige Lal

01/11/2021, 3:34 PM
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

Dylan

01/11/2021, 3:40 PM
Removing the label should work 👍
Anytime!
j

Jeremy Phelps

01/11/2021, 7:37 PM
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

Jeremy Phelps

01/11/2021, 8:27 PM
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

Dylan

01/11/2021, 8:28 PM
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

Jeremy Phelps

01/11/2021, 8:28 PM
That's what the issue says. The documentation is silent on this.
d

Dylan

01/11/2021, 9:34 PM
We are always open to documentation patches and contributions! 😄
j

Jeremy Phelps

01/11/2021, 9:35 PM
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

Dylan

01/11/2021, 10:01 PM
hmm I am not sure
j

Jeremy Phelps

01/11/2021, 10:03 PM
Thanks.
d

Dylan

01/11/2021, 10:06 PM
Anytime!
j

Jeremy Phelps

01/11/2021, 10:08 PM
2 Views