I’m running Node-RED in Docker (and it will be running in Kubernetes soon). I’d like to add custom nodes that are Docker containers themselves. For example, one node will be a local LLM, and another will have some heavy logic running in another Docker container, and so forth.
ok, I've used the wrong example. Imagine some heavy processing script written in python. Any way to wrap it inside a docker container that is then wrapped inside a node-red node so that I can use it in node-red ?.
there is nothing stopping your node-red executing docker commands and spinning up containers.
Another way could be to have multiple node-reds running and offload work to them using simple MQTT comms as a control + command API.
keeping everything in Node-RED will give the visual benefits.
company hat on for a moment - most of what you are asking (like spinning up more nodes, docker/Kubernetes orchestration) has pretty much been solved by FlowFuse (which is open source) - maybe worth checking it out?
a 'node' within node-red is a node js library which is wrapped as an npm package, which are javascript files that contain all the complexities and functionality. Docker is used for containers, something completely different.
Imagine some heavy processing script written in python
I would do the 'heavy processing' in javascript, although you could call the python script from javascript.
yes, I see it. The problem I'm facing is that there is a team creating docker with scripts (and all the dependencies with it) on them written in different languages (such as Python... but not only). So I can run the script with a single docker command line. Now I'd like to create node-red nodes that simply wrap each of those docker so that I can create flows. I guess that it would be something like calling a docker command from JS.... something like Docker in Docker (as node-red is already running in docker).... So wondering if any body did something similar...