Repository: ssh://git@trove.baserock.org/baserock/baserock/morph
Branch: joeburmeister/hardlink-chroots
Sha1: 4f3d88adbce702542add50acbf8adcd9969e4211
Hardlinked chroot for morph
Patch to improve morph build time by reusing decompressed files of
chunks/stage-fillers with hardlinks from the chroot. Rather than
decompressing each time into each chroot.
Original: real 5h 17m 47s
Hardlink: real 2h 52m 27s
Intergrated Richard Maw suggestions.
Joe Burmeister (1):
Hardlinked chroot for morph
morphlib/stagingarea.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--
1.7.9.5
Show replies by date
Patch to improve morph build time by reusing decompressed files of
chunks/stage-fillers with hardlinks from the chroot. Rather than
decompressing each time into each chroot.
Original: real 5h 17m 47s
Hardlink: real 2h 52m 27s
With review changes from Richard Maw.
---
morphlib/stagingarea.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py
index a87b45c..cde0aef 100644
--- a/morphlib/stagingarea.py
+++ b/morphlib/stagingarea.py
@@ -90,7 +90,20 @@ class StagingArea(object):
logging.debug('Installing artifact %s' %
getattr(handle, 'name', 'unknown name'))
- morphlib.bins.unpack_binary_from_file(handle, self.dirname)
+
+ decompressed_artifact =
os.path.join(self._app.settings['tempdir'],os.path.basename(handle.name))
+ srctime = os.stat(handle.name).st_mtime
+ if not os.path.exists(decompressed_artifact) or ( (srctime -
os.stat(decompressed_artifact).st_mtime) > 0.001 ):
+ self._mkdir(decompressed_artifact)
+ morphlib.bins.unpack_binary_from_file(handle, decompressed_artifact +
"/")
+ #Work round being set to date from tar, which is always 25th Aug 1991
+ os.utime(decompressed_artifact,(srctime,srctime))
+
+ if not os.path.exists(self.dirname):
+ self._mkdir(self.dirname)
+
+ self._app.runcmd(["cp -al " + decompressed_artifact+"/* " +
self.dirname+"/"],shell=True)
+
def remove(self):
'''Remove the entire staging area.
--
1.7.9.5