fix: append '-base' to dev-mode image names to avoid overwriting cog build images#2802
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.
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
|
I'm Bonk, and I've done a quick review of your PR. This PR fixes a regression where dev-mode commands were overwriting images built by I found several issues that need to be addressed: Critical: Lines 107, 299, and 303 in Comments to update:
Please update all references from |
|
Line-specific suggestions for pkg/image/build.go: Line 81: Comment still uses Line 107: Code uses Line 273: Comment references Lines 299-303: Both comment and code use |
|
I've reviewed PR #2802 and identified several issues where the code and comments still reference the old
The PR logic is sound, but these variable name references need to be updated for consistency and to avoid compilation failures. |
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