-
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
fuse-overlayfs: add C plugins system #119
Conversation
This pull request introduces 3 alerts when merging dd49509 into 74fb3dd - view on LGTM.com new alerts:
|
b512206
to
5b64df4
Compare
a test plugin: https://gist.github.com/giuseppe/a669ed7248de557a9b5fd272ffe2a4f4 It allows to use a shared storage owned by another user as a lower layer. as root:
The last command convert each file to mode As rootless then we can do:
The new syntax for The original files from the image are owned by root, the fuse-overlayfs plugin makes sure the original permissions are used inside of the container. A second rootless user could use the same command and re-use the lower layer from the root storage. |
@vrothberg @rhatdan ⬆️ this is the idea I had in mind for sharing the storage for rootless users. |
This would only allow us to copy one image. How would I set this up to allow the use of 100 images? |
@rhatdan yes, it must switch all protections to 0755, also ones that are looser. No file must be world writeable as it can affect other users of the image. root, or more in general the owner of a storage, must explicitly convert or copy+clone (if it is still needed with native overlay) each layer that is going to be shared. If the underlying file system support reflinks though, there is only the additional cost of creating inodes. |
We might be able to take advantage of Overlay MetaCopy=on as well. |
Could container storage do this for us, and just take a group of images or all images and mount them up to be used by fuse-overlay? |
yes once the low level bits are working, I think we'll need to move the logic of creating such images into containers/storage so that we could have something: |
Currently under water with tackling bugs. Will have a look as soon as I find time. Thanks for the ping, @giuseppe ! |
c8f8c47
to
571b72f
Compare
ready for review |
Signed-off-by: Giuseppe Scrivano <[email protected]>
this is the first step towards supporting data from lower layers coming from other sources. Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
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]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
differently than dev/ino number, use the uppermost mode found. Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
17f8ffa
to
4792fd0
Compare
Signed-off-by: Giuseppe Scrivano <[email protected]>
use EXIT_FAILURE and EXIT_SUCCESS instead. Signed-off-by: Giuseppe Scrivano <[email protected]>
a plugin for CRFS: https://github.com/giuseppe/crfs-plugin |
if no -o plugins is specified, load them from $PKGLIBEXECDIR (usually has the value /usr/libexec/fuse-overlayfs). Signed-off-by: Giuseppe Scrivano <[email protected]>
978ecd2
to
161914c
Compare
Closes: containers#136 Signed-off-by: Giuseppe Scrivano <[email protected]>
@rhatdan let's merge if there are no problems and I will cut a new release |
LGTM |
Alternative for #79
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]