scripts: devcontainer: mount tmpfs on /tmp
This makes tests generally faster, but most importantly, it
significantly deflakes etcd-heavy tests, especially when run with
--runs_per_test=many. Without this, the underlying FS is overlayfs-fuse,
which has very little iops to spare, to the point where etcd servers in
tests will take hundreds of seconds because of iops starvation.
Some cherrypicked figures:
Before:
//metropolis/installer/test:installer PASSED in 30.8s
//metropolis/pkg/event/etcd:etcd_test PASSED in 14.6s
After:
//metropolis/installer/test:installer PASSED in 18.9s
//metropolis/pkg/event/etcd:etcd_test PASSED in 6.1s
This has the downside of possibly eating more RAM on developer machines,
but RAM is cheap. Importantly, our test suite seems to not leak things
into /tmp (other than some leftover empty directories), so RAM usage
within the build container shouldn't balloon.
This is also something that's irrelevant for CI, as CI doesn't use
scripts/{build,destroy}_container.sh.
Change-Id: Iae12f6fdd5b48685f17f1466f2695f3707a0dd62
Reviewed-on: https://review.monogon.dev/c/monogon/+/653
Reviewed-by: Leopold Schabel <leo@nexantic.com>
diff --git a/scripts/create_container.sh b/scripts/create_container.sh
index 880217a..ac5b38e 100755
--- a/scripts/create_container.sh
+++ b/scripts/create_container.sh
@@ -107,6 +107,7 @@
podman run -it -d \
-v $(pwd):$(pwd):z \
-w $(pwd) \
+ --tmpfs=/tmp \
--volume="${bazel_root}:${bazel_root}" \
--device /dev/kvm \
--privileged \