How to properly make prefect workers pull code from a private github repo? #21461
|
I am currently trying to set up my prefect system to make the workers pull code from a private github repo but I keep getting errors from the prefect GUI saying "The system cannot find the file specified", though it doesnt state which file it is trying to find. Here is the CSV for the prefect log. Ive been following the guide to pulling from github but something has gone wrong with the process and I was hoping to get some help. I am currently running a prefect server through docker and am trying to set up a deployment which uses code hosted in a private github repo. The deployment is made without an issue and appears in the web GUI. I can then launch a run manually. My deployment is defined at the bottom of my flow file, as shown below: To use github, the webpage says I need to register the github block with My prefect.yaml which lays in a folder above the folder I run my docker compoe from contains the following under the pull section. I am unsure if this needs to be modified since it doesnt seem like the prefect.yaml is getting touched. Any help would be greatly appreciated! |
Replies: 1 comment
|
Hey @pro-jasonnagy! The key detail is that the failure is happening during Prefect’s deployment pull step, not when it tries to import your flow code. In your log, Prefect gets to: and then fails with: That traceback is coming from Prefect trying to execute git clone, so the missing “file” is almost certainly the git executable on the worker machine, not your flow file, A few clarifications:
What I would check next on the machine where you run prefect worker start:
If So the immediate fix is to focus on the worker environment, not the Docker Compose for the Prefect server. The server container does not need your local |
Hey @pro-jasonnagy! The key detail is that the failure is happening during Prefect’s deployment pull step, not when it tries to import your flow code.
In your log, Prefect gets to:
and then fails with:
That traceback is coming from Prefect trying to execute git clone, so the missing “file” is almost certainly the git executable on the worker machine, not your flow file,
prefect.yaml, or the GitHub block.A few clarifications:
flow.from_source(...).deploy(...), Prefect stores the pull instructions on the deployment itself. Your localprefect.yamlis not used at run time.