backend.ai icon indicating copy to clipboard operation
backend.ai copied to clipboard

feat: Improve local type container registry handling

Open jopemachine opened this issue 1 year ago • 1 comments

Currently, even local type container registries are constrained by the project value and the name of a non-existent virtual container registry.

This PR removes all unnecessary restrictions, allowing local images to be scanned as they are.


Checklist: (if applicable)

  • [x] Milestone metadata specifying the target backport version

jopemachine avatar Oct 25 '24 06:10 jopemachine

[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

jopemachine avatar Oct 25 '24 06:10 jopemachine

Is there a reference that can give me the motivation for this work?

HyeockJinKim avatar Nov 12 '24 04:11 HyeockJinKim

Is there a reference that can give me the motivation for this work?

@HyeockJinKim Unfortunately, there is no separate reference compiled. But, as explained in the PR description, when rescanning and using the local images (such as when creating a session), it would be much more intuitive to use only the image name rather than assigning arbitrary registry_name and project name. (Because there is no registry information corresponding to these local images.)

jopemachine avatar Nov 12 '24 05:11 jopemachine

If we decide to apply this PR, creating a migration script to update existing local image records seems necessary so that the Images.image column has the same value as the Images.name column (except tag).

jopemachine avatar Nov 13 '24 04:11 jopemachine

To include the registry_name in the canonical even for local type strings as in the current implementation, a separate container_registry row must be created for each local image with a different registry part. And even with this approach, images that do not include a registry_name cannot be rescanned at all.

My proposal is to exclude registry_name from the canonical of Local type images. https://github.com/lablup/backend.ai/pull/2980/files#diff-b2ff25f56c8729a1b42b80c61cfbbfb9ae08f5e9fe8d9675321f4c3f311404b8R586-R588

@achimnol I would appreciate it if you could review this idea. I think it will be helpful for us to implement more general image rescan logic.

jopemachine avatar Nov 22 '24 01:11 jopemachine