Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Allow adding labels to the packages #171

Open
dhirschfeld opened this issue Feb 20, 2023 · 2 comments
Open

Allow adding labels to the packages #171

dhirschfeld opened this issue Feb 20, 2023 · 2 comments

Comments

@dhirschfeld
Copy link
Contributor

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
Copy link
Contributor Author

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:

CLI::App* s_ul = app.add_subcommand("upload", "Upload a file");
s_ul->add_option("files", du_files, "Files to upload");
s_ul->add_option("-m", mirrors, "Mirror to upload to");
s_ul->add_option("-f", file, "File from which to read mirrors, upload & download files");

...with the annotations plumbed through to OCILayer::from_file here:

auto res
= oci_upload(ctx,
mirror,
dest,
elems[2],
{ OCILayer::from_file("application/octet-stream", elems[0]) });

@dhirschfeld
Copy link
Contributor Author

OCILayer OCILayer::from_file(const std::string& mime_type,
const fs::path& file,
const std::optional<nlohmann::json>& annotations)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant