Hi,
I currently operate and manage 10 Prusa printers with OctoPrint, and things are getting out of hand already.
Is there a way to have one main Raspberry Pi running OctoPrint instance as "main" so that any changes done to it are replicated across all other OctoPrint instances?
I would love to have plugin management done in this fashion, so if plugin update command is issues that all instances do this. Also if plugin is added or removed, or settings change, that these changes are propagated to all devices.
There's been discussion on this in the OctoFarm Discord server. It seems the most common approach is scripting it all on the backend, with cron jobs and such for files and config.yaml updates, but don't remember ever seeing any discussion as to plugin management between all of them. There was talk of potentially scripting the plugin installs, but it never really went any further than that.
I suppose you could technically script a backup via octoprint CLI commands, git commit/push or upload that backup somewhere and then have cron job scripts to pull/download the latest backup and restore it. Then you just have to deal with restarting octoprint while not printing, not sure if the restore CLI commands would automatically do that or not.
This is relatively straightforward if you aren't using individual Pis for each printer, but if you have multiple instances running off of a single Pi or other hardware. Example, I run around 10 printers off of a single linux box. They all use the base octoprint installation, so they share the same plugins, updates, etc. If you update one, all of them will be updated the next time they restart.
I very much agree with you. If you have a single PC running multiple OctoPrint instances, it only takes one PC crashing to take down all OctoPrint instances. But adding multiple serial ports to a single (powerful enough) PC is not the problem.
To each their own. I find a Pi per printer to be a waste of hardware when all the printers are in close proximity and overall I find Pi's WiFi to be significantly less reliable than a single ethernet connection to a printer server. A linux box with an LTS distro that just serves octoprint instances and a couple of cameras doesn't just crash randomly. Plus, you get the ability to update everything at once for all instances, as described. Additionally, you can sync access control between all instances in a shared printer environment through a few symlinks (though moved to LDAP plugin for this now).
I have used docker containers extensively, but I don't see the benefits of using them for octoprint instances... but maybe someone can give some interesting use-cases where it makes sense.
I tried something similar myself a few months ago (as I now have 6 instances of octoprint to look after).
I got as far as treating one as a 'primary', listing the installed plugins and then ssh to each of the others to try and install the same list.
But that was before I started using ansible properly.
It looks like the pip module support venv's, which is how octopi/print is installed isn't it? https://docs.ansible.com/ansible/latest/modules/pip_module.html
Which means that could be a way to do it remotely.
In a similar vein, I've got zabbix checking for ubuntu/debian updates and installing them automatically.
So if there were some way to correlate the json from the plugin repo (which seemed like the most obvious source for checking) with what you have installed, it might be relatively easy (he says hopefully).
On your workstation, push your public key over to all ten Pi computers. ssh-copy-id -i ~/.ssh/id_rsa.pub pi@octopi.local (for example)
Once this has been done, you can then remotely run shell commands. ssh -t pi@octopi.local "./scripts/somescript" Personally, I wouldn't want anything which auto-updates printers since a particular printer could be running a job and shouldn't be interrupted. So keep a log of your computers and update them yourself based upon your schedule. The good thing about this is that you can upgrade one, run it for a week and verify that nothing is now broken. Then upgrade the rest.
I'm trying to get a list of outdated OctoPrint plugins and to update them via pip comand in cli, but when I run this command I don't see any OctoPrint plugins listed as outdated but Plugin Manager in Webui is giving me a list of outdated plugins. Why?
/oprint/bin/pip list --outdated
Which command can I use to get list of outdated OctoPrint plugins and how can I update them via cli?