File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262 when : stage2
6363 become : true
6464 block :
65+ - name : Check disk usage before nix based installs
66+ ansible.builtin.command : df -h /
67+ register : df_before_nix_install
68+ changed_when : false
69+
70+ - name : Show disk usage before nix based installs
71+ ansible.builtin.debug :
72+ var : df_before_nix_install.stdout_lines
73+
6574 - name : Install packages from nix binary cache
6675 ansible.builtin.shell : |
67- sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{ nix_item }}"
76+ sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{ nix_item }}; rc=$?; df -h / >&2; exit $rc "
6877 loop :
6978 - " {{ psql_version }}/bin"
7079 - pg_prove
7382 - " {{ postgresql_version }}_src"
7483 loop_control :
7584 loop_var : ' nix_item'
85+ register : nix_install_result
86+ ignore_errors : true
87+
88+ - name : Show df output for each nix install attempt
89+ ansible.builtin.debug :
90+ msg : " {{ item.stderr_lines }}"
91+ loop : " {{ nix_install_result.results }}"
92+ loop_control :
93+ label : " {{ item.nix_item }}"
94+
95+ - name : Fail if any nix install failed
96+ ansible.builtin.fail :
97+ msg : " nix profile install failed for: {{ nix_install_result.results | selectattr('failed', 'defined') | selectattr('failed') | map(attribute='nix_item') | list }}"
98+ when : nix_install_result is failed
7699
77100 - name : Install supascan for baseline validation
78101 ansible.builtin.shell : |
79- sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#supascan"
102+ sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#supascan && df -h / >&2 "
80103
81104 - name : nix collect garbage after supascan install
82105 ansible.builtin.shell :
Original file line number Diff line number Diff line change @@ -71,11 +71,27 @@ function cleanup_packages {
7171 apt-get remove --purge --yes ansible
7272}
7373
74+ function show_disk_usage {
75+ echo " disk usage post $1 :"
76+ df /
77+ df -h /
78+ du -x -h --max-depth=2 / | sort -rh | head -30
79+ }
80+
81+ # Snapshot disk usage even when a step below fails; errexit would otherwise skip
82+ # the remaining show_disk_usage calls and we'd lose the state we want to debug.
83+ trap ' show_disk_usage EXIT' EXIT
84+
7485setup_apt
7586update_and_upgrade_apt
87+ show_disk_usage update_and_upgrade_apt
7688install_packages
89+ show_disk_usage install_packages
7790install_nix
91+ show_disk_usage install_nix
7892execute_stage2_playbook
93+ show_disk_usage ansible
7994cleanup_packages
8095update_and_upgrade_apt
8196cleanup_apt
97+ show_disk_usage update_and_upgrade
Original file line number Diff line number Diff line change @@ -347,7 +347,13 @@ device_partition_mappings
347347format_and_mount_rootfs
348348format_build_partition
349349setup_chroot_environment
350+ df /mnt
351+ df -h /mnt
352+ du -x -h --max-depth=2 /mnt | sort -rh | head -30
350353execute_playbook
351354update_systemd_services
352355clean_system
356+ df /mnt
357+ df -h /mnt
358+ du -x -h --max-depth=2 /mnt | sort -rh | head -30
353359umount_reset_mappings
You can’t perform that action at this time.
0 commit comments