-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Add support for RFC108 imperative containers #216025
Draft
m1cr0man
wants to merge
3
commits into
NixOS:master
Choose a base branch
from
m1cr0man:rfc108-minimal
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ofborg
bot
added
10.rebuild-darwin: 1-10
10.rebuild-darwin: 1
10.rebuild-linux: 1-10
labels
Feb 12, 2023
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
February 14, 2023 20:07
0e8789b
to
e1dcff3
Compare
ofborg
bot
added
10.rebuild-darwin: 0
and removed
10.rebuild-darwin: 1
10.rebuild-darwin: 1-10
labels
Jul 16, 2023
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
August 19, 2023 00:47
78ea1aa
to
47db8b8
Compare
ofborg
bot
added
10.rebuild-darwin: 1-10
10.rebuild-darwin: 1
and removed
10.rebuild-darwin: 0
labels
Aug 19, 2023
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
October 1, 2023 20:28
47db8b8
to
331f943
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
November 15, 2023 22:31
331f943
to
0402074
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
2 times, most recently
from
November 22, 2023 22:36
103994b
to
f8be66a
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
December 6, 2023 23:21
f8be66a
to
73a4581
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
December 20, 2023 00:54
48be000
to
6d9f996
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
February 22, 2024 20:27
6d9f996
to
053e903
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
April 14, 2024 02:05
053e903
to
65d7cad
Compare
m1cr0man
force-pushed
the
rfc108-minimal
branch
2 times, most recently
from
May 7, 2024 21:15
9ab1e9a
to
4a920bd
Compare
This is a refactor of the necessary changes for RFC108 to reduce the delta with current master and conform it to code changes made to switch-to-configuration.pl since the project started. I'll try to summarise the changes: - Camel case to snake case - Try to conform compare_nspawn_units to match the style and logic of compare_units for long term maintainability. - Remove fingerprintNspawnUnits and use comp_array over deepCmp. By using parse_unit instead of parseNspawn, override confs will be factored in to the data loading and comparison so I don't see a need to do the fingerprinting. - Remove use of smartmatch in favour of hash map membership, see L331/%section_cmp as an example of this being done elsewhere. - @systemd@ -> $new_systemd Overall, I hope this makes the RFC108 component changes to the script easier to maintain in nixpkgs. This also contains work from squashed commits: - Query active nspawn instance names via DBus The original implementation is pretty hacky and doesn't work correctly if the name of one running instance is the prefix of the name another instance (e.g. `foo` and `foobar`). Using `ListMachines` from machined's DBus API instead to get some structure data seems more reasonable here. This is also the way how `machienctl list` retrieves running machines.
Within systemd nspawn, even less default filesystems are required than what is currently assumed in filesystem.nix. This PR wraps more mounts in conditional toggles to respect this.
This allows imperative container management to create unit files in /etc/systemd/nspawn
m1cr0man
force-pushed
the
rfc108-minimal
branch
from
October 1, 2024 23:15
0b574d1
to
a9bf933
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
This is a fork of #140669 in a minified and refactored form covering the changes which cannot be placed in a separate flake.
I have been working on python-nixos-nspawn which implements all the components for managing imperative RFC108 style containers. I have been able to refactor almost all parts of the original POC to work within this repo/flake however I could not find a satisfactory way to otherwise apply the changes covered in this PR.
With this, it would be possible to use python-nixos-nspawn as a tool (and hopefully as a module soon) to manage RFC108 containers on any system with networkd enabled + configured appropriately.
TODO
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)CC @Ma27