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

fix: Wrong image name extraction logic

Open jopemachine opened this issue 1 year ago • 2 comments

Existing code appears to assume the image name format is <registry URL>/<namespace>/<image>

https://github.com/lablup/backend.ai/blob/f16b76e81e357b2bd55da3b1dc7aa01b5eeccd26/src/ai/backend/manager/api/session.py#L1091-L1103

If the image name format is <registry URL>/<namespace>/<project>/<image>, this logic incorrectly extracts the image name.

For example,

>>> base_image_ref = "jopemachine/ghcr-test/python"
>>> new_name = base_image_ref.split("/", maxsplit=1)[1]
>>> new_name 
'ghcr-test/python'  # <project>/<image> 

new_name includes not only the image name but also the project name.

As a result, in the logic that assigns new_canonical, the project name is included twice.

(like ghcr.io/jopemachine/ghcr-test/ghcr-test/python:3.9-ubuntu20.04)


Ref: #2341.

Checklist: (if applicable)

  • [ ] Milestone metadata specifying the target backport version

📚 Documentation preview 📚: https://sorna--2391.org.readthedocs.build/en/2391/


📚 Documentation preview 📚: https://sorna-ko--2391.org.readthedocs.build/ko/2391/

jopemachine avatar Jul 05 '24 07:07 jopemachine

Your org has enabled the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

graphite-app[bot] avatar Jul 05 '24 07:07 graphite-app[bot]

  • #2391 Graphite 👈
  • main

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

Join @jopemachine and the rest of your teammates on Graphite Graphite

jopemachine avatar Jul 05 '24 07:07 jopemachine

Closing this PR because the logic for obtaining the image name is intentional.

jopemachine avatar Jul 15 '24 04:07 jopemachine