Are there any plans for versioning deployments in ...
# prefect-community
d
Are there any plans for versioning deployments in Prefect 2 similar to how registered flows are versioned in Prefect 1? Currently the previous deployment just gets overridden, and that is including all source files uploaded to storage. Related to this - what about having two deployments of the same flow, but with different schedules. Currently each deployment gets uploaded to the storage, which means duplicate file transfer and 2 versions in S3 if bucket versioning is enabled
1
a
It already works and this is one of my favorite features in the new deployment UX - you can finally easily version your deployments with the GITHUB_SHA from CI just add a flag --version to your
prefect deployment build
what about having two deployments of the same flow, but with different schedules.
this works two - you create 2 deployments of one flow
perhaps consider disabling bucket versioning for deployment buckets then? might be useful since you probably already version-control your code with Git so versioning on S3 seems a little redundant, but up to you
d
Thanks Anna. The version argument for
prefect deployment build
command only adds metadata to the deployment unless I am missing something. It has no effect on where the files are stored in the storage - e.g. S3 in my case. So if my storage points to
<s3://example/flow>
then: 1.
prefect deployment build --version 1 ...
will upload the files to
<s3://example/flow>
2.
prefect deployment build --version 2 ...
will override files in
<s3://example/flow>
What I would expect (or be able to do) is for the version to be appended to the storage configuration: 1.
prefect deployment build --version 1 ...
will upload the files to
<s3://example/flow/1>
2.
prefect deployment build --version 2 ...
will upload the files to
<s3://example/flow/2>
So that building the deployment again cannot interfere with any flows that are currently scheduling - e.g. what if version 2 added extra dependencies to a base image, but another flow is already starting that fetched the image, but has not downloaded the source code yet. I appreciate that the odds of this are very low, but it is a consequence of the build artefacts not being immutable - which is often a desirable property (the same as it is often desirable to make docker images immutable once uploaded to the repository).
Sounds like https://prefect-community.slack.com/archives/CL09KU1K7/p1660907617682639?thread_ts=1660904374.225469&amp;cid=CL09KU1K7 will provide an alternative as I will be able to build and upload docker image with all code, and then reference it from deployments