NixCon2024 Call-by-hash

NixCon2024 Call-by-hash

837 Lượt nghe
NixCon2024 Call-by-hash
2024-10-26 14:3515:10 Speaker: Julian Kirsten Arni If we were to design a cloud based on a fundamental principle of Nix, namely hash-based addressing, what would it look like? What would be it's benefits? We did just that at garnix; this talk is about the big picture, and the details, of that idea. Derivations in Nix get a hash based on all their inputs; that hash then becomes (part of) the name by which the outputs are known. This way of naming or addressing build artifacts turns out to have a number of wonderful advantages that Nix users know and love. But NixOS machines too have such hashes. What if we gave them names - URLs - when deployment that contained that hash, and then had them communicate between each other only via these hashes? It turns out this solves a lot of common problems faced by engineers deploying infrastructure, such as zero-downtime deployments, "transactional" deployments, speed and more. We can moreover extend this idea to apply to stateful servers as well, at least in important special cases. This perspective allows us to build something with most of the features of Kubernetes, but in a very Nix way. And this isn't vaporware: it's implemented at garnix.