serokell / deploy-rs

A simple multi-profile Nix-flake deploy tool.
Other
1.42k stars 100 forks source link

deploy-rs takes a long time to evaluate machines #89

Open Mic92 opened 3 years ago

Mic92 commented 3 years ago

When having many machines and other outputs it tries to evaluate all of them instead of just evaluating the target machine.

Doing

 deploy '.#machinename'

also evaluates all machines unrelated to this.

notgne2 commented 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)

balsoft commented 3 years ago

Another improvement to evaluation speed in #96

dschrempf commented 3 years ago

This seems to be a complicated business...

What I observe when running deploy .#x, where x is a deployment:

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.

teto commented 1 year ago

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 :'(

supermarin commented 1 year ago

Still the issue

PhilTaken commented 1 year ago

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 the homeConfigurations.

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'