Archived

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

IceGrid and targets

We have been trying to migrate from 1.4 w/ IcePack to 3.0 w/ IceGrid. We have all the basics working and there appear just to be a couple of issues left.

One of them involves clarification on specifying targets on a per-server basis in both when initially deploying using icegridadmin and when trying to deploy a service programmatically during run-time. We have been doing both using 1.4 like this:

<application>
<node...>

<server name="XXX"
descriptor="..."
targets="debug ..."/>


AND (in the code)

IcePack::Admin::addServer( ...., targets )

After poring over the 3.0 manual and CHANGES logs, it seems as though we can no longer do these things. For example, there are no "targets" XML elements or API for any of the descriptor objects. Section 36.14.1 implies that to selectively deploy targets we must do so with fully-qualifed names when we first add an application. Is this meant to replace the 1.4 way of doing things when you could specify targets on a per-server basis?

There also appears to be no way to programatically apply a target as we could using addServer in v1.

Can users only specify targets now when deploying an application using icegridadmin? If so, must we specify the set of all possible targets including those for all possible future services that are added dynamically (using IceGridAdmin.updateApplication or instantiateServer) at that time?

Any help, pointers, references to docs, etc would be greatly appreciated.
(We try posting these forum questions only as a last resort.)

Thanks,

Brian

Comments

  • xdm
    xdm La Coruña, Spain
    With IceGrid you can deploy any number of nodes or servers and deploy any number of services in each node, you can do a lot of thinks more

    you can update your application with the icegridadmin command interface or using the java Ui

    In Ice book 36.12 you have a complete reference for xml descriptors, 36.19 Migration guide from IcePack to IceGrid.

    How i use IceGrid is deploy and application add nodes to the apllication deploy services in each node, i now learning how replicate this services but seems very plain using icegrid standar features.
  • Ummm, Jose. Appreciate the reply, but you have missed the point of the question. We have read the migration guide and other pertinent sections of the manual. We have used Ice extensively with version 1. The question is specifically related to the use of targets in 3.0.

    Brian
  • benoit
    benoit Rennes, France
    Hi Brian,

    As you discovererd, targets are more limited with IceGrid (they were actually already more limited with IcePack in Ice 2.x). Targets can only be used in XML files and since XML files are parsed by the icegridadmin tool (they were parsed by the IcePack registry in Ice 1.4) you can only use them when the application is deployed or updated from an XML file, i.e.: with the "application add" and "application update" commands. You can't use targets with the IceGrid::Admin interface.

    Targets allow to re-use the same set of XML files for different initial deployments (debug vs. non-debug, developpment vs. production, etc) but once the application is deployed, the deployed application stored in the IceGrid registry doesn't have anymore any information about targets.

    If you used targets to define different properties, you can use variables instead, for example:
       <icegrid> 
           <application name="Dummy">
               <variable name="network-trace" value="0"/>
            
               <node name="node1">
                  <server id="svr1" ...>
                    ...
                     <property name="Ice.Trace.Network" value="${network-trace}"/>
                   ...
                   </server>
                 </node>
            </application>
        </icegrid>
    

    You can easily change the value of this variable to enable/disable network tracing with the IceGrid admin GUI or with the updateApplication method of the IceGrid::Admin interface.

    If you tell us a bit more about your use of targets, we could try to see how to migrate them to IceGrid.

    Cheers,
    Benoit.
  • Benoit,

    Thanks so much for the clarification. Instead of using targets, I ended up using a template parameter for a target that we used to increase JVM memory:

    <server-template id="JavaServerTemplate">
    ....
    <parameter name="memory" default="64"/>
    ....
    <icebox ....>
    <option>-Xmx${memory}m</option>

    When we add a service dynamically using instantiateServer, there is now a property:

    Client_Local.Descriptor.Parameter.Memory=256

    In the code:

    String memoryProp = ...getProperty( ... );
    IceGrid.ServerInstanceDescriptor descriptor = ...
    instanceDescriptor.template = "JavaServerTemplate";
    HashMap paramValue = ...
    paramValues.put( "memory", memoryProp );
    descriptor.parameterValues = paramValues;
    IceGrid.Admin.instantiateServer( ..., ..., descriptor );

    Although not quite as flexable as our use of targets once was, this seems to work fine.

    Again, thanks for the reply.

    Brian