Morning all. I have a bit of confusion around regi...
# ask-community
h
Morning all. I have a bit of confusion around registering my flows in our CI/CD process, and it boils down I think to this simple question - do I need prefect AND all my flow's dependencies installed when I make the call to
flow.register()
or
prefect register
? I'm using
S3
Storage and
ECS
Run Config. I was previously using
Docker
Storage but didn't like the rebuilding of the image each time the flow code changed. I am using AWS CodePipeline/CodeBuild, so I have Docker daemon at my disposal, and I have a base image that contains the whole repo the flow sits in. Ideally, in my build environment I can build the base image if necessary, and register my flow with Prefect Cloud. However it seems I can't register unless I have all my dependencies, which happen to sit in the base image anyway. So perhaps I
docker run
and register this way? I've read the GitHub discussion on flow deployment patterns but I am not fully clear on this particular question.
It seems unnecessary to have to install my dependencies for the flow into the CI environment, only to register the code. However it also seems like there's no point using
S3
Storage if I have to register inside my base Docker image with
docker run
.
k
Hi @Hawkar Mahmod! Yes you need to bundle up the dependencies. There is this potentially relevant issue that may make this situation easier. In the mean time, the recommendation is to package things up in a docker container and install it in the container.
Are you using the container that holds your dependencies as the container for development also?
You don’t need to register with
docker run
. You can just register by calling the Python script
python flow.py
, so it’s not coupled with the Docker image.
h
Are you using the container that holds your dependencies as the container for development also?
Not strictly no. I’ve just got a Python project locally, with dependencies installed using Poetry. I have a Dockerfile that contains all of this project, including all flows and dependencies and Poetry files.
You don’t need to register with 
docker run
 . You can just register by calling the Python script 
python flow.py
, so it’s not coupled with the Docker image.
Yes but to run
python flow.py
you need to have everything in the flow imported. So all the dependencies need to be there. Are you saying that the image I use for my CI build environment should be that base Docker image?
k
Gotcha. Sorry I see what you mean now. I misread the question the first time. Yes I suppose using that image in the CI build environment would work.