-
Notifications
You must be signed in to change notification settings - Fork 84
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
[WIP] fuse-overlayfs: add plugin system #79
Conversation
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
to give some context, I am using it to play with it: https://github.com/giuseppe/crfs/tree/fuse-overlay-plugin. I've prepared a stargz fedora image and pushed it to
|
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
Very cool, could we make this a feature of Podman? IE Push in Star.tgz format? |
it requires this change in fuse-overlays: containers/fuse-overlayfs#79 the crfs plugin can be loaded using: -oplugins=crfs.so,lowerdir=//crfs/DATA/lower where DATA is the base64 representation of a resource as: file:///path/to/layer.stargz or: https://www.example.com/layer.stargz Signed-off-by: Giuseppe Scrivano <[email protected]>
yes, it is not difficult to generate the tarballs in the star.tgz format. What is difficult is to add the concept of read-on-the-fly layers in our tools. In any case, before that, we should investigate better if it has any significant improvement. Using the |
Do we need something far larger, like one of the jboss container images |
@giuseppe, I haven't done a number of HTTP optimizations in the crfs code yet. Its access patterns are still pretty poor, no readahead, no caching of requests already done, etc. I was waiting to get it working end-to-end before optimizing those. |
@bradfitz yes I agree there is still much margin for improvements and I am optimist this can be helpful for different use cases :-) The plugin mechanism I've added in this PR was the simplest implementation I could think of to allow me to play directly with CRFS. It works fine, I've tested a few images and could not see any issue. The ugliest part is that a From a quick profiling, most of the CPU time is spent in the gzip decompression. We are already using an alternative version in our libraries ( In the last version I am working on, I've added a readahead so that the file is fetched also while there are not active requests: https://github.com/giuseppe/crfs/blob/537cd10cae39662cdbf8dbcd688894bc53aa124c/crfs.go#L284-L301 The generic use case I was trying, @rhatdan I can try a jboss-like image and see how it performs |
@giuseppe Using zstd requires defining new OCI media type for distribution? |
from containers/image#639 (comment) it seems it is enough to add the From some quick tests, there are significant improvements also when not using something like |
any plan toward merging this? ^^ |
This pull request introduces 3 alerts when merging b7777f5 into 4dc60f0 - view on LGTM.com new alerts:
|
I had no time to look at this recently. I've still some doubts about it as the current implementation for crfs using gzip is quite slow, that is why I have started looking into zstd (PR still blocked on review for containers/image) as a way to speed it up. |
@giuseppe I just merged your zstd PR in containers/image |
thanks, I've opened a PR for |
support loading layers on demand. Add a simple plugin mechanism that will help to expand fuse-overlayfs functionalities, in particular it allows to load data from a layer on demand. A plugin is loaded into fuse-overlayfs using the option: -o plugins=path/to/plugin.so:path/to/another/plugin.so A layer can use a plugin with the syntax: -o lowerdir=//plugin-name/DATA-FOR-THE-PLUGIN/path Each time a file/directory is looked up, if a plugin is registered for a layer, the plugin is first notified about the request. After the callback is invoked, fuse-overlayfs still expects the data to be accessible at the specified directory. Signed-off-by: Giuseppe Scrivano <[email protected]>
there are other use cases I'd like to play with in fuse-overlayfs, so I've worked on an alternative version for plugins that offer more flexibility: #119 |
I am closing this PR in favour of the new implementation. Unfortunately I'll need to adapt the CRFS PoC I had worked with as it is broken now with the new API |
support loading layers on demand.
Add a simple plugin mechanism that will help to expand fuse-overlayfs
functionalities, in particular it allows to load data from a layer on
demand.
A plugin is loaded into fuse-overlayfs using the option:
-o plugins=path/to/plugin.so:path/to/another/plugin.so
A layer can use a plugin with the syntax:
-o lowerdir=//plugin-name/DATA-FOR-THE-PLUGIN/path
Each time a file/directory is looked up, if a plugin is registered for
a layer, the plugin is first notified about the request.
After the callback is invoked, fuse-overlayfs still expects the data
to be accessible at the specified directory.
Signed-off-by: Giuseppe Scrivano [email protected]