kcl-lang / kpm

KCL Package Manager
https://kcl-lang.io
Apache License 2.0
27 stars 44 forks source link

[Enhancement] feature: supports adding the oci dependencies using oci urls #283

Closed zong-zhe closed 3 months ago

zong-zhe commented 6 months ago

Feature Request

Is your feature request related to a problem? Please describe:

Describe the feature you'd like:

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

dennybaa commented 4 months ago

Indeed, doesn't work for me either.

kcl version: 0.8.8-linux-amd64

kcl mod add oci://ghcr.io/org/myrepo/appid --tag 0.0.1
adding dependency 'oci'
downloading 'kcl-lang/oci://ghcr.io/org/myrepo/appid' from 'ghcr.io/kcl-lang/oci://ghcr.io/org/myrepo/appid'
failed to get package with '//ghcr.io/org/myrepo/appid' from 'ghcr.io/kcl-lang/oci'
failed to resolve //ghcr.io/org/myrepo/appid: invalid reference: invalid tag
Peefy commented 4 months ago

Yes, currently you can write it the kcl.mod and run kcl mod update.

appid = {oci = "oci://ghcr.io/org/myrepo/appid"}
dennybaa commented 4 months ago

Wow great. Thank you for a workaround @Peefy !

dennybaa commented 4 months ago

But this was too fast, I've actually just checked and can confirm that it doesn't work. @Peefy

kcl mod pull appid
start to pull 'appid'
failed to select latest version from 'ghcr.io/kcl-lang/appid'
GET "https://ghcr.io/v2/kcl-lang/appid/tags/list": response status code 404: name unknown: repository name not known to registry

From my experience pushing to private authenticated OCI registries has worked for me, but pulling doesn't work. Pulling from private doesn't work, evidently pulling from public registries should not work too...

[dependencies]
appid = { oci = "oci://ghcr.io/org/myrepo/appid", tag = "0.0.1" }
Peefy commented 4 months ago

image I can use kcl mod update to get from private OCI registry. 🤔

dennybaa commented 4 months ago

Yup thanks, update succeeded. Still issue with pull, but this is not critical at all.

Peefy commented 4 months ago

Thank you! @zong-zhe is adding support for commands such as kcl mod add and kcl mod pull for multiple OCI sources, and it is expected to be supported as early as version v0.9.0 alpha.1

zong-zhe commented 3 months ago

Hi @dennybaa 😃

Thanks for your feedback, kcl mod add oci://ghcr.io/org/myrepo/appid --tag 0.0.1 is supported by https://github.com/kcl-lang/cli/pull/90 and https://github.com/kcl-lang/kpm/pull/357