Prefect 1 had versions in the ui and we could run ...
# prefect-ui
r
Prefect 1 had versions in the ui and we could run earlier versions of flows. How can I do something similar in Prefect 2?
j
Hi Russel, can you say a bit more about your use case?
r
A dev flow gets pushed to prod and over writes a working older version. So a quick fix is to run the older version until you can never changes upstream and juggle git branches. You had this in prefect 1 and was a welcome feature. Now I cannot find that functionality
Do we know why the old functionality for versions from Prefect 1 did not carry over to Prefect 2? Seems logical and useful function that I at least used. I can’t find any explain when I google for it hence the post here to enquire…
j
It's a while since I worked in Prefect 1 but I'm surprised by your description of the versions. Prefect (both 1 & 2) doesn't directly do flow code storage so you'd be pointing to an older version of your flow somewhere if you were able to run an older version? I think the easiest way to have that functionality is to use git but you could use deployments which point to different branches which would give you a similar experience. You could also use docker based storage and your deployment would have a reference to the flow as it was when the deployment was created. You can see more on storage here: https://docs.prefect.io/latest/guides/deployment/storage-guide/ And you can see examples of using different branches for here: https://docs.prefect.io/latest/api-ref/prefect/deployments/steps/pull/ and here: https://docs.prefect.io/latest/guides/prefect-deploy/#store-your-code-in-git-based-cloud-storage
r
Ok that is disappointing. It was so easy in the Prefect 1 GUI with version right there to select which you needed. Now it seems we have to handle it with git branching gymnastics.
j
It depends a little on what you use for storage. If you used docker based storage and consider each deployment as a version of your flow then you should be able to do something similar to versions in 1.0.
r
Even then P2 doesn’t show version in the GUI like P1 did. Also would help if P2 had commit hash in addition to git url and branch in the pull stage
j
Thanks for the feedback and request - it's one we can cosider as future enhancement