zhaofengli / colmena

A simple, stateless NixOS deployment tool
https://colmena.cli.rs
MIT License
1.2k stars 64 forks source link

Feature Request? Determine Node SSH Availability Before Building #227

Open viscountexx opened 4 weeks ago

viscountexx commented 4 weeks ago

A use case for me with colmena that is amplified over morph is that I use it to build my collection of home devices, from laptops to desktops to home servers. Unlike a public webserver, I do not expect or want 100% uptime from all these devices, but I usually want to push devices to "everything I've bothered to have booted and is currently on my home network and accessible via mDNS" - Usually my laptops are excluded from this unless I'm planning to get some use out of them soon.

Where colmena shines in this, is that unlike morph, it does not cancel all the builds for every machine if a given machine is unreachable over SSH. It simply fails to push, stops for that node, and keeps asynchronously pushing to each machine.

However, because it doesn't check at all whether it can reach a device before building the config, I frequently waste CPU cycles building for a laptop that isn't currently online or otherwise cannot be reached. It would be amazing if there could be a flag that simply has colmena check the ssh connection and throw an error if unavailable before building that machine's config.

aanderse commented 2 weeks ago

maybe a quick wrapper script is more appropriate here? get a list of names in your network, which could be real quick by directly evaluating your colmena expression, determine if each host is up or not... and finally pass in --on ... based on that input

:man_shrugging: