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
Make the priority for picking the storage driver configurable #1460
Conversation
b67adf5
to
ba9c182
Compare
Please update the man page and make it clear the priority list is only used if graphdriver name is NOT specified. |
ba9c182
to
3d35b47
Compare
@rhatdan done |
One issue in the man page, once this is fixed, LGTM |
3d35b47
to
92ddbc9
Compare
One question about this change though: when invoking podman now, I always get the following error:
which is also suboptimal from a UX perspective. Does it really need to be an error? The driver is after all set in the store itself. |
@giuseppe @rhatdan WDYT? I am surprised as well. Shouldn't Podman / storage be smart enough to pick a default driver if none is set? |
docs/containers-storage.conf.5.md
Outdated
@@ -59,6 +59,11 @@ A common use case for this field is to provide a local storage directory when us | |||
container storage run dir (default: "/run/containers/storage") | |||
Default directory to store all temporary writable content created by container storage programs. The rootless runroot path supports environment variable substitutions (ie. `$HOME/containers/storage`) | |||
|
|||
**driver_priority**=[] | |||
Priority list for the storage drivers that will be tried in case no driver is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"will be tried" is a bit vague. Please be specific when a certain driver will be used and when not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make more sense now?
The error comes from here fyi: Line 384 in 46e9455
|
6e1ef87
to
bee865b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we keep the error only when DriverPriority is empty (and maybe change it to a warning)?
I believe at some point we forced users to specify their driver, because they kept on failing over to VFS in rootless mode, and then complained when they ran out of disk space in their homedir. Forcing them to specify overlay and failing, caused us to know to have them install fuse-overlayfs before the kernel supported rootless overlay. Now that rootless overlay will work for almost everyone the overlay default should work, and we might not need to require them to enter any longer. |
@dcermak Would like to get this in as we are about to release a new version of containers/storage. Are you able to address the comments? |
Given @rhatdan's comment for the historical context, I'd honestly suggest to remove this error completely. WDYT?
Yes, I'd like to get this is in soon. |
This fixes containers#1457 Co-authored-by: Valentin Rothberg <vrothberg@redhat.com> Signed-off-by: Dan Čermák <dcermak@suse.com>
bee865b
to
881ac48
Compare
Could we do the check iff driver is not specified and priority is not specified, then fail. |
We do have an internal priority list as a fallback and also in Line 332 in fc91849
Thus I don't consider that warning really valid or is there a case where the user really should define a driver? |
I am not crazy about the internal list, since it is not easily understood by humans, so I would rather fail and tell them (or the distribution, specify one rather then having it randomly chosen potentially based on which software they have installe. If the user or distribution specifies a search list of the driver then we should not warn. |
Currently we would display an error when the user does not specify a `driver` in their config file. This has been present for historical reasons mostly to prevent users from accidentally getting the vfs driver (containers#1460 (comment)). Now that most systems support the overlay driver natively, we can reduce this to a warning and only warn about it if the driver_priority list is unset. If it is provided, then clearly the user or the distribution wanted for c/storage to pick a driver itself and the warning would be only confusing to users. Signed-off-by: Dan Čermák <dcermak@suse.com>
@rhatdan Makes sense, I've adjusted the code accordingly, modified the error to be just a warning and tweaked the message as well to sound less scary. |
Currently we would display an error when the user does not specify a `driver` in their config file. This has been present for historical reasons mostly to prevent users from accidentally getting the vfs driver (containers#1460 (comment)). Now that most systems support the overlay driver natively, we can reduce this to a warning and only warn about it if the driver_priority list is unset. If it is provided, then clearly the user or the distribution wanted for c/storage to pick a driver itself and the warning would be only confusing to users. Signed-off-by: Dan Čermák <dcermak@suse.com>
fbe44c0
to
b2b2fef
Compare
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is an amend to containers#1460 That PR was not adressing the case when the system wide config had the driver_priority option configured and the user had no config file of their own. Then getRootlessStorageOpts would be called and it would override the graph driver to "vfs". With this commit we only override the graph driver if driver priority is empty. Otherwise we propagate the driver priority into the storage options, so that the driver autodetection works as expected. Signed-off-by: Dan Čermák <dcermak@suse.com>
This is an amend to containers#1460 That PR was not addressing the case when the system wide config had the driver_priority option configured and the user had no config file of their own. Then `getRootlessStorageOpts` would be called and it would override the graph driver to "vfs". With this commit we only override the graph driver if driver priority is empty. Otherwise we propagate the driver priority into the storage options, so that the driver autodetection works as expected. Signed-off-by: Dan Čermák <dcermak@suse.com>
This is an amend to containers#1460 That PR was not addressing the case when the system wide config had the driver_priority option configured and the user had no config file of their own. Then `getRootlessStorageOpts` would be called and it would override the graph driver to "vfs". With this commit we only override the graph driver if driver priority is empty. Otherwise we propagate the driver priority into the storage options, so that the driver autodetection works as expected. Signed-off-by: Dan Čermák <dcermak@suse.com>
This fixes #1457
I have tested this locally by vendoring the specific PR into podman and then setting the following
~/.config/containers/storage.conf
:podman then tried zfs (but failed as I don't have any zfs partitions) and picked btrfs as the next viable candidate.
Removing the setting causes podman to correctly pick up overlay as the driver.