Skip to content

nixos: Add new_kernel_no_zfs image variants - #207371

Merged
samueldr merged 2 commits into
NixOS:masterfrom
samueldr:feature/new_kernel-no-zfs
Dec 27, 2022
Merged

samueldr merged 2 commits into
NixOS:masterfrom
samueldr:feature/new_kernel-no-zfs

Conversation

@samueldr

@samueldr samueldr commented Dec 23, 2022 •

Copy link
Copy Markdown
Member
Description of changes

With these changes, we should have the a new_kernel iso and SD image pair building on the dot at each kernel upgrade. In turn, this will allow us to publish and publicize the images. This would help with new hardware, be it x86_64 or aarch64.

The implementation I think is not that objectionable. The only way to properly fix this would be to rewrite how supportedFilesystems works, and use an attrset with true/false values to allow overriding values. Once we pour values in a list, in the NixOS modules system, it is impossible to take them back out. If you have an alternative workable solution, feel free to submit it.

The overlay here shouldn't cause any issues for evaluation time, as this is an extremely leafy eval; it affects strictly only the two newly added outputs.

Workaround for:

Obsoletes:

I'm probably missing some.

Alternative approach

I still believe the approach in this comment is the best for the future:

We're gaining too many discrete disk images. It would be best if we could describe features for the disk image and join by the logical feature names, rather than making a new file to eval.

Future related work
  • Adding the jobs to tested
  • Publishing the images
Things done

I only instantiated the aarch64-linux image. Instantiation here is sufficient since the problem is we can't even attempt to build images with the newer kernels. Compare the following:

 $ nix-instantiate ./nixos/release.nix -A sd_image_new_kernel.aarch64-linux
trace: warning: system.stateVersion is not set, defaulting to 23.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
error: Package ‘zfs-kernel-2.1.7-6.1’ in /Users/samuel/tmp/nixpkgs/feature-new_kernel-no-zfs/pkgs/os-specific/linux/zfs/default.nix:196 is marked as broken, refusing to evaluate.
...
(use '--show-trace' to show detailed location information)

 $ nix-instantiate ./nixos/release.nix -A sd_image_new_kernel_no_zfs.aarch64-linux
trace: warning: system.stateVersion is not set, defaulting to 23.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/bkzij6b8l8prspr90awmdxfmp0nr2k34-nixos-sd-image-23.05pre130979.gfedcba-aarch64-linux.img.drv

I did build the x86_64 iso image, but it's not really needed to build it. What was needed was to verify zfs support is not present.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux (kinda)
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Support for ZFS, while desirable, is problematic with newer kernel
releases. The stable ZFS release seldom supports the current newest
kernel version, and this makes the new_kernel iso basically useless as
it cannot be published, and is not often built with new kernel releases.

This uses a dirty workaround to work around the fact it is impossible to
remove a list item from a modules system list type. Since ZFS support is
conditional to being supported on the current platform, we can fake ZFS
not being supported *for the no-zfs build only*. This overlay is only
added when evaluating the iso, nothing else.
Support for ZFS, while desirable, is problematic with newer kernel
releases. The stable ZFS release seldom supports the current newest
kernel version, and this makes the new_kernel image basically useless as
it cannot be published, and is not often built with new kernel releases.

This uses a dirty workaround to work around the fact it is impossible to
remove a list item from a modules system list type. Since ZFS support is
conditional to being supported on the current platform, we can fake ZFS
not being supported *for the no-zfs build only*. This overlay is only
added when evaluating the image, nothing else.
@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 23, 2022
@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Dec 23, 2022
@K900

K900 commented Dec 23, 2022

Copy link
Copy Markdown
Contributor

Yes please. Also will need a channel-scripts change so these get copied to the usual spot on the CDN.

@samueldr

Copy link
Copy Markdown
Member Author

Yes please. Also will need a channel-scripts change so these get copied to the usual spot on the CDN.

Yes. Just to be clear this is listed under future related work as publishing the images.

@vcunat

vcunat commented Dec 23, 2022

Copy link
Copy Markdown
Member

For reference, history of the current new-kernel ISO not evaluating for long periods of time: https://hydra.nixos.org/job/nixos/trunk-combined/nixos.iso_minimal_new_kernel.x86_64-linux/all

I like this. I just wonder... in periods when ZFS does evaluate (and those seem not rare above), it would seem more "economical" to only alias to iso_minimal_new_kernel instead of building additional one, meaning no ZFS guaranteed. (ISOs are relatively expensive for S3 and building on the farm.)

But I certainly don't want such a nit to block this.

@samueldr

Copy link
Copy Markdown
Member Author

I like this. I just wonder... in periods when ZFS does evaluate (and those seem not rare above), it would seem more "economical" to only alias to iso_minimal_new_kernel instead of building additional one, meaning no ZFS guaranteed. (ISOs are relatively expensive for S3 and building on the farm.)

For posterity, that option was discussed in a NixOS dev chatroom at some point in the past, and was deemed undesirable. The problem is having the feature set of the iso flip and flop (ir)regularly. The published isos should be predictable in their feature set.

Here I decided to do the least objectionable change and only add new builds, but we could also remove the new_kernel+zfs variant from the job set. This can be done later too, if wanted.

@samueldr

Copy link
Copy Markdown
Member Author

No arguments against, merging... If there's anything let's discuss in a revert/change PR then I guess.

@samueldr
samueldr merged commit d5f5ec1 into NixOS:master Dec 27, 2022
@samueldr
samueldr deleted the feature/new_kernel-no-zfs branch December 27, 2022 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants