Archived

This forum has been archived. Please start a new discussion on GitHub.

custom patcher with icegrid

Hi,

I'm trying to deploy an application through an icegrid. But few config files depend of the computer (network interface, IP,...). So I'd like to run a post-install task to set those parameters.

From my understanding, I need a custom patcher, to specify in the finish method the task to run. I haven't found a way on the NodeI to specify the patcher. This means that I need a custom NodeI as well and I will have to install my specific icegridnode. Is all of this correct? or is there an easier way to get the job done?

Tiebreaker: the post-install task needs parameters, depending of each computer. All of them are centralized in a db and I'd prefer only the registry node has access to it. What is the best way to pass the parameters to the node during the patch? server's properties?
Thanks in advance

Quentin

Comments

  • Few talks and thoughts and one night later...
    I think I took the problem the wrong way. I will divide the deployment in two phases, instead of trying to everything in one with icepatch: a patch and a adminserver on each node able to do the postinstall task.
    Regards
  • benoit
    benoit Rennes, France
    Hi,

    It's not exactly clear to me what you need to do in this post-installation task. The servers deployed on different nodes can get "node-specific" configuration through several means:
    • environment variables: you can set environment variables in the environment where the node is executing and these environment variables will be accessible by servers forked by the node.
    • node override properties using the IceGrid node "IceGrid.Node.PropertiesOverride" property. Properties set with this property in the node configuration will be passed to all servers forked by the node. For example:
      IceGrid.Node.PropertiesOverride=Ice.Default.Host=127.0.0.1
      
    • variables specified at the node scope in the XML descriptor:
          <node name="node1">
            <variable name="host" value="127.0.0.1"/>
            <server id="SimpleServer" exe="./server" activation="on-demand">
      	<adapter name="Hello" endpoints="tcp">
      	  <object identity="hello" type="::Demo::Hello" property="Identity"/>
                <property name="Ice.Default.Host" value="${host}"/>
      	</adapter>
            </server>
          </node>
      

    If this isn't just about configuration but also performing post-installation specific tasks (creating files/directories) then yes you can get this done by some specific and dedicated servers that you will start after the deployment. Another option would be for your servers to take care of this on startup: if they detect that something they need isn't installed they would first install it.

    Cheers,
    Benoit.
  • Hi Olivier,

    Thanks for your answer. The post-installation has to write IP addresses and interfaces in some files: the executable is not an ice application (and I can't modify it) and there are too many parameters to handle them through the command line.

    I will try wrap the application in a script to do the check.

    Thanks