Use semantic versioning for the public CD container image
To ensure that the CLI code expectations match the deployed infra.
CLI hardcoded to pick the latest version for a major version number, ie. "v1", "v2" etc.. CD updates would get pushed to the major version, so that older CLIs would not get breaking changes.
Even more important for DigitalOcean where the cd:latest did not get refetched and was referring to a 2 month old image without latest changes.
Description:
- The public cd is used in BYOC to create and deploy applications.
- Each customer project needs to be built and deployed on to their provider.
- Each project image is tied to a cd version as there may be some resource assignments/configurations or gRPC changes unique to that cd and expected by the application when it was built.
- cd gets updated regularly and may introduce breaking changes which make it incompatible with deployment of already deployed projects. Breaking change update the cd's major version. Non-breaking changes will update the minor version numbers.
Use Cases: Goal is to adding a mechanism to reliably bump the public-cd image and make sure the CLI is using a specific version. Customers with existing deployments will continue to use that major cd version but new stacks will use the latest.
- When re-deploying an project without any project source changes we wish to deploy without building and use a cd image with the same major number version as the cd used to build/release the last project image.
- When deploying for the first time ~~or after project source changes~~ the images will be built and deployed with the latest cd
- We are moving to a new pulumi provider, all stacks will be updated. Any existing projects (stacks) would not expect to have to tear down and re-deploy a new stack when they make changes so they should continue to update using the specific cd (major numbers version).
- Stop using latest on cd images and use major/minor. We can guarantee that the CLI is using a specific major/minor version of a public-cd so they have consistent behaviour of their stack.
Work Items:
- Tag each public cd image with a semver. Keep track of the latest semver and increase minor/patch per update of the cd image (use defang-mvp/pulumi/package.json for version tracking)
- Each project has a project.pb which is generated from the proto which is loaded in the CLI byoc.go. We should add a cd-version into into the protobuf. When it's read in the CLI it should direct the CLI to use a specific cd version. ~~- update CLI use the latest major version of cd for projects needing rebuild~~
- update CLI, when deploying an existing project image use the latest non-breaking cd version that the project image was built with
@lionello @edwardrf Could you comment on this? I want to make sure the description, use case, and work items are accurate on what this issue will address and how.