Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reference type and container transports #205

Open
cgwalters opened this issue Aug 28, 2024 · 4 comments
Open

Add reference type and container transports #205

cgwalters opened this issue Aug 28, 2024 · 4 comments

Comments

@cgwalters
Copy link
Contributor

Currently this crate faithfully tracks most of the image spec. However, there's some linkage between the image spec and the distribution spec; for example the image spec notes org.opencontainers.image.base.name and says

This SHOULD be image references in the format defined by distribution/distribution.

And in practice of course many tools that are using the image spec will also want to deal with distribution. Now, there is a Rust crate https://github.com/oras-project/rust-oci-client which contains a full client for distribution including a Reference type.

I'd like to propose that we import that reference type - but obviously not the full client code. (For me currently I am using https://github.com/containers/containers-image-proxy-rs which speaks the distribution bits via forking skopeo instead of reimplementing it, for the reasons enumerated in the git repo).

But it would make total sense for containers-image-proxy-rs to use a reference type defined here.


There's then another thing...today in the podman-associated set of projects in github.com/containers we also have the "containers-transports" bits that are an extension of references (e.g. docker://<reference> as well as oci:/path/to/dir:<reference>). Any objects to adding a parser for those here, corresponding to... https://github.com/containers/image/blob/0cade81948cafc0cd8f9dec5e3248b598bfdb7a0/transports/alltransports/alltransports.go#L27 I think? Except there's also code elsewhere that tries to heuristically accept both a reference and a transport+reference that we probably want too in Rust.

@cgwalters
Copy link
Contributor Author

cgwalters added a commit to cgwalters/oci-spec-rs that referenced this issue Aug 30, 2024
Almost all tools which operate with OCI will end up
wanting to parse and use proper references. Import
the code from the rust-oci-client crate.

I imported the code with history with this blog
which I found helpful:
https://savorywatt.com/2015/01/25/move-files-and-folders-between-git-repos-using-patches/

Changes:

- Move `regex.rs` code inline into this file
- Switch to std `LazyLock` instead of `lazy_static` crate

For more see:

- youki-dev#205
- oras-project/rust-oci-client#159

Signed-off-by: Colin Walters <[email protected]>
cgwalters added a commit to cgwalters/oci-spec-rs that referenced this issue Aug 30, 2024
Almost all tools which operate with OCI will end up
wanting to parse and use proper references. Import
the code from the rust-oci-client crate.

I imported the code with history with this blog
which I found helpful:
https://savorywatt.com/2015/01/25/move-files-and-folders-between-git-repos-using-patches/

Changes:

- Move `regex.rs` code inline into this file
- Switch to std `LazyLock` instead of `lazy_static` crate

For more see:

- youki-dev#205
- oras-project/rust-oci-client#159

Signed-off-by: Colin Walters <[email protected]>
@saschagrunert
Copy link
Contributor

@cgwalters is this done?

@cgwalters
Copy link
Contributor Author

First part is, but WDYT about the second part in the initial comment around the skopeo transports?

@saschagrunert
Copy link
Contributor

@cgwalters yes I think having the transports side by side to the reference type would make sense.

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

No branches or pull requests

2 participants