Open Mic92 opened 3 years ago
Are you using the latest version and does .
refer to a real flake? If so it should definitely fall under this arm: https://github.com/serokell/deploy-rs/blob/master/src/bin/deploy.rs#L198 and thus skip evaluation of other nodes, unless you're refering to the check step which simply just runs nix flake check
and can take much longer (though can be skipped by adding -s
)
Another improvement to evaluation speed in #96
This seems to be a complicated business...
What I observe when running deploy .#x
, where x
is a deployment:
checks
in outputs
, all checks are performed before evaluation, which takes a very long time, even when only one deployment is done.checks
unset: When I set nixosConfigurations
(additionally to deploy
, and like it is done in the system
example provided), all of those configurations are checked before evaluation, even when only some of them are deployed. That is, assume I have tow nodes NODE1 and NODE2, and I only deploy NODE1-system, both are checked:
checking NixOS configuration 'nixosConfigurations.NODE1-system'
checking NixOS configuration 'nixosConfigurations.NODE2-system'
checks
unset: If I do not provide nixosConfigurations
in outputs
no checks are performed.checks
set or unset and independent if homeConfigurations
is an output or just part of deploy
: no checks are performed for the home manager configurations.This means, I can either perform all nixosConfigurations
checks, or none, but I am not able to only perform checks for the deployed nodes. Further, there don't seem to be checks for the homeConfigurations
.
Let me know if I got something wrong or if my exposition is unclear.
EDIT: I should also have said that everything else works really well, thank you! I use deploy-rs
to deploy my local as well as other machines. It's great that there is no real difference between local and remote objects.
I've noticed the same thing where checks run for my 3 nixos configurations even though I deploy one node. It triggers all sorts of issues on top of being slow :'(
Still the issue
currently
This means, I can either perform all
nixosConfigurations
checks, or none, but I am not able to only perform checks for the deployed nodes. Further, there don't seem to be checks for thehomeConfigurations
.
The way deploy-rs checks are set up, it's either all or none due to it being a single check iirc.
We could look into splitting up the checks per machine, that would also enable mixed-arch deployments or rather allow to check just the deployments with the same arch as the deployment host and ones that can be emulated by it.
Do keep in mind that this would inflate the checks section considerably since flakes do not allow for nested checks currently:
├───checks
│ ├───aarch64-darwin
│ │ ├───deploy-activate: derivation 'deploy-rs-check-activate'
│ │ ├───deploy-schema: derivation 'jsonschema-deploy-system'
│ │ ├───pre-commit: derivation 'pre-commit-run'
│ │ └───treefmt: derivation 'treefmt-check'
│ ├───aarch64-linux
│ │ ├───deploy-activate: derivation 'deploy-rs-check-activate'
│ │ ├───deploy-schema: derivation 'jsonschema-deploy-system'
│ │ ├───pre-commit: derivation 'pre-commit-run'
│ │ └───treefmt: derivation 'treefmt-check'
│ └───x86_64-linux
│ ├───deploy-activate: derivation 'deploy-rs-check-activate'
│ ├───deploy-schema: derivation 'jsonschema-deploy-system'
│ ├───pre-commit: derivation 'pre-commit-run'
│ └───treefmt: derivation 'treefmt-check'
When having many machines and other outputs it tries to evaluate all of them instead of just evaluating the target machine.
Doing
also evaluates all machines unrelated to this.