Repository: ssh://git@trove.baserock.org/baserock/baserock/morph
Branch: joeburmeister/hardlink-chroots
Sha1: d712d5d5948829c6870a60a057cd3601d74489a7
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
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 thread
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
---
morphlib/stagingarea.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py
index a87b45c..ef41fd2 100644
--- a/morphlib/stagingarea.py
+++ b/morphlib/stagingarea.py
@@ -17,6 +17,7 @@
import logging
import os
import shutil
+import subprocess
import morphlib
@@ -90,7 +91,19 @@ class StagingArea(object):
logging.debug('Installing artifact %s' %
getattr(handle, 'name', 'unknown name'))
- morphlib.bins.unpack_binary_from_file(handle, self.dirname)
+
+ decomp = self._app.settings['tempdir'] + "/" +
os.path.basename(handle.name)
+ srctime = os.stat(handle.name).st_mtime
+ if not os.path.exists(decomp) or ( (srctime - os.stat(decomp).st_mtime) >
0.001 ):
+ self._mkdir(decomp)
+ morphlib.bins.unpack_binary_from_file(handle, decomp + "/")
+ os.utime(decomp,(srctime,srctime))
+
+ if not os.path.exists(self.dirname):
+ self._mkdir(self.dirname)
+
+ subprocess.call(["sh","-c","cp -al " +
decomp+"/* " + self.dirname+"/"])
+
def remove(self):
'''Remove the entire staging area.
--
1.7.9.5