Skip to content
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

Move storage options to driver specific entries #432

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Sep 19, 2019

Storage options are really driver specific and it is when distributions set defaults, they
should not effect the user if he changes the default driver. By moving the storage options
to be driver specific, we can make sure all drivers only document and support their options.
Signed-off-by: Daniel J Walsh [email protected]

@rhatdan
Copy link
Member Author

rhatdan commented Sep 19, 2019

Fixes: #423

@rhatdan rhatdan changed the title Storageopts Move storage options to driver specific entries Sep 19, 2019
// MountOpt specifies extra mount options used when mounting
MountOpt string `toml:"mountopt"`
// Name of the ZFS File system
Name string `toml:"name"`
Copy link
Member

Choose a reason for hiding this comment

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

should this be fsname or is it wrong in the manpage?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

storage.conf Outdated
# ignore_chown_errors can be set to allow a non privileged user running with
# a single UID within a user namespace to run containers. The user can pull
# and use any image even those with multiple uids. Note multiple UIDs will be
# squasheddown to the default uid in the container. These images will have no
Copy link
Member

Choose a reason for hiding this comment

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

s/squashed down/squasheddown/

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@rhatdan
Copy link
Member Author

rhatdan commented Sep 21, 2019

Helps fix containers/buildah#1859
@cevich Ubuntu is being cranky again. I thought this was fixed.

@cevich
Copy link
Member

cevich commented Sep 23, 2019

Oh this again 😖 I also thought I fixed this...

@cevich
Copy link
Member

cevich commented Sep 23, 2019

