fix: append '-base' to dev-mode image names to avoid overwriting cog build images#2802
Open
fix: append '-base' to dev-mode image names to avoid overwriting cog build images#2802
Conversation
…build images Dev-mode commands (cog serve, predict, run, train) now tag their ephemeral images with a '-base' suffix (e.g. 'cog-myproject-base') so they don't overwrite images built by 'cog build'. This was a regression introduced in 1525f7f (PR #2746) which removed the BuildBase() code path and BaseDockerImageName() helper as part of consolidating dev-mode builds to use Build(ExcludeSource=true). Also renames the SkipLabels field to BaseImageOnly, which better describes the intent of the flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cog serve,cog predict,cog run,cog train) now tag their ephemeral images with a-basesuffix (e.g.cog-myproject-base) so they don't overwrite images built bycog build.SkipLabelsbuild option toBaseImageOnly, which better describes the intent of the flag.Context
This was a regression introduced in 1525f7f (PR #2746) which removed the
BuildBase()code path andBaseDockerImageName()helper as part of consolidating dev-mode builds to useBuild(ExcludeSource=true). The-basesuffix was originally introduced in 3b09bab (Jul 2021).Changes
pkg/config/image_name.go— RestoreBaseDockerImageName()which appends-basepkg/model/options.go— RenameSkipLabels→BaseImageOnly; useBaseDockerImageNamewhenBaseImageOnlyis truepkg/model/factory.go— Update call site for renamepkg/image/build.go— Rename parameterskipLabels→baseImageOnlypkg/cli/serve.go— UpdateserveBuildOptions()for renamepkg/config/image_name_test.go— Add tests forBaseDockerImageNamepkg/model/options_test.go— Add tests for dev-mode default image naming