5 ms·
Ask HN: How do you manage cross-system dependencies?
On Debian (and many other Linux distros), managing dependencies on a single system is easy. Just declare that package "web" in Version 2.3 depends on package "backend" in Version 0.3.1 or higher. If you try to install "web-2.3" but your "backend" is too old, apt-get/aptitude will complain.
How do I get the same/similar behavior when the frontend and backend are on different servers?
When I heard of "orchestration" tools, I hoped they'd solve that problem, but the products I looked so far look like schedulers / pipelining systems, not like dependency managers.
What tools do you use to manage dependencies on multiple servers?
(In case it makes a difference, we use mostly Debian Jessie, and deploy our software as .deb packages via GoCD. Puppet is used for configuration management, though not for the deployment)
- olalonde 11y agoThe closest I've found to something like this is docker-compose though I'm not sure it can be used reliably on clusters. https://nixos.org/disnix/ https://nixos.org/disnix/ might be worth looking into though I haven't personally used it.
- perlgeek 11y agoThanks, disnix looks really interesting. I'll do some reading (and maybe experimenting).
- spotman 11y agoYou would architect your application to not be so brittle that deploying one wrong package takes the service down. For example if you have to make breaking changes try to make your backend smart enough to handle web2.2 and web2.3. Tools like configuration management (chef, puppet, ansible, etc) can help you roll out the different versions , and interrogate servers to see what is installed on them. So in the case of rpm/deb, if you need to update a package and it comes with dependencies I would let the package manager resolve them. But specifically if your packaging your own application components in this format you would not have control to tell server A to be dependent on server B's dpkg state. That would be complicated and brittle. You want to use rpm/deb/etc to resolve local dependencies only. For setting up infrastructure that needs supporting infrastructure at a certain version to work well this must coordinated at some level even if by hand. These days there is more than several handfuls of different ways to approach this. I recommend chef or ansible if your new to configuration management. Edit: oh you use puppet already I see. Just have puppet update packages as needed, and consider using it for deploys. You can group systems together conceptually and do all kinds of things even blue/green deploys, rolling deploys etc. you can use mcollective to see what packages are where.
- perlgeek 11y agoThanks for your reply. It's clear that you've put a lot of thought into it, but I'm still struggling make it useful for me. > These days there is more than several handfuls of different ways to approach this. I recommend chef or ansible if your new to configuration management. As far as I can tell, neither ansible nor chef really help me with answering questions like "can I deploy service X in version Y to machine Z, or are dependencies missing?". Or do they? If yes, how? Or did I misunderstood what exactly they should help me with?
- spotman 11y agoLets give a quasi specific example maybe.. lets say you have service X, is your ApiService 1.2, and it's in production. Lets say you have machine 1 and machine 2, both running ApiService 1.2 In puppet, you could use hiera to know what version of ApiService a machine should have. You can use mcollective to interrogate these machines to verify that puppet successfully installed ApiService 1.2 on these machines. Now, to answer the question "can i deploy ApiService 1.3 on machine 1", I think that that would be best answered by testing this in a development/staging environment with another machine that is not serving mission critical traffic. Here you would do the testing you need, and ensure it works, both in a installation capacity (say ApiService 1.3 needs a newer version of libxml2 or something), and in a general "does it pass QA" standpoint. It would be your package maintainers job to specify that ApiService 1.3 requires libxml2 version XYZ. Puppet/etc (or, specifically when dpkg runs via puppet) would fail to install the package if its not going to have libxml2 version XyZ. Being that it's your package, you would write it in a way that dpkg is able to install it on the target servers your targeting. So, you could even spell it out exactly in puppet to, "before installing ApiService-1.3.deb, install libxml2-2.x728.deb" If what your getting at, is that if ApiService 1.3 on machine 1, relies on libxml2 being updated on machine 2, then that sounds a bit brittle to me and should be refactored to be more forgiving. Maybe that helps make it more clear, if in doubt will look for more comments.
- perlgeek 11y agoLet me see if I got this one straight: So puppet has some infrastructure for querying package versions (and other facts) (mcollective), and a way to store the dependency data (hiera), but the actual management still has to be done manually (potentially by trial & error in a dev/test/canary environment). Right? If yes, that's good to know, but still less than I was hoping for.