Is there a way to disable version incrementing whe...
# ask-community
j
Is there a way to disable version incrementing when registering a flow with prefect cloud? (more details on use case in thread)
I have a number of flows (50+) that are all lightweight in and of themselves, and all have similar (practically identical) dependancies. We use Docker for storage, so, it seemed to make the most sense to bundle up all flows into a single Docker container. So far this scheme has been ideal for our use case. However, if one flow is updated, all flows need to be reassigned to the same storage and reregistered (right?). This is fine, except it is very annoying that in the UI all flows increment in version. If I make 15 changes across 50 flows, a flow that was  never  edited since its initial deployment will be on version 16 😕 Is there anyway to preferentially prevent version incrementing, or any other suggests for how to be approaching this, besides having a different container for each flow?
k
Hey @Jacob Goldberg, are you following this ? and then you register with
python myflow.py
?
👍 1
For one, we are moving to user-defined versions in the very near future to avoid issues like this. I think you may need to just build that container separately with DockerRun and then use some other storage like S3 or Github?
Or you do use the CLI to register?
j
following the pattern currently in the docs you mentioned above
What do you mean build a container separately with DockerRun and then use some other storage like S3 or Github?
k
So you can build an image separately from Prefect and then just specify it in DockerRun. If you use some other place to store flows like S3 or Github, Prefect will get the flow and run it on top of the image. And then you can register with the CLI like
prefect register --path flows/
or something like that and it only increments (and registers) the versions of the Flows that have changes
If you have all of them in the same script, I think it's unavoidable because that
register()
call will surely up the version. I think you need them split out into multiple files, but then you run into a problem of knowing when you need to rebuild the container
I'm just throwing potential ideas, I don't have the concrete solution ironed out
👍 1
j
I had been wondering about ways to store flows on github but run in a docker container. If I follow that suggestion and build the image separately from prefect, it would really only need to include a python base and my dependancies, is that right?
and so you know, I actually dont have all flows in the same script, because it didnt make sense to me organizationally. Each flow is in its own file, but I have a separate script I call
flow_registry
that relies on the
extract_flow_from_file()
utility to crawl my
flows/
directory, import all flows, and then loop through them assigning storage and registering with Prefect cloud
k
Oops I forgot to hit the enter on this message. Yeah that is right. on the first question. Yeah if you give a directory to
prefect register --path folder
or something like that, it loops through them and registers only the changed ones