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

Christian Nuss

03/14/2022, 6:20 PM
Hey there again everyone! Hopefully a quick question about doing a
create_flow_run.run(flow_name="flow-2")
within a task created by a
KubernetesRun
... assuming i have
Copy code
with Flow("flow-1", run_config=KubernetesRun(...)):
  ... creates task that does a create_flow_run.run(flow_name="flow-2") ...
should
flow-2
receive/inherit the
run_config
from
flow-1
?
k

Kevin Kho

03/14/2022, 6:21 PM
There is no RunConfig inheritance. It has to be defined on the subflow, but I think you can explicitly pass a new RunConfig as well if you want. It’s more common though to pass parameters down to link the parent and child
create_flow_run
can take in a RunConfig here
c

Christian Nuss

03/14/2022, 6:22 PM
thanks @Kevin Kho then thats what i experienced and wanted to make sure i wasn't crazy or doing something wrong! also: your response time for questions here is on point!
upvote 1
👍 1
k

Kevin Kho

03/14/2022, 6:23 PM
Thank you!
w

William Grim

03/14/2022, 6:28 PM
@Kevin Kho in this case, “flow-2” would also have been defined, registered, and serialized with a KubernetesConfig. i think @Christian Nuss was seeing that it wasn’t working though? i.e. the labels defined in the flow being called from the first KubernetesRun weren’t set
i worded that awkwardly. let me rephrase
I believe he was seeing that the registered flow, which was being called by the first flow, which was instantiated as a KubernetesRun, wasn’t getting its run_config labels set on it when it was instantiated, even though it’s defined in the flow itself. Is that right @Christian Nuss?
still awkward, but hopefully less so…
c

Christian Nuss

03/14/2022, 6:29 PM
right correct as @William Grim said, we have a
with Flow("flow-2", run_config=KubernetesRun(...)):
registered
k

Kevin Kho

03/14/2022, 6:32 PM
Ah ok so you have a subflow registered with KubernetesRun but it doesn’t seem respected? What do you see when you go to the Flow page in the UI? There should be a space for RunConfig and labels?
c

Christian Nuss

03/14/2022, 6:32 PM
1 sec, standby...
😂 1
strange its adding a nonsense label
so its not getting scheduled
k

Kevin Kho

03/14/2022, 6:37 PM
Ah ok before you register, you can do:
Copy code
flow.storage.add_default_labels = False
and then try re-registering.
Wait so you have pending runs but the create_flow_run is working right?
c

Christian Nuss

03/14/2022, 6:38 PM
create_flow_run does appear to be working, as the new sub-flow gets registered and the run config looks correct! so just a labeling issue
k

Kevin Kho

03/14/2022, 6:39 PM
Gotcha yeah just remove the default label and I think this should be good. What storage are you using though? Normally the default label is attached to local storage
c

Christian Nuss

03/14/2022, 6:42 PM
i made some hackery in this case with volume mounts for Local Development purposes
k

Kevin Kho

03/14/2022, 6:42 PM
Ohhh yes ok that sounds good and you can turn off the default label that is part of Local storage
c

Christian Nuss

03/14/2022, 6:44 PM
🚀
worked like a charm, thx!
👍 3
in Production we will use S3 Storage + Kube, do you think i should add the
add_default_labels=False
there too? (feels like i should for consistency)
w

William Grim

03/14/2022, 6:57 PM
@Christian Nuss i believe the “nonsense label” is your instance’s “hostname”
upvote 1
a

Anna Geller

03/14/2022, 7:17 PM
no need for add_default_labels when using S3 storage - it's only applied when using local storage and William is correct, this cac0475... is the hostname of your machine 🙂
3 Views