I have an docker image with a specific version of ...
# ask-community
k
I have an docker image with a specific version of prefect installed that I am using as the base image in my Storage object, however, when i go to registered the flow, a different version of prefect gets installed (i.e. the one I have installed locally where i'm calling flow.register() from). Is there anyway to avoid this? I know you can specify the prefect version when you create the Storage object, but then it is up to the user creating the flow to know what version to specify and i would prefer to just use the version that is already installed on the base image (as this image can be shared across users / flows)
k
Hey @Kathryn Klarich, I suspect this is unavoidable because the Python script itself as to be run somehow, and when that happens, Prefect is imported and the flow and tasks are evaluated/build as the storage object is built. This means that there is not choice but you use the Prefect version installed (since it’s unaware of the container then). Is the error causing your flow to not start? I think small version mismatches should still run .What are the differences in your versions?
k
No it's not causing an error, we were just hoping that we could maintain better control over the prefect version across flows / projects that way. Thanks for the info though.
Ok i'm actually still confused because I tried specifying the version on my docker Storage object and it appears the version I want to be installed (0.15.5) is being installed, but when I look at the flow in the UI it shows version 0.15.4.
k
The core version will be the version of your local Prefect, not the one inside the container. Is your build failing?
k
However, if i upgrade my local prefect version to 0.15.5 and then do flow.register(), it shows 0.15.5 in the UI... I think it may be a bug with where the UI is getting the prefect version from, because if i checkout both of the docker images it looks like they are both using the same version of prefect, but the UI shows a different version depending on which version I have installed upon calling flow.register()
oops sorry didn't see your message above
no i'm just trying to make sure that the version I'm running is the version i expect.
what does the core version mean?
k
The core version is the version of Prefect used to register the Flow
k
got it
k
Think of it if you didn’t have Docker. For LocalRun, it would be whatever version of Prefect you had
k
ok good to know, thank you
IMO it seems a little strange to even include this in the UI then because most runs probably aren't running as a LocalRun and it is very confusing to see that on the main page of the flow when that's not the version your flow is actually running. Just a thought 🙂
k
Uhh it’s not the one running the Flow, but before the Docker container or ECS job is spun up, there is still work done by Prefect in some of the setup work in downloading the flow from storage, and applying the RunConfig, and managing the context and env vars. So there is still a version of Prefect on the agent before the container launch that needs to match the registration version, otherwise you run into issues. So you can get warnings if that is mismatched with the registration version. Does that make sense?
k
yes it does. So we should make sure we are registering the flow with the same version as we are specifying in the flows image
k
Ideally, but within a few minor versions might work