Skip to content

Commit 6275fd6

Browse files
macdiceCommitfest Bot
authored and
Commitfest Bot
committed
ci: Use a RAM disk for NetBSD and OpenBSD.
Put the RAM disk setup for all three *BSD CI tasks into a common script, replacing the old FreeBSD-specific one from commit 0265e5c. This makes them run 3 times and a bit over 2 times faster, respectively. NetBSD and FreeBSD can use the same one-liner to mount tmpfs, but OpenBSD needs a GCP-image specific recipe that knows where to steal a disk partition to reserve swap space to mount mfs, because its tmpfs is deprecated and currently broken. The configured size is enough for our current tests but could potentially need future tweaks. Thanks to Bilal for the disklabel incantation. Reviewed-by: Nazir Bilal Yavuz <[email protected]> Discussion: https://postgr.es/m/CA%2BhUKGJJ-XrPhN%2BQA4ZUfYAAXcwOSDty9t0vE9Z8__AdacKnQg%40mail.gmail.com
1 parent 56ba046 commit 6275fd6

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

.cirrus.tasks.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ task:
155155
156156
ccache_cache:
157157
folder: $CCACHE_DIR
158-
# Work around performance issues due to 32KB block size
159-
repartition_script: src/tools/ci/gcp_freebsd_repartition.sh
158+
setup_ram_disk_script: src/tools/ci/gcp_ram_disk.sh
160159
create_user_script: |
161160
pw useradd postgres
162161
chown -R postgres:postgres .
@@ -276,7 +275,7 @@ task:
276275
277276
ccache_cache:
278277
folder: $CCACHE_DIR
279-
278+
setup_ram_disk_script: src/tools/ci/gcp_ram_disk.sh
280279
create_user_script: |
281280
useradd postgres
282281
chown -R postgres:users /home/postgres

src/tools/ci/gcp_freebsd_repartition.sh

-26
This file was deleted.

src/tools/ci/gcp_ram_disk.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
# Move working directory into a RAM disk for better performance.
3+
4+
set -e
5+
set -x
6+
7+
mv $CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR.orig
8+
mkdir $CIRRUS_WORKING_DIR
9+
10+
case "`uname`" in
11+
FreeBSD|NetBSD)
12+
mount -t tmpfs tmpfs $CIRRUS_WORKING_DIR
13+
;;
14+
OpenBSD)
15+
umount /dev/sd0j # unused /usr/obj partition
16+
printf "m j\n\n\nswap\nw\nq\n" | disklabel -E sd0
17+
swapon /dev/sd0j
18+
mount -t mfs -o rw,noatime,nodev,-s=8000000 swap $CIRRUS_WORKING_DIR
19+
;;
20+
esac
21+
22+
cp -a $CIRRUS_WORKING_DIR.orig/. $CIRRUS_WORKING_DIR/

0 commit comments

Comments
 (0)