Hey all, I’m wondering what solutions people are using for managing deployments on multiple systems that need to run the same project. Ideally I’d like to be able to remotely deploy a complete configuration to a new machine without needing to configure Node Red and dependent modules. Or at minimum be able to deploy a new version of my NR code to an existing machine. I’ve seen the qbee.io software which looks good but possibly overkill for what I want and I thought there might be some open source tools to achieve a similar outcome.
I was about to start working on a set of scripts to do what I need but thought that someone must have built this wheel already. Thanks for any advice!
Thanks Colin. I'm using Projects and a github repository, just finding it cumbersome to configure all the necessary nodes and static dependencies for each deployment. I've started using a sledgehammer approach to backup the entire .node-red folder and copy this to a new RPI device. Any downside to this approach? I've had some problems in rebuilding nodes like SQLITE when copying between a RPI3 and RPI4.
What exactly do you mean? Running npm install from the .node-red folder should do most of what you need. Though I don't use projects so maybe that is not right. I use git but not with the projects feature. There aught to be some docs for the feature telling you how to move a project from one machine to another. Perhaps someone else could comment here as my assumptions about what projects can do may be wrong.
It may fail if the version of nodejs is not the same, or if anything about the hardware or OS environment is different. It is generally better not to copy node_modules but to rebuild it by running npm install from the node-red folder.
a solution I tried, port my NR in docker and create my own fully customized image.
Then we put it in a private dockerhub on the net.
In one of the flows of your application, you make a repetitive check (see below), let's say 1x per day to go see on a remote site if there is an update ready.
If you set the flag to Yes, then a script will be triggered on each remote Pi to download your image and thus transparently update the containers of the machines.
Be careful, you have to create an image per hardware architecture! But it's simple and fast.
The same machinery applies if you use grafana, influxdb, mosquitto, etc..
There is also this "Watchtower" container which checks the other containers in the Pi and verifies if there are more recent versions and updates them by itself or with confirmation.
I wanted to go all the way with this idea, but the physical devices connected via the USB port can have malfunctions when they are re-mapped into the containers. I've seen this especially with the serial node. I was getting erroneous values randomly, not often but enough to skew a graph.
As for the private data of the user, if there is any, it is very simple to put them in a directory of the Pi and map it in the container. Thus, the update of the container does not lose the personal data.
in this scenario, everything is free software but obviously not as strong as a pro solution.
Hey @Colin , Ansible, I've heard about it, is this software paid ?
Is it some kind of container orchestrator ?
I'm curious to know more about it.
NPM install doesn't seem to work properly. After running I still get a notification in NR that several nodes are not found. I tracked one problem down to a problem with SQLITE which wasn't rebuilding properly.
I realise that this isn't enough information, so I'm going to run a few more tests on a clean install to see what exactly the problem is so I can report back.
Ansible is free. It is available in Ubuntu and Raspbian via the apt repositories. I guess it can be installed on Windows, but I don't use Windows. It only needs to be installed on the central machine controlling the deployment, it drives the machines receiving the deployment via ssh. https://www.guru99.com/ansible-tutorial.html
Thanks @Colin for the link and clarification.
I just skimmed the text.
I see that the ssh port 22 must be rerouted via NAT through the client router, otherwise no remote management.
This is not the case in HTTP.
Ansible has no particular link with docker containers, I thought it went together and made for that. So you can have preconceived ideas.