Skip to content

Add rootless_storage_path directive to storage.conf#529

Merged
rhatdan merged 1 commit into
containers:masterfrom
QiWang19:rootless-storage-path
Feb 26, 2020
Merged

Add rootless_storage_path directive to storage.conf#529
rhatdan merged 1 commit into
containers:masterfrom
QiWang19:rootless-storage-path

Conversation

@QiWang19
Copy link
Copy Markdown
Member

This allows rootless admins to setup alternative
paths to content in the homedir.

Rootless users on NFS homedirs will not be allowed to run
podman, if an admin wants to setup alternative directory say
in /var/tmp on local storage, they could configure the storage.conf
file and then all users would automatically get storage in /var/tmp.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com
Signed-off-by: Qi Wang qiwan@redhat.com

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Feb 13, 2020

@QiWang19 Is this supposed to replace #518?

We need to have a PR for podman that proves that this works. Or at least experiment with it to make sure it works correctly.

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Feb 18, 2020

@QiWang19 this needs a rebase.

@QiWang19 QiWang19 force-pushed the rootless-storage-path branch from 1c1be21 to 82e34e8 Compare February 18, 2020 20:14
Copy link
Copy Markdown
Member

@rhatdan rhatdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Feb 19, 2020

@TomSweeneyRedHat @nalind @vrothberg PTAL

Comment thread docs/containers-storage.conf.5.md Outdated
**rootless_storage_path**="$HOME/.local/share/containers/storage"
Storage path for rootless users. By default the graphroot for rootless users
is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set.
Otherwise the `$HOME/.local/share/containers/storage` is used. This field can
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Otherwise the" -> "Otherwise"

Comment thread docs/containers-storage.conf.5.md Outdated
* `$USER` => Replaced by the users name

A common use case for this field is `NFS home directories`, which do not work
with rootless container storage.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"do not work" -> "does not work"
or do we want to soften it a bit with something like "which is not currently supported with rootless container storage"?

Comment thread docs/containers-storage.conf.5.md Outdated
**rootless_storage_path**="$HOME/.local/share/containers/storage"
Storage path for rootless users. By default the graphroot for rootless users
is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set.
Otherwise the `$HOME/.local/share/containers/storage` is used. This field can
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/containers/storage/pull/529/files#diff-81a17eae8a51582de5ca93d298bf0162R18 says it uses "$HOME/.config/containers/storage". Is $HOME/.local/share/containers/storage used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The path is not used, the default is set to "".

@QiWang19 QiWang19 force-pushed the rootless-storage-path branch from 82e34e8 to a4f0b3a Compare February 19, 2020 18:18
Comment thread storage.conf Outdated

# Storage path for rootless users
#
# rootless_storage_path = "$HOME/.config/containers/storage"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I've over code-reviewed today, but the man page seems to say this should be $HOME/.local/share/containers/storage?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they talking about no need to specify rootless_storage_path = "$HOME/.config/containers/storage" in storage.conf? I need ask @rhatdan

Copy link
Copy Markdown
Member

@rhatdan rhatdan Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Tom is correct this should be something like

# rootless_storage_path = "/var/tmp/$USER/containers/storage"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/var/tmp? not $HOME/.config/containers/storage? also change thoses man pages to /var/tmp/$USER/containers/storage?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's talk today. If we are showing the default then it should be
$HOME/.local/share/containers/storage

Copy link
Copy Markdown
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry; I hadn't seen this earlier.

Comment thread store.go Outdated
// GraphRoot is the filesystem path under which we will store the
// contents of layers, images, and containers.
GraphRoot string `json:"root,omitempty"`
// RooltessStoragePath is the storage path for rootless users
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Comment thread utils.go
if storageOpts.GraphRoot == "" {
storageOpts.GraphRoot = defaultRootlessGraphRoot
} else if storageOpts.RootlessStoragePath != "" {
rootlessStoragePath := strings.Replace(storageOpts.RootlessStoragePath, "$HOME", homedir.Get(), -1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ouch. This sort of string replacement isn't as simple as that: for instance, what if someone writes $HOMEDIR or $USERNAME? What you probably want here is something closer to:

    look for dollar sign followed by any number of letters
    if those letters are HOME, UID, or USER, replace as needed
    otherwise, throw an error

container storage graph dir (default: "/var/lib/containers/storage")
Default directory to store all writable content created by container storage programs.

**rootless_storage_path**="$HOME/.local/share/containers/storage"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the RHS of the = supposed to be? In all other options it's simply an empty string "". Why is this one different? Especially why is it misleadingly different? The = here implies that it's a default, but right below it says otherwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value of rootless_storage_path will not be used unless the user overwrites it in storage.conf. I think it can be described as "". But I'n not sure. I need ask @rhatdan

Comment thread docs/containers-storage.conf.5.md Outdated
* `$UID` => Replaced by the users UID
* `$USER` => Replaced by the users name

A common use case for this field is `NFS home directories`, which is not currently supported with rootless container storage.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing. Perhaps something more like "A common use case for this field is to provide a local storage directory when user home directories are NFS-mounted (podman does not support container storage over NFS)."

This allows rootless admins to setup alternative
paths to content in the homedir.

Rootless users on NFS homedirs will not be allowed to run
podman, if an admin wants to setup alternative directory say
in /var/tmp on local storage, they could configure the storage.conf
file and then all users would automatically get storage in /var/tmp.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Qi Wang <qiwan@redhat.com>
@QiWang19 QiWang19 force-pushed the rootless-storage-path branch from 4d559c6 to e4f65e7 Compare February 24, 2020 19:42
@edsantiago
Copy link
Copy Markdown
Member

LGTM. Thank you for addressing my concerns.

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.

4 participants