Commit Graph

5657 Commits

Author SHA1 Message Date
Giuseppe Scrivano 2d959dd4bf
store: drop remap-[ug]ids
drop the possibility to configure a remapping for all the layers in
the storage.

The feature dates back to the initial fork from Docker, that supported
a single user namespace where all the images were pulled. It was never
used by the container tools since we have a finer control of the user
namespaces.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-24 13:15:04 +02:00
Kir Kolyshkin 137ba2cc35 Remove devicemapper storage driver
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-04-15 14:44:29 -07:00
Ed Baunton 8f93fc5578
Synchronise documentation for convert_images flag
Synchronise documentation around the configuration file to accurately
reflect new `convert_images` flag.

Signed-off-by: Ed Baunton <edbaunton@gmail.com>
2024-02-16 06:17:01 -05:00
Giuseppe Scrivano 23ff5f8c57
storage: enable partial images by default
by default enable pulling a partial image, it is still possible to
disable the feature through the configuration file.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-15 21:58:57 +01:00
Nalin Dahyabhai 5db18d7353 Store: add ImageDirectory() and ImageRunDirectory()
Add ImageDirectory() and ImageRunDirectory(), which return the paths of
directories which the caller can use to store image-specific data which
will be cleaned up automatically when the image is removed or the system
is restarted, respectively.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-01-23 14:35:01 -05:00
Giuseppe Scrivano ca642ac045
config: new option use_composefs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-11 15:06:41 +01:00
Giuseppe Scrivano 7c82ce8eef
docs: document convert_images
Closes: https://github.com/containers/storage/issues/1749

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-06 11:15:42 +01:00
Giuseppe Scrivano c40dde3f9e
cmd: add applydiff-using-staging-dir
add a new command to exercise the ApplyDiff from a staging directory.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-03 09:38:44 +02:00
Daniel J Walsh 42d1d96371
Run codespell on code
Cleanup description of imagestore.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-15 06:16:12 -04:00
Kevin Hannon 91da0c2be7 add documentation on imagestore and add a warning if set
Signed-off-by: Kevin Hannon <kehannon@redhat.com>
2023-08-28 10:35:41 -04:00
Toshiki Sonoda 01fccaa58f options: enable Remap-User/Group setting
Remap-User/Group setting is always override by
Remap-UIDs/GIDs setting and ignored.

This commit enables Remap-User/Group setting.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-05-26 15:42:26 +09:00
Daniel J Walsh b5bcd2a907
Merge pull request #1611 from sstosh/typo-conf
Fix typo in storage.conf
2023-05-25 07:03:21 -04:00
Toshiki Sonoda e125790e9b Fix typo in storage.conf
- remap-uids and remap-gids requires a string data type.
- "four keys" -> "three keys"
- "minimum" -> "maximum"

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-05-25 14:45:18 +09:00
Kir Kolyshkin b1279128e8 docs/Makefile: add missing phony targets
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2023-05-23 17:56:03 -07:00
Daniel J Walsh 4428f8b775
Merge pull request #1549 from flouthoc/pull-store
store: add support to split filesystem using `imagestore`
2023-04-17 16:55:03 -04:00
Aditya R 30775d4b2b
store: add support to split ImageStore
Allow storage users to split the filesystem of containers vs image
store, `imagestore` if configured will pull images in image storage
instead of the `graphRoot` while keeping the other parts still in the
originally configured `graphRoot`.

overlay: set workdir and upperdir according to splitstore
If splitstore is set `workdir` and `upperdir` must go into the
splitstore i.e `graphRoot`.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-14 17:34:27 +05:30
Nalin Dahyabhai cabf1b9fd0 Initial implementation of consistency checks
Add initial Check() and Repair() methods to Stores.

Check() checks for inconsistencies between the layers which the
lower-level storage driver claims to know about and the ones which we
know we're managing.  It checks that layers referenced by layers,
images, and containers are known to us and that images referenced by
containers are known to us.  It checks that data which we store
alongside layers, images, and containers is still present, and to the
extent which we store other information about that data (frequenly just
the size of the data), verifies that it matches recorded expectations.
Lastly, it checks that layers which are part of images (and which we
therefore know what they should have in them) have the expected content,
and nothing else.

Repair() removes any containers, images, and layers which have any
errors associated with them.  This is destructive, so its use should be
considered and deliberate.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-04-13 10:38:24 -04:00
Nalin Dahyabhai 3007ac6efb Test helper: add "unshare"/"create-storage-layer"/"storage-layers"
Add "unshare", "create-storage-layer", and "storage-layers" commands to
the test helper, along with a "-U" flag to have it unshare when handling
a given command.

