-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
hooks.d running stat on volumes before hooks can do volume work #12650
Comments
@protosam Above PR should remove early failure on May i ask which |
The podman machine is using crun. Here is the complete output of podman info, sorry it was not in my initial post. My goal is to mount my network filesystem that is in development as needed to bridge host to guest VM. So I think that hooks are the right thing (though if I'm wrong, I'm open to being told that, my ego is smaller than my desire to have a fusefs that can handle named pipes and unix-sockets for me). When reading oci-hooks.5.md, it leads me to believe that it should be capable of doing mount related tricks. Getting this to work helps in solving issues that are trying to achieve similar results without having to patch podman for every filesystem that comes along. Issues like #8016 as well as pull requests like #12584 and #11454. |
@protosam Above PR #12681 fixes this but we also need a tweak in |
I am not sure this should happen in the OCI runtime, storage is usually managed before the OCI runtime runs. Can't the storage be mounted before running Podman? |
After discussing with @giuseppe I agree hooks is not a good solution for this use-case. One problem is nothing defines if @protosam You could easily do that before invoking |
You can continue to discuss here. |
The example here seems to illustrate mount related tasks being done. That seems to hint to me that it should be capable of doing whatever it needs to do without being impeded. Regarding plumbing, I am not sure what you had in mind @flouthoc. The only thing I can imagine is wraping podman with a shell script to do something before running. This changes the binary behavior in a way that will have unexpected results when a user inevitably does something I never thought about, that works the unwrapped binary. On another note, when asked if hooks were right for this, it led me to do some more reading. What seems like a better solution is actually volume plugins. There are many examples that already exist and they can live inside of a container as well. A real show stopper with it is that there appears to be no way to set a different volume driver as the default, overriding the local driver. (Also noticed that podman create/run both lack the --volume-driver flag). The plugins system has a ton of untapped potential. If there was a way to make that work, it seems quantifiably better than hooks would be. Edit: Something that was confusing for me when initially reading about volume plugins was the terms "volume driver" and "storage driver". So far as I can tell "storage driver" is unrelated to volumes and refers to the container's underlying storage such as overlayfs. |
Based on reading this and this, I believe the following should run the mount-fixer script before performing a stat on anything.
Edit: I have made steps in this gist that use the default hooks.d path so that
--hooks-dir
does not need to be used.Where this was ran
This is all being done inside the podman machine on a macbook.
Setup
Directories for hooks and executables.
Make podman hook.
Make executable to be ran by hook.
Ensure executable has execute perms.
Testing
So this hook executable isn't going to work, this is just something I'm using to collect data in testing. The data will be in
~/.oci-mount-fixer
. Before beginning, I made sure prior tests are cleaned with the file not there. The file existing is how I know the execuable ran without enabling debug output.I run podman with my custom hooks dir. At this point the hook is working. GREAT!
Clean up and check if it runs when adding volumes? This does not work. Podman is stating before running hooks. Not sure this is right.
The text was updated successfully, but these errors were encountered: