Bug 746096 - mock caches bind mounted directories
Summary: mock caches bind mounted directories
Keywords:
Status: CLOSED DUPLICATE of bug 744727
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 12
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-13 21:07 UTC by Piotr Romanus
Modified: 2011-10-14 02:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-14 02:09:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Piotr Romanus 2011-10-13 21:07:27 UTC
Description of problem:
mock caches directories added to a jail using bind_mount_opts config options. This makes the cache extremely large and takes very long time if the mounted directory is large.


Version-Release number of selected component (if applicable): Discovered in mock-1.1.12-1.fc15.noarch. I believe that this is still the problem in 1.1.15.


How reproducible:
Every time


Steps to Reproduce:
1.Added the following to my /etc/mock/site-defaults.cfg
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/users', '/users' ))

/users contains several home directories so it is very large.

2.Executed mock -r rhel-5-i386 --buildsrpm --spec mbe.spec --sources SOURCES --no-cleanup-after --resultdir=results --unpriv  --uniqueext=mbe

  
Actual results:
It took a very long time for the command to complete. The cache file contained /users


Expected results:
The cache file should not contain /users. bind mounted directories should not be cached since they presumably can be mounted again.


Additional info:
Here is a little patch that I added in order to avoid this problem:

diff --git a/py/mockbuild/plugins/root_cache.py b/py/mockbuild/plugins/root_cache.py
index ac53a2f..898f96f 100644
--- a/py/mockbuild/plugins/root_cache.py
+++ b/py/mockbuild/plugins/root_cache.py
@@ -127,7 +127,7 @@ class RootCache(object):
                 self.state("creating cache")
                 try:
                     mockbuild.util.do(
-                        ["tar"] + self.compressArgs + ["-cf", self.rootCacheFile,
+                        ["tar"] + ["--one-file-system"] + self.compressArgs + ["-cf", self.rootCacheFile,
                                                        "-C", self.rootObj.makeChrootPath()] +
                         self.exclude_tar_cmds + ["."],
                         shell=False

Comment 1 Clark Williams 2011-10-14 00:16:58 UTC
Piotr,

I was working on a different bug for the same problem:

https://bugzilla.redhat.com/show_bug.cgi?id=744727

I have to admit that your patch is simpler than mine :)

I may combine your addition to the tar command with elements of what I've already done for the config files.

Comment 2 Piotr Romanus 2011-10-14 02:09:46 UTC
Sorry for missing the fact that there is another bug describing the same problem. I will close this one as a duplicate then.

Thanks.

*** This bug has been marked as a duplicate of bug 744727 ***


Note You need to log in before you can comment on or make changes to this bug.