Hi there folks, how you doing? Could you share so...
# ask-community
g
Hi there folks, how you doing? Could you share some tips or recommended practices to use shared tasks within flows? I'm using
Github Storage
+
KubernetesRun
and I'm not sure of how to handle this in an elegant way. Should I structure my project as a python package and
pip install -e .
inside a Dockerfile? I want to use tasks/functions defined at
/tasks
on my flows to avoid repetition.
Copy code
my-happy-project/
├── flows/
│   ├── flow_1.py
│   └── flow_2.py
│
└── tasks/
    ├── shared_stuff_1.py
    └── shared_stuff_2.py
k
Hey @Gabriel Montañola , using
pip install -e .
sounds good but I think you would need to build the Docker container again anyway if stuff under
/tasks
gets edited. Also just remember to re-register when you change the flow in Github. Any reason why you’re not considering using Docker Storage?
Checked with the team and this is the preferred setup. Ignore me mentioning Docker Storage. Here is a sample repo
g
thanks Kevin. I'll try this 🙂 And congratz on the presentation yesterday!
👏🏼 1
k
Thank you!
g
I was going to ask you about the code for the examples used but... https://github.com/kvnkho/demos/blob/main/meetups/coiled-webinar/kv-coiled.py
😄
thanks a bunch!
k
Yeah I don’t really include this because it’s not easy to reproduce as you need a Coiled account and aws credentials configured, but do feel free to ask questions.
👍🏼 1
👍 1
g
Just an update: Everything is working as intended, I just tweaked the
Dockerfile
a little bit because I was using Poetry. The only thing "missing" is the possibility to deactivate schedule via the CLI. I want to focus on using the CLI instead of calling the API inside the flows :)
Thanks once again for the help! Prefect is awesome to work with and the community plays an important role!
k
Good to hear and feel free to +1 or chime into that issue.
g
@Kevin Kho I think I can tackle this issue. I have no experience with GraphQL but I was playing with the
register
command in the CLI and just adding
set_schedule_active
argument to be passed as
input
for the query works just fine! 🙂
k
Yeah why don’t you comment on that issue and take it? That would be great!
g
I was doing this right now! Thanks!