Add a swap file to build machines 15/68115/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 9 Feb 2018 16:10:24 +0000 (11:10 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 12 Feb 2018 15:19:19 +0000 (10:19 -0500)
We have heard this a few times now and again on the TSC mailing list
https://lists.opendaylight.org/pipermail/tsc/2018-February/008824.html

It might be beneficial to have some kind of swap available on the
system. There is a pretty good writeup about swap here:
https://chrisdown.name/2018/01/02/in-defence-of-swap.html

Change-Id: Ifc9d57045b54e1b4f9943214e418b41fabf49d04
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jenkins-scripts/jenkins-init-script.sh

index e79228f336442c5164aded132bf7455a0bf7e21b..3309b00ab11322912a3e9d0c924f74ef84091f44 100755 (executable)
@@ -24,3 +24,9 @@ source /tmp/system_type.sh
 
 ## add local environment changes post scripts
 ./jenkins-init-script-local-env.sh
+
+# Create a swap file
+dd if=/dev/zero of=/swap count=1024 bs=1MiB
+chmod 600 /swap
+mkswap /swap
+swapon /swap