Hello - I’d like to automatically deploy a flow fr...
# ask-community
r
Hello - I’d like to automatically deploy a flow from within a CI/CD pipeline. I run into import errors and am curious if there is some registration pattern that doesn’t require the environment prefect is installed into to also have the flow dependencies installed for serialization? Ideally I’d like to run some CI/CD pipeline using the prefect docker image (but not necessarily install
sklearn
or similar into it) then run
prefect register --project "Project Name" -l label -p flow.py
from within the pipeline. Realistically I could probably use the container that I am running the flow from within but am curious if there is an easier way. Thanks.
k
There is a hacky way to move the imports inside the tasks or to try-except the imports. Moving the imports inside will defer execution and you won’t need them in the CI/CD
r
Is it truly hacky if it works? 🤓 Thanks for the help!
😅 1