Hello guys. I am new to Prefect. My question is, h...
# ask-community
a
Hello guys. I am new to Prefect. My question is, how can I test my flow without even I need to
git push
first and then
prefect deployment run
? At the moment, what I know, I need to
git push
any update first, before I can
prefect deployment run.
If possible, I just want to try run my flow first without git push to my Github repo. Is this possible? Or this is the nature of Prefect where I need to
git push
first to try deploy?
n
hi @Ammar you can always just call your flow directly for example
Copy code
import sys
from prefect import flow

@flow
def foo(): ...

if __name__ == "__main__":
  if len(sys.argv) == 1:
    foo()
  elif sys.argv[1] == "deploy":
    foo.from_source(...).deploy(...)
python filename.py
will run the flow
python filename.py deploy
will deploy the flow
a
How can I trigger the flow but trigger it using my local code, not from Github? Currently when I ran
prefect deployment run 'main-flow/rapid-deployment'
, it will take my code from my remote repo, not my local. I want it trigger from my local code.
The source arg in
.from_source()
is for remote URL link right? Is it possible to make the source from local
n
yep: • docs • other example
a
Another weird thing is, when I used
tag
arg, it will create a duplicate dir of my current project with the tag as suffix.
n
but oftentimes serve is an easier way of doing the same thing
a
Currently I try use serve but it still take my remote repo to trigger.
Lemme try using my project path as source.