@whitequark@migratory Thank you for sharing that Catherine! And apologies to everyone in advance for our incomplete documentation. Working on it... I'm not a VC funded anything, just a regular human trying as hard as a I can =D
I'm at least optimistic that mgmt solves some problems your stack isn't solving. I don't however know if you want the kind of more advanced problems solved that mgmt aims to be good at. (It can do simple things too.)
@whitequark@migratory@wingo Very good question. I'm not a nix expert, but there is some overlap. Some people actually use the two together.
Mgmt is actually aiming to solve a larger problem: how do you model and build autonomous distributed systems... Think ansible+terraform, but that can react in "real time" (sub second) and handle day two automation.
There's no designed in central point of coordination, our mcl language models it all.
@purpleidea@migratory@wingo i'd be super interested in a showcase of mgmt+nix; otherwise it feels like there's too much overlap with tech i'm already heavily invested in
@whitequark@migratory@wingo On this specific point mgmt has a concept of "reversible resources" which means it can "undo" something that was previously done. It does this in ms, and immediately, which is quite neat.
Not all resources necessarily support this yet, but it's easy to add when we find something new we want reversed.
One downside is it's not something we use often, so there may be some bugs hiding out.
@purpleidea@migratory@wingo like i just finished migrating off ansible which IMO is unfit for purpose (just like chef and other systems that do not provide 'strong idempotence' in the configuration mgmt sense; ie anything that can leave unused configs or packages on the server)
@purpleidea@migratory@wingo nix! i use it for the core task of "i run one command and after it completes successfully i know exactly what state one individual machine is in"
@purpleidea@migratory@wingo right now when i need to do something on *multiple* machines i use fly.io, which works but also has certain issues. it would be nice to be able to have the same guarantees for "i need to deploy this in 5 places across the planet"
@whitequark@migratory@wingo Based on what you said you appreciate about nix, I would recommend initially trying mgmt for something that you can't currently do well.
i) Maybe either a distributed systems task
ii) Perhaps I could show you how to do something that you thought would be too complicated, but with mcl (our language) becomes self-contained and very easy.
You've shared so much good stuff online with me, I could write you a small mcl module to deploy something as an example perhaps?
@whitequark@migratory@wingo Okay! I could build you something if you'd like. One caveat: we currently support two "coordination" backends. (We call it the "world" backend.) The main one is etcd. This is needed if you want things happening on machine A to be influenced by things on machine B.
We don't really recommend world-scale coordination over etcd, but it would probably work. Eventually we could add an AP (CAP theorem) backend instead of the CP one that etcd has.
@purpleidea@migratory@wingo I've reviewed etcd recently (which amounts to basically reading the Jepsen report and concluding that most of it seems good) and figured that in context of git-pages I want to store the SSL keys in it (currently I put those in an S3 bucket)
@purpleidea@migratory@wingo there is a need for coordination: namely, actions of one git-pages instance needs to propagate to others. there are two kinds of them: - getting an SSL cert (caddy-etcd should handle that) - pushing an update to the site (right now i use Tigris, but i am interested in being able to not rely on third party, sometimes unstable and kinda opaque infra)
@whitequark@migratory@wingo Your request doesn't seem to imply any need to coordinate between the three, so it's not difficult to just run mgmt standalone. Which I can do.
But maybe you'd like the more fun thing of doing some magic clustering ensuring you have N different copies of it running at a time.
@whitequark@migratory@wingo This is a very insightful way of dealing with credentials. We will eventually have natively doing this for you, but it will look like this.
2) Within probably around 1 second, every host will have that new SSL cert deployed and running.
Does that sound acceptable?
(Modulus etcd <--> machine latency should probably be < 100ms, since that's the default etcd raft timeout... You can change this but we never experimented with that.)
@purpleidea@migratory@wingo the way git-pages works is that it automatically gets SSL certs for any user domain; eg you push a site to purpleidea.grebedoc.dev and it autonomously talks to LE the first time anyone connects to purpleidea.grebedoc.dev:443 (or the same with a custom domain)
@whitequark@migratory@wingo Gotcha. It might take me a bit of digging to figure it out, but I can probably get at least the rough template there, and it's likely you'll know exactly where I missed the point.
Are you interested in joining our matrix channel where it might be easier to go back and forth on this or has matrix scarred us all too much? 😅
I'll try and get some initial code running as a POC.
fwiw i have seen legit usecases, but the majority of them are "we need to deploy some software across a cluster, elastically" and use k8s as the glue to build out a service for on prem
for cloud stuff i guess it's kinda an extra layer between you and aws/google, but an extra layer with a similar api and consistent tooling
but honestly it's still overkill, much in the same way we use docker so webdevs can install code as root, without having to do static linking