Add "-o" as an alias for the "--owner" flag to "copy".

Add "-r" as an alias for the "--ro" flag to "mount".

Add a "-q" flag to "layers" so that we can list just the IDs.

Drop mention of a couple of not-implemented options from
docs/containers-storage-create-layer.md.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-04-10 10:23:23 -04:00
Nalin Dahyabhai 0f2bccfa56 Complete "pulling up" of images in updateNames()
When updateNames() copies an image's record from a read-only store into
the read-write store, copy the accompanying data as well.

Add fields for setting data items at creation-time to LayerOptions,
ImageOptions, and ContainerOptions to make this easier for us and our
consumers.

Replace the store-specific Create() (and the one CreateWithFlags() and
Put()) with private create() and put() methods, since they're not
intended for consumption outside of this package, and add Flags to the
options structures we pass into those methods.  In create() methods,
make copies of those passed-in options structures before modifying any
of their contents.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-03-31 10:36:30 -04:00
Daniel J Walsh 57582350c7
Document transient_store in man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-31 05:36:06 -04:00
Daniel J Walsh 0ee26255cd
Run codespell on codebase
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-09 12:27:59 -05:00
Nalin Dahyabhai 6d91bc12f3 cmd: add a CLI wrapper for GarbageCollect
Add "gc" as an action for the CLI wrapper, for running the
GarbageCollect() method.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-01-26 16:09:00 -05:00
Dan Čermák 881ac4864a
Make the priority for picking the storage driver configurable
This fixes https://github.com/containers/storage/issues/1457

Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Dan Čermák <dcermak@suse.com>
2023-01-05 12:38:33 +01:00
Jack Henschel 2b14f1e764 Fix minor typo on containers-storage.conf.5.md
Signed-off-by: Jack Henschel <jack.henschel@cern.ch>
2022-11-28 18:04:24 +01:00
Nalin Dahyabhai 5e9e2ba6b3 Revert incorrect "heeded" -> "needed" typo fix
A recent typo fix introduced a typo.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-09-15 15:18:51 -04:00
Дилян Палаузов 2cfbc62474 docs/containers-storage.conf.5.md: reformat
Insisting on “DCO” imposes formalities, that serve self-purpose.  One cannot
assume that the submitter has time or will to read texts about symbolism in
software contributions.  If the system wants to see the text

  nrEAUIEUAIe eanuitdnuae EAIUEAUIAIE »ℓ§444.3.72b)°»°ℓ§euaieauuae

in each commit, people will write this, or any other text, that the system wants to
see.  All such text, which presence is mandated by the system, has the same value.

Signed-off-by: Дилян Палаузов <git-dpa@aegee.org>
2022-08-31 17:54:53 +03:00
Erik Sjölund cffa19709c fix typos and spelling
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-27 21:39:12 +02:00
Daniel J Walsh 84ab46a039
Move skip_mount_home to overlay specific flag in man page
Fixes: https://github.com/containers/storage/issues/1259

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-06-14 14:45:41 -04:00
Giuseppe Scrivano 268af00013
chunked: drop host dedup feature
drop host deduplication by just looking at the file path.  It could be
useful in very specific use cases, but it is too expensive for generic
images.  If the need arises, we first need to create an index of the
files that we can deduplicate so there is no need to calculate the
checksum on the fly.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-07 15:32:34 +02:00
Daniel J Walsh b64cfb4f49
Document the pull_options
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-18 15:21:03 -04:00
Daniel J Walsh 17fccdc2d8
Clearup inheritance rules for storage.conf
We have had cases where users assume that create a storage.conf file in
their home directory, will still inherit fields from the system
storage.conf files. Need to clear this up in the storage.conf file and
man page.

Fixes: https://github.com/containers/podman/issues/11778

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-03 08:30:26 -04:00
Daniel J Walsh 924c7975a7
Add data about relabeling homedir
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-18 15:26:46 -04:00
Daniel J Walsh 3c76f174dd
Tell users who change graphroot location to fix the SELinux labels
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-06 14:44:30 -04:00
Daniel J Walsh 5c30b53cf6
Fix handling of quota on volumes
This patch fixes the handling of inodes and sizes, currently if
user sets indoes and sizes together, quota is only set on sizes.

