Leo Kacenjar

02/25/2022, 3:48 PM
Hi there, we are trying to use GitLab storage and the DockerRun flow run. Our Docker image does not contain our gitlab codebase and we'd like to keep it that way. We've almost got everything working, but I'm running into PYTHONPATH issues. I see some similar threads, but none addressing the code outside the image use case. Does anyone have a GitLab Storage/DockerRun combo example? What is the path where the Gitlab repo get exposed to the Docker image? Thanks!

Kevin Kho

02/25/2022, 3:51 PM
Hi @Leo Kacenjar, this won’t work because only the Flow file gets read in so you won’t have the other dependencies your Flow needs. You need to include the custom modules inside the Docker container. The PYTHONPATH issues are incredibly hard to solve (but if you do find a solution, I’d love to see it. Have not seen anything solve it yet). What you can do though is use the ENTRYPOINT of the Docker image to clone the Git repo and pip install it so that you have it downloaded for when you run your Flow. But this is something separate from the Gitlab Storage interface Prefect provides. That only gets the Flow file

Leo Kacenjar

02/25/2022, 3:52 PM
Ahh ok, this makes sense. I'll give the latter a shot! Thanks for the quick reply. Really appreciate it.
👍 1