https://prefect.io logo
Title
a

Anthony

12/07/2022, 5:50 PM
For a kubernetes install, how do I do a pip install for prefect_gitlab? Our deveops team installed the environment so I'm wondering if they need to do the install or is there a way for me to do this?
j

Jeff Hale

12/07/2022, 6:04 PM
Are you looking to install prefect_gitlab for your K8s job? If so, there are several ways. I show them in these two blog posts: Part 1 Part 2
a

Anthony

12/07/2022, 6:14 PM
So Gitlab has already been added as a block within the Prefect environment. I'm trying to figure out how to se the deployment to point to the Gitlab location.
I was trying the following from the cli:
prefect deployment build basic_flow.py:basic_flow -n gitlab-repo-prefect-test -sb test-deployment -q default
j

Jeff Hale

12/07/2022, 6:49 PM
That part looks good. The storage block is a GitLab block and the code has already been uploaded to GitLab, correct? And GitLab repo permissions allow reading?
a

Anthony

12/07/2022, 7:58 PM
Yes it has already been uploaded. I'm not sure of the permissions. Is there a way for me to check permissions if I didn't set up the environment?
j

Jeff Hale

12/07/2022, 8:09 PM
I’m not sure, Anthony. I’m not a GitLab user. The GitLab Credentials block says it’s looking for a “A GitLab Personal Access Token with repo scope.” This is assuming it’s not a public repository. In GitLab’s docs: it looks like the project level scope needs to be
read_repository
I assume that you can see the permission level in the GitLab UI if you have permissions or may need to reach out to someone on your team.https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#scopes-for-a-project-access-token
a

Anthony

12/07/2022, 8:13 PM
ok thanks Jeff!
So I can run the basic_flow.py from my terminal and it runs successfully. But when I deploy the same code and run from the UI. It fails because it is looking for my directory.
Documents/corellium/prefect/prefect_env
What do I need to do so that the path doesn't point to my local file system?
Something like this -->
prefect config set PREFECT_HOME="/your/custom/path"