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

container/store: Process whiteouts #359

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

cgwalters
Copy link
Member

@cgwalters cgwalters commented Aug 25, 2022

A long time ago, in a galaxy far far away, a few of us in the
ostree space did some initial work on Docker-related things; specifically
support for whiteouts landed in
ostreedev/ostree@baaf745

I wish at that time we'd realized how we could more natively
support fetching containers; but, it never occurred to me to fork
off skopeo to do all the heavy lifting for the fetch side, which
would have been a lot of work to reimplement particularly in C.
Oh well, better late than never!

Anyways, that whiteout processing was only designed to happen at
checkout time - i.e. when materializing the final filesystem tree. I
think this was actually a misdesign and we should add
ostree_mutable_tree_write_with_whiteouts so that the whiteouts
are processed in-memory.

However for now, there's a relatively low cost to temporarily
materializing the merged tree via hardlinks and handle whiteouts
via the existing code, so let's do that.

Closes: #273


This is just cleaner.  Or it WOULD be if there wasn't a bug in
`OstreeRepoFile` we need to work around.
@cgwalters
Copy link
Member Author

Draft since this passes unit test CI, but I want to test it out for real on a host system and more carefully check that e.g. we're not doing anything stupid like physical file copies during the checkout/commit phase.

@cgwalters
Copy link
Member Author

OK yep, been playing with this some more and it looks like it's working quite well!

lib/src/ostree_manual.rs Outdated Show resolved Hide resolved
lib/src/ostree_manual.rs Outdated Show resolved Hide resolved
A long time ago, in a galaxy far far away, a few of us in the
ostree space did some initial work on Docker-related things; specifically
support for whiteouts landed in
ostreedev/ostree@baaf745

I wish at that time we'd realized how we could more natively
support fetching containers; but, it never occurred to me to fork
off skopeo to do all the heavy lifting for the *fetch* side, which
would have been a lot of work to reimplement particularly in C.
Oh well, better late than never!

Anyways, that whiteout processing was only designed to happen at
checkout time - i.e. when materializing the final filesystem tree.  I
think this was actually a misdesign and we should add
`ostree_mutable_tree_write_with_whiteouts` so that the whiteouts
are processed in-memory.

However for now, there's a relatively low cost to temporarily
materializing the merged tree via hardlinks and handle whiteouts
via the existing code, so let's do that.

Closes: ostreedev#273
@cgwalters
Copy link
Member Author

Also dropped the manual g_file_query_info() wrapper - I somehow confused myself into thinking that was necessary, but it isn't AFAICS.

@cgwalters cgwalters merged commit 79d6bcb into ostreedev:main Aug 26, 2022
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.

container: support whiteouts
2 participants