Second problem with quota is that we have to have unigue projectids
for each directory. Originally container/storage only did quota on
rootfs, now we want to support it on volumes as well. We need to be
able to get unigue projectids for these two different parent
directories. The added function, attempts to maintain at least 10,000
unigue id's based on the inode of the parent directory. I know that this
is not perfect and we have a potential for overlay.  If you have a
better algorythm, I would love to use it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-07-30 05:56:23 -04:00
Daniel J Walsh c6905646a6
Update docs/containers-storage.conf.5.md
Co-authored-by: Nalin Dahyabhai <nalin@redhat.com>
2021-07-26 10:01:33 -04:00
Daniel J Walsh 9b74ce657e
Update docs/containers-storage.conf.5.md
Co-authored-by: Nalin Dahyabhai <nalin@redhat.com>
2021-07-26 10:01:12 -04:00
Daniel J Walsh 0c7d87718f
Add inode support to quota
quota for overlay also supports setting the maximum number of
inodes. OpenShift would like to be able to set this to control the
number of inodes added to an image or to a volume.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-07-26 06:29:40 -04:00
mla 74a61676d2 Added support for CONTAINERS_STORAGE_CONF override
Signed-off-by: Morten Larsen <mortenlarsens@gmail.com>
2021-06-09 10:17:09 +02:00
Daniel J Walsh f4e11b1cf6
Update docs/containers-storage.conf.5.md
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
2021-05-17 13:39:49 -04:00
Giuseppe Scrivano 7e665ab835
store: add option to disable volatile
add an option to storage.options to inhibit usage of the
volatile storage flag.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-05-17 09:51:52 +02:00
Jordan Williams 33418be0fc
Inherit system storage driver in rootless configurations
The storage driver set in `/etc/containers/storage.conf` was ignored for rootless configurations.
Rootless configurations would use overlay or vfs by default.
If the STORAGE_DRIVER environment was variable set, this value would be used instead.

This commit changes this behavior to inherit the driver set in `/etc/containers/storage.conf`.
To inherit the driver in rootless configurations, the driver must be valid in a rootless context.
The valid rootless drivers are btrfs, overlay, and vfs at this time.
To remain consistent with previous behavior, the STORAGE_DRIVER environment variable supersedes any driver set in `/etc/containers/storage.conf` and does not need to be a valid rootless driver.

buildah's documentation for the `--storage-driver` command will need to be updated to reflect these changes.
2021-03-02 10:28:53 -06:00
Giuseppe Scrivano 9cefbaec5f
containers-storage: support layer bigdata
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-02 11:39:03 +01:00
Daniel J Walsh fa5ff265b8
Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

Partial fix for https://github.com/containers/podman/issues/8369

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-18 06:32:45 -05:00
Daniel J Walsh ff80b0bc60
Log message when graphdriver is not set
Users expect the storage to handle the fact that the
driver field is not set, but this can lead to unexpected behaviour.

Caused me to spend several hours investigating an issue, where
the overlay options were not being used, because the user created
a storage.conf file without a graphdriver.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-04 16:24:49 -05:00
Daniel J Walsh a28fc545ba
Add more information on force_mask
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-13 12:39:32 -05:00
Giuseppe Scrivano cdb1fd70b2
storage: store original permissions mask if force_mask!=0
if force mask is configured, store the original permissions in the
'user.containers.override_stat` xattr.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-11 10:30:59 +01:00
Giuseppe Scrivano be5932a4d8
storage: add option force_mask=
force_mask sets a permission mask used for the new files and
directories.

It is useful for using a NFS share for the rootless storage.  It
requires this change in fuse-overlayfs:

https://github.com/containers/fuse-overlayfs/pull/246

[storage]
  driver = "overlay"
  graphroot = "/mnt/nfs/home/storage"
  [storage.options]
    size = ""
    mountopt = "xattr_permissions=2"
   [storage.options.overlay]
     force_mask = "0755"
     ignore_chown_errors = "true"

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-11 10:30:43 +01:00
Ashley Cui a5b66709f2 add note regarding problematic language in codebase
Containers storage is committed to inclusivity, a core value of open source. Historically, there have been technology terms that are problematic and divisive, and should be changed. We are currently taking time to audit our repository in order to eliminate such terminology, and replace it with more inclusive terms. We are starting where we can, with our own code, comments, and documentation. However, some of these terms are currently used within the Linux kernel and must be used as-is at this time. When the kernel maintainers rectify this usage, containers storage will follow suit immediately.
For more information: https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language?sc_cid=701600000011gf0AAA

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-09-30 15:40:17 -04:00
Daniel J Walsh e0baaad357
Fix problems found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 10:49:59 -04:00
Ashley Cui d974c2ba30 Allow any env variable for graphroot, runroot, storagepath
Previously only resticted to home, uid, and user

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-08-11 17:18:28 -04:00