Greetings everyone , I am facing issue while conne...
# ask-community
a
Greetings everyone , I am facing issue while connecting my gitlab storage for flow registration. I did try the steps mentioned in docs but i guess I am missing on something. Can anyone please share in simple steps of resolving the same.
k
Hi @ash, can you give more details to what errors you get?
a
yes , i have pushed the flow to my repo with proper path and everything, but when i execute
Copy code
prefect register -p /test_code_3.py --project MyProject
I am receiving
Path '/test_code_3.py' doesn't exist
i checked the repo and file path but there is no issue in that
can it be due to secret token
k
Oh can you try using an absolute path?
I think there was a bug that the relative path was being treated as absolute. Will be fixed next release.
a
Kevin i have one doubt, my flow on gitlab have access token , repo name and everything, but when i run
prefect register -p /test_code_3.py --project MyProject
what prefect is running here is file on my local system that is pulled from git , right ?
so you mean i have to give full path for that updated git file ?
k
oh sorry didn’t specify. full path for the python file
This is registering from the local file, not from Git. But upon flow execution it will pull from Git
a
Ok so let me share what i understood
Copy code
--> I have my flow on local machine

---> I push it on git 

---> I Register my flow from local

---> The flow is executed from git
k
Yes exactly so the path of registration is an absolute path to the file
a
But isn't this against what we were trying to accomplish, we did not want our code to be present on local and keep all the functional code on git , but using local file for registration is not solving this
k
The local file for registration is just telling Prefect cloud to get it from Git upon execution. For this specific combination it may seem a bit “off”, but this set-up is designed for multiple storage (S3, Docker, Git, Local, etc.) and Git one form of these storage. So that
register
command needs to be able to point to all those locations.
a
Okay got it, So Kevin the thing is i am trying to make a system where all my scripts are present on git and prefect is using that code, in such a case i would need to keep all my scripts on local machine as well atleast once for registering , what do you suggest , is that a good practice or i shall try some other approach
k
I think it’s not best practice because it seems so easy to fall out of sync, but it might work. Not 100% sure though
a
so any suggestion if you could please 😅
k
I mean best practice is really that process you outlined 😆 . Think about this, having something in Git does not give you metadata (what version what the Flow registered under?). Prefect checks the metadata and makes sure everything is good upon loading.
If there’s a version conflict, Prefect will notify you. So best practice would be to use
prefect register
on your local version of the Git repo and make sure it’s in sync.
a
ok perfect , got it , let me test this process then 😋
thanks a ton Kevin
🙏
k
Of course!
a
Hey Kevin , i tested giving the full path of file and it worked, the flow got registered from github but when the flow was executed using quick run on UI , the flow is not running . I am using local agent and it up and running
@Kevin Kho
k
What are the labels of your agent and flow?
a
sorry but did not understand your question, what are labels?
k
Check this . Labels are given to agents and to flows. Agents can only pick up flows with the same labels
So if you go to the UI and click on the agent or the flow, you should be able to see the labels associated with it
a
ohh wow, I checked the agent had a label but the flow did not have a label, and after adding the same label its working, thats great 🙌
k
Glad you got it working! 🙂