...oh right yes, ubuntu-1904-disco-v20190514 is a base-image (essentially as-is straight from Canonical and google) and broken-by-default. So the only "fix" in play for this PR is the timeout/retry loop (which apparently isn't long enough). It's possible to increase this timeout...but that also means waiting longer (like 5-10 minutes for a full system-update)

There's another (more through) fix in #408 which uses the libpod VM cache-images. Those have all these *&!J_$#ing background package-update services disabled. That PR is blocked on a testing-bug, though I'll try rebasing/re-testing again to try and shove it forward...

@cevich
Copy link
Member

cevich commented Sep 24, 2019

...nope still failing. The best short-term fix here is to bump up the "short" timeout value:

diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index fbd3ba15c..a8a5b8138 100755
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -62,7 +62,7 @@ export DEBIAN_FRONTEND=noninteractive
 # Short-cut for frequently used base command
 export SUDOAPTGET='sudo -E apt-get -q --yes'
 # Short list of packages or quick-running command
-SHORT_APTGET="timeout_attempt_delay_command 24s 5 30s $SUDOAPTGET"
+SHORT_APTGET="timeout_attempt_delay_command 120s 5 60s $SUDOAPTGET"
 # Long list / long-running command
 LONG_APTGET="timeout_attempt_delay_command 300s 5 60s $SUDOAPTGET"
 

Though TBH it may need to be even longer. What's likely happening, is this (stooooopid) systemd service is running at boot, and trying to upgrade all the packages on the system. Then, if there's any kind of networking slowdown or the repo. is busy, it can hold that lock for quite a while.

Before you ask, I already researched the safety of killing the damn thing...general sentiment was it's not, and could end up corrupting the database 😢 Outright disabling the dagumnit services in the image is the ideal fix (PR #408) but is blocked by unit-test breakage I have not been able to figure out (issue #419).

@cevich
Copy link
Member

cevich commented Sep 24, 2019

OMG it's worse 😭 after poking the hornet's nest, there's also packaging crap Ubuntu does ON BOOT which has to be turned off separately. Will the madness never end! (base-image fix for this is tricky, since that requires booting the image - not done by design for base images). I'm working on a fix for this that will hit the libpod cache images, and come here via #408 (eventually).

@cevich
Copy link
Member

cevich commented Sep 24, 2019

Meaning: For this PR, the best we can do in short-order is the timeout suggestion above.

@rhatdan
Copy link
Member Author

rhatdan commented Sep 27, 2019

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

We really need tests for this new behavior and the commit/PR should document in greater detail what changes, how users can migrate to /use the new behavior and if we remain backward compatible.

Do we remain backwards compatible? Some users may depend on the previous behavior.

store.go Outdated
@@ -3394,6 +3350,83 @@ func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) {
if os.Getenv("STORAGE_DRIVER") != "" {
storeOptions.GraphDriverName = os.Getenv("STORAGE_DRIVER")
}
switch storeOptions.GraphDriverName {
Copy link
Member

Choose a reason for hiding this comment

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

Please create driver-specific functions for extracting the storage options. This will hopefully make the code easier to read, document and maintain. Currently, the switch table is too big for my eyes to easily follow what's going on.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is tough to do, since the driver has not been created yet. It would be nice if the known options were stored in the drivers themselves though.

store.go Outdated
if config.Storage.Options.Thinpool.XfsNoSpaceMaxRetries != "" {
storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("dm.xfs_nospace_max_retries=%s", config.Storage.Options.Thinpool.XfsNoSpaceMaxRetries))
}
case "overlay":
Copy link
Member

Choose a reason for hiding this comment

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

Empty new line missing before the new case.


Comma separated list of default options to be used to mount container images. Suggested value "nodev".

### STORAGE OPTIONS FOR BTRFS TABLE
Copy link
Member

Choose a reason for hiding this comment

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

BTRFS is already mentioned above. Let's remove this entry here.

The `storage.options.aufs` table supports the following options:

**mountopt**=""

Copy link
Member

Choose a reason for hiding this comment

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

Drop empty line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dropped

@@ -155,6 +154,10 @@ Specifies the min free space percent in a thin pool required for new device crea

Specifies extra mkfs arguments to be used when creating the base device.

**mountopt**=""

Copy link
Member

Choose a reason for hiding this comment

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

Drop empty line.

Copy link
Member Author

Choose a reason for hiding this comment

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

dropped

**mountopt**=""

Comma separated list of default options to be used to mount container images. Suggested value "nodev".

**use_deferred_deletion**=""

Copy link
Member

Choose a reason for hiding this comment

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

Drop empty line.

Copy link
Member Author

Choose a reason for hiding this comment

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

dropped

mount_program = "/usr/bin/fuse-overlayfs"

**mountopt**=""

Copy link
Member

Choose a reason for hiding this comment

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

Drop empty line.

Copy link
Member Author

Choose a reason for hiding this comment

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

dropped

File System name for the zfs driver

**mountopt**=""

Copy link
Member

Choose a reason for hiding this comment

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

Drop empty line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

The `storage.options.overlay` table supports the following options:

**ignore_chown_errors** = "true|False"
ignore_chown_errors can be set to allow a non privileged user running with a single UID within a user namespace to run containers. The user can pull and use any image even those with multiple uids. Note multiple UIDs will be squashed down to the default uid in the container. These images will have no separation between the users in the container. Only supported for the overlay and vfs drivers.
Copy link
Member

Choose a reason for hiding this comment

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

The last sentence suggests that we also need a doc entry and checks for vfs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

pkg/config/config.go Show resolved Hide resolved
@rhatdan rhatdan force-pushed the storageopts branch 3 times, most recently from 66444c7 to 1833eef Compare October 4, 2019 09:03
@vrothberg
Copy link
Member

@rhatdan, do we remain backwards compatible with this PR? I didn't test it yet.

@rhatdan
Copy link
Member Author

rhatdan commented Oct 4, 2019

Yes, and I added tests to make sure.

@rhatdan
Copy link
Member Author

rhatdan commented Oct 4, 2019

Although I did find a couple of more backwards compatibility issues. Should be fixed now.

Default Copy On Write (COW) container storage driver
Valid drivers are "overlay", "vfs", "devmapper", "aufs", "btrfs", and "zfs"
Some drivers (for example, "zfs", "btrfs", and "aufs") may not work if your kernel lacks support for the filesystem
Default Copy On Write (COW) container storage driver. Valid drivers are "overlay", "vfs", "devmapper", "aufs", "btrfs", and "zfs". Some drivers (for example, "zfs", "btrfs", and "aufs") may not work if your kernel lacks support for the filesystem
Copy link
Member

Choose a reason for hiding this comment

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

missing end period

Copy link
Member Author

Choose a reason for hiding this comment

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

There are a lot of missed periods. Fixed.

container to UID 1668442479 outside. UID 1 will be mapped to 1668442480.
UID 2 will be mapped to 1668442481, etc, for the next 65533 UIDs in
Succession.
These mappings tell the container engines to map UID 0 inside of the container to UID 1668442479 outside. UID 1 will be mapped to 1668442480. UID 2 will be mapped to 1668442481, etc, for the next 65533 UIDs in Succession.
Copy link
Member

Choose a reason for hiding this comment

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

s/succession/Succession/

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed


**use_deferred_deletion**=""
**size**=""
Maximum size of a container image. This flag can be used to set quota on the size of container images.
Copy link
Member

Choose a reason for hiding this comment

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

What size? Gb, Mb, Kb, Bytes? Can you specify 120M for 120MB say?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed


**mkfsarg**=""
Specifies extra mkfs arguments to be used when creating the base device.
Copy link
Member

Choose a reason for hiding this comment

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

list of accepted values or pointer to a man page with them?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will pass on this one, This is an old section, and I think this differs depending on the underlying file system.


Specifies extra mkfs arguments to be used when creating the base device.
**mountopt**=""
Comma separated list of default options to be used to mount container images. Suggested value "nodev".
Copy link
Member

Choose a reason for hiding this comment

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

ditto list of accepted values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Pointed them off to mount man page.


### STORAGE OPTIONS FOR THINPOOL TABLE
**mountopt**=""
Comma separated list of default options to be used to mount container images. Suggested value "nodev".
Copy link
Member

Choose a reason for hiding this comment

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

accepted values?


**autoextend_threshold**=""
**size**=""
Maximum size of a container image. This flag can be used to set quota on the size of container images.
Copy link
Member

Choose a reason for hiding this comment

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

accepted values?


**fs**="xfs"

Specifies the filesystem type to use for the base device. (default: xfs)
Specifies the filesystem type to use for the base device. (default: xfs)
Copy link
Member

Choose a reason for hiding this comment

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

accepted values


**size**=""
Maximum size of a container image. This flag can be used to set quota on the size of container images.

Copy link
Member

Choose a reason for hiding this comment

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

accepted values

mount_program = "/usr/bin/fuse-overlayfs"

**mountopt**=""
Comma separated list of default options to be used to mount container images. Suggested value "nodev".
Copy link
Member

Choose a reason for hiding this comment

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

accepted values

Specifies the maximum number of retries XFS should attempt to complete IO when ENOSPC (no space) error is returned by underlying storage device. (default: 0, which means to try continuously.)
The `storage.options.overlay` table supports the following options:

**ignore_chown_errors** = "true|False"
Copy link
Member

Choose a reason for hiding this comment

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

What's the default? Did you mean to upper case "False" here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

File System name for the zfs driver

**mountopt**=""
Comma separated list of default options to be used to mount container images. Suggested value "nodev".
Copy link
Member

Choose a reason for hiding this comment

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

accepted values

Comma separated list of default options to be used to mount container images. Suggested value "nodev".

**size**=""
Maximum size of a container image. This flag can be used to set quota on the size of container images.
Copy link
Member

Choose a reason for hiding this comment

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

accepted values


## SELINUX LABELING

When running on an SELinux system, if you move the containers storage graphroot directory, you must make sure the labeling is correct.

Tell SELinux about the new containers storage by setting up an equivalence record.
This tells SELinux to label content under the new path, as if it was stored
Tell SELinux about the new containers storage by setting up an equivalence record. This tells SELinux to label content under the new path, as if it was stored
Copy link
Member

Choose a reason for hiding this comment

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

need ending period

Copy link
Member Author

Choose a reason for hiding this comment

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

There already is on the next line.

Copy link
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.

I may have missed some, but please add verbiage with either examples or talk about the accepted values for the options in the man pages.

@rhatdan rhatdan force-pushed the storageopts branch 3 times, most recently from 907b0d4 to fc23a24 Compare October 4, 2019 14:23
@rhatdan
Copy link
Member Author

rhatdan commented Oct 4, 2019

Ok I have updated and fixed all found issues. Added more info in man pages. I think this is ready to merge.

@rhatdan
Copy link
Member Author

rhatdan commented Oct 4, 2019

@TomSweeneyRedHat
Copy link
Member

LGTM, would like a head nod from others.

Storage options are really driver specific and it is when distributions set
defaults, they should not effect the user if he changes the default driver.

By moving the storage options to be driver specific, we can make sure all
drivers only document and support their options.

With this patch we will continue to support the global mountopt but the driver
specific version will override the global mountopt.

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan
Copy link
Member Author

rhatdan commented Oct 11, 2019

@nalind @giuseppe @vrothberg PTAL

@vrothberg
Copy link
Member

Testing it now locally

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

Note that this justifies a minor version bump for the next release (i.e., v1.14.0).

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