about summary refs log tree commit diff
path: root/nixos/lib/make-iso9660-image.sh
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-03-11 22:27:48 +0300
committerK900 <me@0upti.me>2024-03-12 15:41:59 +0300
commit77536af43b4402a48b4720a6cfda90a559349a4e (patch)
treea400ca2373aeceb806ffbfc105d7b5b5f8748863 /nixos/lib/make-iso9660-image.sh
parent587a40f999028a5b236c0963f0cca20bdb8e0c9d (diff)
nixos/iso-image: extremely cursed performance optimization for Hydra
Right now the worst case chain of events for building an ISO on Hydra is

    - copy everything to squashfs builder
    - run squashfs builder
    - download squashfs from builder
    - compress squashfs
    - upload squashfs to S3
    - copy squashfs to ISO builder
    - run ISO builder
    - download ISO from builder
    - compress ISO
    - upload ISO to S3

This inlines the squashfs build into the ISO build, which makes it

    - copy everything to ISO builder
    - run ISO builder
    - download ISO from builder
    - compress ISO
    - upload ISO to S3

Which should reduce queue runner load by $alot per ISO, which we have four of on small channels
(one release, one test per arch) and a lot more than four of on large channels (with various desktops)
Diffstat (limited to 'nixos/lib/make-iso9660-image.sh')
-rw-r--r--nixos/lib/make-iso9660-image.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/lib/make-iso9660-image.sh b/nixos/lib/make-iso9660-image.sh
index 34febe9cfe0e6..5881195e461f8 100644
--- a/nixos/lib/make-iso9660-image.sh
+++ b/nixos/lib/make-iso9660-image.sh
@@ -68,6 +68,11 @@ for i in $(< $closureInfo/store-paths); do
     addPath "${i:1}" "$i"
 done
 
+# If needed, build a squashfs and add that
+if [[ -n "$squashfsCommand" ]]; then
+    (out="nix-store.squashfs" eval "$squashfsCommand")
+    addPath "nix-store.squashfs" "nix-store.squashfs"
+fi
 
 # Also include a manifest of the closures in a format suitable for
 # nix-store --load-db.