canonical / charmcraft

Collaborate, build and publish charmed operators for Kubernetes, Linux and Windows.
Apache License 2.0
64 stars 66 forks source link

Allow Charmcraft to upload a rock directly from the file or directly between registries #1684

Closed lengau closed 3 weeks ago

lengau commented 1 month ago

What needs to get done

Currently charmcraft requires an image digest on the local docker registry to upload an OCI image. When it does that, it extracts the OCI image to a tarball (equivalent to docker image save) and then uploads that.

Charmcraft should be able to take a rock file directly. For example:

$ charmcraft upload-resource my-charm my-resource ./my-rock_1.0.rock

This would do the equivalent of skopeo copy oci-archive:my-rock_1.0.rock docker://registry.charmhub.io/my-rock:latest

For copying between registries, Charmcraft should take something like:

$ charmcraft upload-resource my-charm my-resource docker://ghcr.io/canonical/charmed-postgresql:14.11-22.04_edge

This would do the equivalent of skopeo copy docker://ghcr.io/canonical/charmed-postgresql:14.11-22.04_edge docker://registry.charmhub.io/my-rock:latest

We have permission from @sergiusens to replace the current Python-based implementation with skopeo, but we must still be able to take:

$ charmcraft upload-resource my-charm my-resource  --filepath some-file
$ charmcraft upload-resource my-charm my-resource --image 31cf150b4523481202c1ff9b7b5d7f0b36729edad89d61242d8f1eb56b2912c0

cc @carlcsaposs-canonical

Why it needs to get done

Rockcraft outputs files directly

syncronize-issues-to-jira[bot] commented 1 month ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2921.

This message was autogenerated

carlcsaposs-canonical commented 1 month ago

Related: #1685