Merged
Conversation
…r template instances This makes declarative containers truly reloadable. Current code already declares it: https://github.com/NixOS/nixpkgs/blob/56904d7c423f2b13b37fbd29f39bbb4b52bc7824/nixos/modules/virtualisation/containers.nix#L488 ``` restartIfChanged = false; ``` https://github.com/NixOS/nixpkgs/blob/56904d7c423f2b13b37fbd29f39bbb4b52bc7824/nixos/modules/virtualisation/containers.nix#L540 ``` reloadIfChanged = true; ``` Original author: @chrisfarms in NixOS@6e36619 Most of stuff from that commit has already been ported.
…ig changes are applied on `nixos-rebuild switch` invocations.
Contributor
Author
|
cc @volth @kampfschlaefer @fpletz who run containers I'm not going to address "pitfalls" problems in this PR. I'd rather say that current PR is a compromise of usefulness VS correctness. Also, pitfalls 1 and 2 are present already, so the only real problem is slower activation time when many containers are running. It may also start failing, because of real problems in container configuration. |
Contributor
Author
|
So, I've done some research which templated services will be affected. Here is a list of all templated: and here is list of reloadable templated services: That |
Member
|
Cool! Thanks a lot! |
fpletz
approved these changes
Aug 30, 2017
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation for this change
This makes declarative containers truly reloadable (container config changes are applied on
nixos-rebuild switch). Current code already declares it:nixpkgs/nixos/modules/virtualisation/containers.nix
Line 488 in 56904d7
nixpkgs/nixos/modules/virtualisation/containers.nix
Line 540 in 56904d7
Original author: @chrisfarms in 6e36619
Most of stuff from that commit has already been ported.
Details
There is indeed a bug in how
switch-to-configuraiton.pldetects template instances. That's why systemd units for containers were never considered as changed and so never where reloaded.This obviously doesn't do anything to imperative containers.
Pitfalls
In current state containers suffer from the long-running problem - when to restart and when to reload. Because this change makes containers "reloadable-only" (was "never restart, never reload"), it imposes several problems:
journalctlwon't show container reload logs without-M $container_name_hereThings done
[x] Test in production
[x] Nixos test for this stuff
[ ] Release notes update