Merge lp:~pfalcon/linaro-android-build-tools/disk-space-monitor into lp:linaro-android-build-tools

Proposed by Paul Sokolovsky
Status: Merged
Merged at revision: 394
Proposed branch: lp:~pfalcon/linaro-android-build-tools/disk-space-monitor
Merge into: lp:linaro-android-build-tools
Diff against target: 88 lines (+38/-14)
2 files modified
build-scripts/build-android (+2/-0)
node/build (+36/-14)
To merge this branch: bzr merge lp:~pfalcon/linaro-android-build-tools/disk-space-monitor
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Alexander Sack Pending
Linaro Infrastructure Pending
Review via email: mp+87774@code.launchpad.net

Description of the change

This bumps ramdisk size to 11.75Gb (previous abs maximum), adds df at the end of build, and allow to specify RAMDISK_SIZE for a build (0 disables it).

Well, as Andy Doan hinted that current cascade of failures is likely related to kernel objects drop into build/out/ , I don't hold my breath that 11.75Gb will help, likely will need to limit ramdisk to build/out/target/ . But so far running as such: https://android-build.linaro.org/jenkins/job/pfalcon_slave-disk-space/6/

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

As discussed on IRC, when RAMDISK_SIZE is not set, we keep the previous behaviour. It would be nice to do a drive-by fix to make code make sense when read in the second `test .. -gt 10 gig` to actually be `test -gt 12582912` (i.e. 12gb).

review: Approve
400. By Paul Sokolovsky

Make sure that RAM thresholds are bigger than ramdisk sizes created for them.

401. By Paul Sokolovsky

Use ramdisk for just build/out/target , build/out no longer reasonably fits.

402. By Paul Sokolovsky

umount build/out/target on cleanup.

403. By Paul Sokolovsky

Initial chown jenkins-build should be recursive.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-scripts/build-android'
2--- build-scripts/build-android 2011-12-20 19:51:31 +0000
3+++ build-scripts/build-android 2012-01-06 18:17:39 +0000
4@@ -86,6 +86,8 @@
5
6 time -p make -j$MAKE_JOBS $MAKE_TARGETS $SHOWCOMMANDS HOST_CC=gcc-4.5 HOST_CXX=g++-4.5 HOST_CPP=cpp-4.5
7
8+df
9+
10 if [ -n "$BUILD_SYSROOT" ]; then
11 git clone git://git.linaro.org/android/toolchain/build.git toolchain-build
12 rm -rf /tmp/sysroot
13
14=== modified file 'node/build'
15--- node/build 2012-01-04 18:33:13 +0000
16+++ node/build 2012-01-06 18:17:39 +0000
17@@ -7,35 +7,57 @@
18 # which accompanies this distribution, and is available at
19 # http://www.eclipse.org/legal/epl-v10.html
20 ###############################################################################
21+#
22+# $1 = mirror service host
23+# $2 = build CONFIG, base64-encoded
24+#
25
26 set -xe
27
28+# We need ramdisk size when executing under root, but still don't want
29+# to evaluate build config (== arbitrary code) as such.
30+function get_ramdisk_size () {
31+ sudo -E -H -u jenkins-build bash -es "$1" <<\EOF
32+ export CONFIGURATION="$(echo "$1" | base64 -id)"
33+ set -a
34+ eval "$CONFIGURATION"
35+ set +a
36+ echo $RAMDISK_SIZE
37+EOF
38+}
39+
40 BUILD_SCRIPT_ROOT=$(readlink -f "$(dirname "${0}")/../build-scripts")
41
42 # Stopgap measure to cleanup environment on instances reused for different jobs
43 mount | grep -E "^tmpfs on .+workspace/" | awk ' {print $3}' | xargs --no-run-if-empty -n1 umount
44
45+umount build/out/target || true
46 umount build/out || true
47 umount build || true
48 rm -rf build
49 mkdir build
50
51-# XXX mounting build/out on a tmpfs is probably a bit android specific...
52-mem_total=`cat /proc/meminfo | grep MemTotal | sed -s 's/[^0-9]*\([0-9]*\) kB/\1/'`
53-if [ "$mem_total" -gt 15680064 ]
54-then
55- echo using 11.75G tmpfs for build
56- mount -t tmpfs -o size=11750M tmpfs build
57-elif [ "$mem_total" -gt 10485760 ]
58-then
59- echo using 11.25G tmpfs for build/out
60- mkdir build/out
61- mount -t tmpfs -o size=11250M tmpfs build/out
62-else
63- mkdir build/out
64+ramdisk_size=$(get_ramdisk_size $2)
65+
66+# Put build/* on a ramdisk to speed up build
67+if [ -z "$ramdisk_size" -o "$ramdisk_size" != "0" ]; then
68+ mem_total=`cat /proc/meminfo | grep MemTotal | sed -s 's/[^0-9]*\([0-9]*\) kB/\1/'`
69+ if [ "$mem_total" -gt 15680064 ]; then
70+ ramdisk_size=${ramdisk_size:-11750M}
71+ echo "Using $ramdisk_size tmpfs for build"
72+ mount -t tmpfs -o size=$ramdisk_size tmpfs build
73+ elif [ "$mem_total" -gt 12485760 ]; then
74+ # XXX mounting build/out/target on a tmpfs is probably a bit android specific...
75+ ramdisk_size=${ramdisk_size:-11G}
76+ echo "Using $ramdisk_size tmpfs for build/out/target"
77+ mkdir -p build/out/target
78+ mount -t tmpfs -o size=$ramdisk_size tmpfs build/out/target
79+ else
80+ mkdir build/out
81+ fi
82 fi
83
84-chown jenkins-build:nogroup build
85+chown jenkins-build:nogroup -R build
86 cd build
87 sudo -E -H -u jenkins-build bash -xes "${BUILD_SCRIPT_ROOT}" "$@" <<\EOF
88 export BUILD_SCRIPT_ROOT="${1}"

Subscribers

People subscribed via source and target branches