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 examples/ folder, move non-core bits there #155

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Contributor

The core of composefs today is the mount.composefs and mkcomposefs tools.

Let's move the other stuff into a separate subdirectory to make this clearer. These tools are not installed with make install even before this.

In the future I'd like to more strongly decouple these examples even more.

The core of composefs today is the `mount.composefs` and
`mkcomposefs` tools.

Let's move the other stuff into a separate subdirectory to make
this clearer.  These tools are not installed with `make install`
even before this.

In the future I'd like to more strongly decouple these examples
even more.

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

we will need composefs-from-json in c/storage: containers/storage#1646

I think we either need to install it, or move it into c/storage

@cgwalters
Copy link
Contributor Author

we will need composefs-from-json in c/storage: containers/storage#1646

Ohhh. OK, so this then strongly relates to #125

Here's what I'd bikeshed: we actually move the core logic here into mkcomposefs, as something like mkcomposefs --from-stdin foo.cfs. Now, we could keep json as the input format...but ISTM we could do something even lower-dependency here, like a repeating format. Or...perhaps one of the variants of cpio format? There's some Go and Rust packages e.g. for reading/writing cpio already.

@cgwalters
Copy link
Contributor Author

(Side note: wow I hadn't realized earlier that unlike tar, cpio does the sane thing and has the symlink target be in the same place as the regular file data; no hacky "GNU long links")

To elaborate slightly, proposed "cpio stdin protocol" would be the same format as the Linux kernel parses i.e. -H newc. The big exception here is that every regular file has zero data. Instead, the caller is responsible for computing the fsverity digest.

Except...oh, arggh...cpio doesn't support xattrs. (There is an attempt to add support to the Linux kernel).

Well...we could just reuse the proposed format anyways - in the end for this use case, we have the benefit of being able to just pick whatever we want. And I'd say for this the overhead of JSON, particularly parsing textual date formats is unwanted. So something like this "extended cpio" i.e. a binary format makes more sense to me.

And taking this out even farther - IMO we could consider dropping the C shared library for now, and have mkcomposefs internally when presented with an input directory, split into two processes communicating over a pipe - one which creates a serialized stream, and one which parses it to write to the backing store.

@alexlarsson
Copy link
Collaborator

In this particular case the json format is already prescribed by zstd:chunked, no? I mean, we can maybe also support a different. more efficient, format, but that will not help containers/storage.

@cgwalters
Copy link
Contributor Author

In this particular case the json format is already prescribed by zstd:chunked, no?

I don't understand that at all. Asked in containers/storage#1646 (comment) too.

What metadata?

Oh...is this about integrating with an "on demand fetching" model using the fsverity digest as the key?

But that doesn't seem like a requirement for integration of c/storage and composefs. Also in fact ISTM it'd just be more efficient to use my proposed cpio variant instead of JSON there too.

But another way to say this is: I wouldn't tie on-demand fetching with c/storage support for composefs. We should be able to just optionally enable composefs as a backing store for existing standard OCI (e.g. tar+gzip, no zstd/estargz stuff) images - in the same way the ostree support works today.

@cgwalters cgwalters marked this pull request as draft July 6, 2023 06:24
@cgwalters cgwalters added the blocked This issue is waiting on something external label Aug 29, 2023
@cgwalters
Copy link
Contributor Author

This is obsoleted by #226 etc

@cgwalters cgwalters closed this Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is waiting on something external
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants