Skip to content

wip: zstd:chunked support via oci-client #137

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

allisonkarlitskaya
Copy link
Collaborator

No description provided.

This code pulls images via containers-image-proxy-rs (which is a
wrapper around skopeo).  It's a bit too large to have it in the
top-level lib.rs, and we're about to add an alternate implementation, so
split it out.

We keep a pull() function in place for compatibility reasons to avoid
needing to update all callers: we will start using this function to
dispatch to the correct implementation depending on the reference
format.

Signed-off-by: Allison Karlitskaya <[email protected]>
This is based on the "pull" example in the zstd-chunked-rs repository.

Signed-off-by: Allison Karlitskaya <[email protected]>
@cgwalters
Copy link
Collaborator

There's some cool code here, and I think it's really useful actually to have this as an option even if it's hidden/experimental just to use as a comparison.

The main issue is really c/image (the important part of skopeo here) vs oci-client as expanded on in https://github.com/containers/containers-image-proxy-rs/?tab=readme-ov-file#why and it's for that reason I can't imagine using this by default in bootc at least anytime in the nearly visible future. Things like ECR credential helpers are highly load bearing. OTOH, other folks could reasonably make other choices.

@allisonkarlitskaya
Copy link
Collaborator Author

Ya. My first instinct is to stick this behind a feature flag (and maybe also do the same with the skopeo and potential-future-oci-dir paths)... it could be useful for the kind of scenario where we don't need the skopeo features.

In terms of those features, I feel like:

  • depending on the registry alias stuff for use-cases like bootc is probably not a reasonable best practice anyway
  • the auth stuff is hard, but also not required by a large number of our existing users
  • signing is a whole other conversation: if we want to do things like validation of the images we mount based on container signatures we're going to need support for this in the higher layers anyway so we can check it at runtime.

I feel like we could maybe close some of these gaps by adding some code to skopeo to do the work of resolving registry aliases, taking care of the initial authentication, etc. and call out to that.

I'm also sort of of the (optimistic) opinion that maybe we can have a Rust-based stack for all of this stuff at some point, and honestly, the sooner the better... and although this piece of code here leaves a lot of the other questions unanswered, it's maybe one part of moving towards a world where we could image a feasible solution to that puzzle...

Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first commit here though seems sane to me, let's split it into its own PR and get it in?

@allisonkarlitskaya
Copy link
Collaborator Author

The first commit here though seems sane to me, let's split it into its own PR and get it in?

#138

@allisonkarlitskaya
Copy link
Collaborator Author

So the biggest unanswered question here is what to do about the sha256-to-fsverity mapping. It's currently stored as raw sha256:abc123 -> symlinks directly in the objects directory, but that's fairly clearly not intended to stay.

My initial impulse was to store symlinks in the repository, but: this is just about the worst possible thing we can do. There's no actual benefit to being able to follow sha256 symlinks into the object files and this is only used for zstd:chunked. I'd actually prefer something more like an sqlite database storing sha256->fs-verity mappings. Also: it might make sense to store that in /var/cache or ~/.cache instead of directly in the repository.

@alexlarsson is currently trying to solve a very similar issue for the ostree mapping...

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

Successfully merging this pull request may close these issues.

2 participants