mamba-org / powerloader

BSD 3-Clause "New" or "Revised" License
15 stars 9 forks source link

Allow adding labels to the packages #171

Open dhirschfeld opened 1 year ago

dhirschfeld commented 1 year ago

I uploaded my test eq-utils package to my energy-quants org but have to manually link it to the correct repository:

image

The package can be automatically linked to the correct repository if you add the label:

org.opencontainers.image.source https://github.com/OWNER/REPO

It might be nice to allow specifying one or more labels to be added to the package when uploading - e.g.

powerloader upload
    --label org.opencontainers.image.source=https://github.com/energy-quants/eq-utils
    --label org.opencontainers.image.version=$version
    <snip>
dhirschfeld commented 1 year ago

It seems the internal code allows annotations to be added to layers so I think all that is needed is to expose that to the cli. It looks like that would be done here: https://github.com/mamba-org/powerloader/blob/e6b10b0683192a1e1964e989c0bfccab57cf4c38/src/cli/main.cpp#L427-L430

...with the annotations plumbed through to OCILayer::from_file here: https://github.com/mamba-org/powerloader/blob/e6b10b0683192a1e1964e989c0bfccab57cf4c38/src/cli/main.cpp#L168-L173

dhirschfeld commented 1 year ago

https://github.com/mamba-org/powerloader/blob/e6b10b0683192a1e1964e989c0bfccab57cf4c38/src/uploader/oci_upload.cpp#L53-L55