Tuesday, September 29, 2009

3.4.8 Feature: Exporting project.xml

A much requested feature has been implemented for 3.4.8, project.xml export, both from the command line via ProjectBuilder and via the GUI using Workbench.

Most ControlTier users manage their project model using XML files that define the resources that comprise their application and their environment. The ProjectBuilder module provides a command to upload these XML files to the ControlTier server webapp, Workbench. Up until 3.4.8, Workbench did not provide a direct interface to export the same data back to XML. This was particularly annoying when a project model was setup using the GUI interface of Workbench.

Here's a resource model from one of the examples:

To export that data from Workbench click on the "simpleTomcat" object and in the toolbar you will notice an XML icon. Click that icon and the browser will be directed to a page that contains the project.xml.

The same can be done from the command line via the ProjectBuilder command, find-objects.
Below, the find-objects command is used to lookup the same "simpleTomcat" object and the exported model data saved to the file: /tmp/simpleTomcat.xml

$ ctl -p demo -m ProjectBuilder -c find-objects -- -type Service -name simpleTomcat -out /tmp/simpleTomcat.xml
Results stored in file: /tmp/simpleTomcat.xml

Here's the the content of /tmp/simpleTomcat.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project PUBLIC "-//ControlTier Software Inc.//DTD Project Document 1.0//EN" "project.dtd">

<setting type="Port" name="simpleTomcat-connector" description="The connector port used by Tomcat" settingValue="18080" settingType="TCP"/>
<setting type="ServiceSpawn" name="simpleTomcat" description="Whether to spawn separate process for the start script" settingValue="false" settingType=""/>
<setting type="ServiceStartScript" name="simpleTomcat" description="The script used by startService" settingValue="/Users/alexh/ctier/examples/service-package-deployment/start.sh" settingType="script"/>
<setting type="ServiceStopScript" name="simpleTomcat" description="The script used by stopService" settingValue="/Users/alexh/ctier/examples/service-package-deployment/stop.sh" settingType="script"/>
<setting type="ServiceIsDownScript" name="simpleTomcat" description="The script used by assertServicesIsDown" settingValue="/Users/alexh/ctier/examples/service-package-deployment/isdown.xml" settingType="script"/>
<setting type="ServiceIsUpScript" name="simpleTomcat" description="The script used by assertServicesIsUp" settingValue="/Users/alexh/ctier/examples/service-package-deployment/isup.xml" settingType="script"/>
<package type="war" name="simple-123.war" description="A simple webapp" filename="simple-123.war" filetype="war" base="simple" version="123" release="" arch="noarch" buildtime="123" vendor="" restart="false" installroot="${env.CTIER_ROOT}/examples/service-package-deployment/apache-tomcat-5.5.28/webapps" repoUrl="http://strongbad:8080/jackrabbit/repository/workbench/pkgs/demo/war/wars/simple-123.war" releasetag="" installrank="2"/>
<deployment type="Service" name="simpleTomcat" description="The Tomcat deployment." basedir="/Users/alexh/ctier/examples/service-package-deployment/apache-tomcat-5.5.28" installRoot="/Users/alexh/ctier/examples/service-package-deployment/apache-tomcat-5.5.28" startuprank="">
<resource name="simpleTomcat" type="ServiceIsDownScript"/>
<resource name="simpleTomcat" type="ServiceIsUpScript"/>
<resource name="simpleTomcat" type="ServiceStopScript"/>
<resource name="simple-123.war" type="war"/>
<resource name="simpleTomcat" type="ServiceStartScript"/>
<resource name="simpleTomcat-connector" type="Port"/>
<resource name="simpleTomcat" type="ServiceSpawn"/>
<referrers replace="false">
<resource name="strongbad.local" type="Node"/>

With the XML exported to a file, it can be checked into a source code repository and later uploaded to the server again.

ControlTier 3.4.8 Released

ControlTier 3.4.8 has been released.
This is primarily a bug fix release, but some notable improvements have been made as well.

Documentation: The ControlTier Wiki

Notable bug fixes:
  • Conflation of Node name vs. hostname cropped up again in node-dispatch with CTL and the integration with Workbench. It should finally be completely resolved.
  • ProjectBuilder#find-objects has duplicate results: The find-objects command will now only show unique results.
Notable Improvements:

  • Java 6 support: Both the client and server now support Java 6.
  • project.xml export: Workbench and the ProjectBuilder#find-objects command can now export project.xml formatted data. Either use the -out option to find-objects, or click the "XML" toolbar button when viewing a resource in Workbench.
  • The Maven plugin has been updated to support static commands.

Wednesday, September 02, 2009

ControlTier 3.4.7 Released

ControlTier 3.4.7 has been released.
This is primarily a bug fix release, but some notable improvements have been made as well.

Documentation: The ControlTier Wiki

Notable bug fixes:

Node name/hostname are now correctly distinguished when installing deployments. You can now have two Nodes with the same hostname, as long as the Node names are unique, and ctl-depot -a install will work correctly.



Workbench service manager views now display any Tags associated with a resource in the manager list view. Tag searching is also now fully integrated in the Workbench user interface.

Node Filtering:

CTL and CTL-EXEC now support using arbitrary attributes as node filters in the -I/-X arguments. E.g. "ctl-exec -I myattribute=something -- echo hello".

Retrying failed commands:

CTL and CTL-EXEC now also support a -F flag which lets the user specify a filepath to store a list of nodes for which failures occur. When you execute across multiple nodes using the -I/-X node filter options, and use the -K (--keepgoing) option, any nodes for which a failure occurs will be stored in the specified -F file. You can then re-execute with the exact same commandline, and CTL/CTL-EXEC will only execute on the nodes listed in the given file. If further errors occur, the nodelist will again be stored in the same file. Once all nodes have executed succesfully, the file will be removed. This facilitates retrying a failed command only on the failed nodes either manually or automatically.

Environment variables in scripts:

A new default mechanism for executing defined shell commands called "shell-exec" is introduced. This allows shell scripts/commands to acquire environment variables with values passed directly from the set of ControlTier metadata available to all commands.


Installer script improvements provide a much smoother way to install ControlTier on cygwin-based Windows nodes.

Dispatching scripts to cygwin nodes via ctl-exec or Jobcenter now works correctly when the Node has os-family="cygwin", and registration of a Node via a ControlTier client installed on a cygwin node will correctly set the os-family of the Node.