https://prefect.io logo
s

Samuel Hinton

02/04/2021, 12:46 PM
Hi all! Im very confused about labelling our flows and hopefully someone has an easy solution. My flows never get run because prefect attaches a label which is my machine name (see image). This label is attached regardless of the executor (local, local dask and dask all do it). My agent is not my machine, and thus does not have this label. Does anyone know what the label represents so I can figure out whats going on.
👀 1
For anyone curious, here is the code going into this task:
a

Amanda Wee

02/04/2021, 1:15 PM
From what I understand, this happens because you're using local storage. Since your agent is not local to where the local storage is at, you should use another storage option, otherwise the agent won't be able to get the flow.
g

Greg Roche

02/04/2021, 1:16 PM
The
Samuels-MacBook-Pro.local
label to me looks like the hostname of the machine from which the flow was registered. Flows which use
LocalStorage
automatically get a label with the hostname of the machine which registered the flow (can't find explicitly in the docs how to change this but here's a reference https://github.com/PrefectHQ/prefect/pull/2681 )
s

Samuel Hinton

02/04/2021, 1:18 PM
Ah okay, this makes sense, confusing that this isnt mentioned in the introduction doco at all. Ill read through the docs on storage and see if theres an easy solution so that I can run the hello-flow example externally. Any suggestions would be more than welcome!
Bam, found the auto label in the docs for this!
g

Greg Roche

02/04/2021, 1:22 PM
You should be able to pass
add_default_labels = False
to the LocalStorage constructor to prevent it from auto-applying the hostname as a default label:
Copy code
from prefect.storage import Local

with Flow("my_flow", storage=Local(add_default_labels = False)):
	# ...
❤️ 1
s

Samuel Hinton

02/04/2021, 1:23 PM
Beautiful, this should get me up and running a bit more before I configure an s3 bucket for em. Thanks Greg and Amanda
4 Views