Selecting deployment target(server) for a given flow

165 views
Skip to first unread message

Mahesh Govind

unread,
Jul 12, 2016, 2:22:39 AM7/12/16
to Node-RED
Hi ,

Can I select a specific deployment target for a given  flow .
The scenario -

- I have a server which serves the UI .I will create flows using the ui.
- I have a farm of node.js servers . I want to select one server from the farm  and deploy my flow on that specific server.

Could you please give me some pointers to achieve the same .

regards
mahesh

Nicholas O'Leary

unread,
Jul 12, 2016, 2:25:38 AM7/12/16
to Node-RED

Hi

You can push flows to a remote runtime instance using the admin rest api... so you could create a system that pushes a given set of flows to a targeted runtime.

But what you can't do today is run an editor by itself - it is still coupled to a runtime instance. Nor are there the necessary hooks in the code for you to add your deploy logic.

We've been (slowly) moving towards separating them out in the underlying code, that would enable you to run them as individual components. But we aren't there yet.

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Mahesh Govind

unread,
Jul 12, 2016, 2:47:35 AM7/12/16
to Node-RED
Thank you Nick.

Please let me know whether the following understanding is correct .

1) Each of the instance will have an editor attached to it .
2) I can write an app which will point to an instance using admin rest api .
3) My UI will call admin rest API .

Could you please let me give me some pointer in the code where I could try to decouple editor from  backend .
I started by looking editor/js/deploy   [dont know whether it is right  place to get an intuition ]  . I was not getting the right flow of invocation of  back end rest APIs from UI .

regards
Mahesh

steve rickus

unread,
Jul 12, 2016, 12:09:18 PM7/12/16
to Node-RED
Mahesh-

This sounds very similar to a blog post I read -- it explains how to use a Node-Red flow to generate JSON text representing a Node-Red flow, and deploy it to a remote Raspberry Pi. From there, it's a small step to send the same flow to one-or-many instances running in a server farm through HTTP Post. I was able to take this a few steps further and build flows from database records, deploying them to other running instances on my local machine (using different ports).


It's all fairly straight-forward, once you get your head around the concepts. The main caveat is to make sure you don't deploy the JSON flow to the same instance as the current editor that builds the flow -- that would overwrite all of your hard work (trust me)!

One change I found since that blog post was written: the author uses the numbers 1, 2, 3, ... for node IDs (yes, if you are generating the JSON representing a flow, you need to create/manage the node IDs yourself!). Since the 0.14.x released, the RED.util.generateId() method is now available from within a `function` node -- very handy!
--
Steve

 

Joe Morris

unread,
Jul 3, 2017, 5:08:28 PM7/3/17
to Node-RED
I know that this thread is a little old. The referenced link is not present anymore. I have searched for it. Does anyone have a reference to the content?

Thanks

Joe

Nick O'Leary

unread,
Jul 3, 2017, 5:11:11 PM7/3/17
to Node-RED Mailing List

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
0 new messages