!atvIbxHoEqNcAIxYpN:nixos.org

NixOS AWS

64 Members
14 Servers

Load older messages


SenderMessageTime
6 Sep 2024
@arianvp:matrix.orgArianACtually KVM is not needed. But the build will be a bit slower than without KVM07:57:21
@arianvp:matrix.orgArianthe build works fine on AWS. it will just use emulated qemu instead of KVM qemu for assembling the final image07:57:33
@arianvp:matrix.orgArianmakes the build a few seconds slower 07:57:40
@arianvp:matrix.orgArianah you’re calling make-disk-image too.08:00:21
@arianvp:matrix.orgArianso yeh. doing the same thing!08:00:26
@commiterate:matrix.orgcommiterateI guess some explicit requirements on the machines and software needed to get the image build pipeline working in the first place. e.g. I have this: https://github.com/commiterate/nix-images?tab=readme-ov-file#bootstrap17:28:39
@commiterate:matrix.orgcommiterate
In reply to @arianvp:matrix.org

Then plan is to move to https://nixos.org/manual/nixos/stable/#sec-image-repart

which doesn’t require KVM

Oh nice, time to try this out then to remove nested virtualization (via KVM) from the bootstrap requirements then
17:29:55
@commiterate:matrix.orgcommiterateThe reason I'm particularly sensitive to bootstrap is related to the GitLab runner fleet I mentioned in the AWSTOE issue. With GitHub, there's GitHub-hosted runners which provide some "fixed"/"stable" bootstrap machines (i.e. x86-64 and AArch64 Linux runners). With a private GitLab instance, you have no runners to start. For ease of deployability, I also can't assume too much of the initial system used to build up any IaC templates to deploy bootstrap infra to AWS or whatever.17:32:33
@commiterate:matrix.orgcommiterate * The reason I'm particularly sensitive to bootstrap is related to the GitLab runner fleet I mentioned in the AWSTOE issue. With GitHub, there's GitHub-hosted runners which provide some "fixed"/"stable" bootstrap machines (i.e. x86-64 and AArch64 Linux runners). With a private GitLab instance, you have no runners to start. For ease of deployability, I also can't expect too much from the initial system used to build up any IaC templates to deploy bootstrap infra to AWS or whatever (i.e. shouldn't expect cross-compile or emulated native compile capabilities since these may be Darwin or Windows machines).17:33:16
@commiterate:matrix.orgcommiterate
In reply to @arianvp:matrix.org
so one bootstrap problem is: Your CI needs to support KVM. Which is problematic as AWS doesn’t support KVM
I believe this is only true on virts (instances using the Nitro Hypervisor). Metals have direct hardware access so as long as the AMI used there support KVM, it's usable. Not that it's a hard requirement for make-disk-image like you said since QEMU can just swap the backend.
17:43:54
@commiterate:matrix.orgcommiterate
In reply to @arianvp:matrix.org
so one bootstrap problem is: Your CI needs to support KVM. Which is problematic as AWS doesn’t support KVM
* I believe this is only true on virts (instances using the Nitro Hypervisor). Metals have direct hardware access so as long as the AMI used there supports KVM, it's usable. Not that it's a hard requirement for make-disk-image like you said since QEMU can just swap the backend.
17:44:48
7 Sep 2024
@commiterate:matrix.orgcommiterate

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 operating modes:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using coptfs which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in mode 1.

00:56:55
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 operating modes:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in mode 1.

00:58:56
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 operating modes:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in mode 1.

01:00:23
@commiterate:matrix.orgcommiterate

Maybe there's something I'm misunderstanding about the UKI that should be included in appliances.

https://nixos.org/manual/nixos/stable/#sec-image-repart-appliance

There's this repo which seems to be producing a working image that the author is using: https://github.com/tnytown/nixos-lima-vm

Trying to do the same thing and launching the .raw file in Virtual Machine Manager w/ QEMU + KVM doesn't work though. It hangs at "Booting from Hard Disk...".

02:16:07
@commiterate:matrix.orgcommiterate *

Maybe there's something I'm misunderstanding about the UKI that should be included in appliances. Maybe it includes systemd and some other stuff that removes the need for the /run folder and /bin/sh being symlinked to the Nix store's Bash install?

https://nixos.org/manual/nixos/stable/#sec-image-repart-appliance

There's this repo which seems to be producing a working image that the author is using: https://github.com/tnytown/nixos-lima-vm

Trying to do the same thing and launching the .raw file in Virtual Machine Manager w/ QEMU + KVM doesn't work though. It hangs at "Booting from Hard Disk...".

02:16:54
@commiterate:matrix.orgcommiterate *

It seems there's something I'm misunderstanding about the UKI that should be included in appliances. Maybe it includes systemd and some other stuff that removes the need for the /run folder and /bin/sh being symlinked to the Nix store's Bash install?

https://nixos.org/manual/nixos/stable/#sec-image-repart-appliance

There's this repo which seems to be producing a working image that the author is using: https://github.com/tnytown/nixos-lima-vm

Trying to do the same thing and launching the .raw file in Virtual Machine Manager w/ QEMU + KVM doesn't work though. It hangs at "Booting from Hard Disk...".

02:22:06
@commiterate:matrix.orgcommiterate Hmm even the current image I'm generating with make-nix-image hangs, so either something's wrong with both my images or my QEMU setup is broken. 03:05:09
@commiterate:matrix.orgcommiterate * Hmm even the current image I'm generating with make-nix-image hangs, so either something's wrong with both my images or my QEMU setup is broken. NixOS test VMs seem to work fine though (since I was able to run the one used in the amazon-cloudwatch-agent NixOS tests fine). 03:05:37
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 steps:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM and is optional if you don't need a full NixOS install. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in mode 1.

16:58:36
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 steps:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM and is optional if you don't need a full NixOS install. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in step 1.

16:58:50
@commiterate:matrix.orgcommiterateNevermind, it's because I disabled hardware virtualization awhile back in an attempt to fix some stability problems. Turning it back on and forcing QEMU to use UEFI lets it proceed.18:26:17
@commiterate:matrix.orgcommiterate * Nevermind, it's because I disabled hardware virtualization awhile back in an attempt to fix some stability problems. Turning it back on and forcing QEMU to use UEFI lets it proceed. Just fails to mount the root partition now.20:57:27
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 steps:

  1. Create a disk image with an EFI system partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM and is optional if you don't need a full NixOS install. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in step 1.

21:00:52
14 Sep 2024
@arianvp:matrix.orgArianThere is no need for nixos-install to make a nixos image08:04:36
@arianvp:matrix.orgArianYou just need a /nix/store. The initrd takes care of setting up all other directories on startup 08:04:58
@arianvp:matrix.orgArianAnd you need to register the nix store paths into the nix database 08:05:10
@arianvp:matrix.orgArianI can make you a little example that is not appliance based08:05:25
@arianvp:matrix.orgArianBut need to catch a boat now first :')08:05:43
@arianvp:matrix.orgArianThere's also no need for UKIs. You can just put a classic systemd-boot bootloader entry on the ESP as well08:06:21

Show newer messages


Back to Room ListRoom Version: 10