Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules/virtualisation: add shared options, merge various diskSize options #341058

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phaer
Copy link
Member

@phaer phaer commented Sep 10, 2024

Description of changes

Take two of #339535, with a fix that should hopefully prevent us from blocking a channel or breaking anything else this time.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@phaer
Copy link
Member Author

phaer commented Sep 10, 2024

@ofborg test installer

@phaer
Copy link
Member Author

phaer commented Sep 10, 2024

Hm.. the installer tests failing according to ofborg seem to run fine locally and as it's a timeout, maybe hydra is overburdened or so? 🤔

nom-build -A nixosTests.installer.bcachefsSimple -A nixosTests.installer.clevisBcachefs -A nixosTests needs almost 8 minutes on a rather beefy server, doing nothing else. But it finishes successfully.

@phaer
Copy link
Member Author

phaer commented Sep 12, 2024

@ofborg test installer

@phaer
Copy link
Member Author

phaer commented Sep 12, 2024

Tests are still failing, due to low disk space according to ofborg.

I ran all of the installer tests locally and they were successful, so I am suspecting this might be the hydra builder running low on disk space or so?

@zimbatm
Copy link
Member

zimbatm commented Sep 12, 2024

@arianvp do you want to test those changes for the AWS AMIs before we merge?

phaer added a commit to phaer/nixpkgs that referenced this pull request Sep 16, 2024
@arianvp
Copy link
Member

arianvp commented Sep 16, 2024

I can look at this after the 24th. But if other make-disk-image based images work i expect the aws one to work as well

@phaer
Copy link
Member Author

phaer commented Sep 16, 2024

@ofborg test installer.clevisBcachefs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an attrset containing a module instead of just a module? Couldn't this just be a normal module?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to be able to pick options from virtualisation-options.nix as needed per module - similar to how lib/nixos/systemd-unit-options.nix.

I then switched to an attrset of modules instead of options to be able to use assertions. Suppose we could move those to the options check function if an attrset of options would be preferable for some reasons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assertions will work just fine. They're part of the module fixpoint like any other option, so module composition is all you need - no need to go around the module system.

Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this so it doesn't diverge.

The main design decision of this PR is to introduce a shared diskSize attribute between various disk outputs. This makes sense because each disk output requires a new evaluation (it wouldn't make sense to import multiple profiles with conflicting target settings in the same evaluation).

@phaer
Copy link
Member Author

phaer commented Sep 23, 2024

I am on vacation this week, so from my point of few it doesn't hurt to wait a bit with a merge and let @arianvp check that it doesn't break the aws image

@endgame
Copy link
Contributor

endgame commented Sep 24, 2024

In response to a request for help on Matrix, I built the disk image following the instructions at http://jackkelly.name/blog/archives/2020/08/30/building_and_importing_nixos_amis_on_ec2/index.html, uploaded it to S3, imported it to an EBS snapshot, created an AMI from it, launched an instance from the AMI, and SSH'd into it as root. Does that help?

I did not provide any explicit NixOS configuration.

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is great, but let's just use a module file and avoid the unnecessary bells and whistles. Other than that LGTM.

nixos/modules/virtualisation/virtualisation-options.nix Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants