CTL architecture

From ControlTier

Revision as of 10:29, 21 October 2011 by Xandersears (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This section describes core concepts that underly the CTL software and its use.

Contents

Framework

Framework built using the CTL APIs, to execute specified actions. The dispatching framework also provides projects for managing project configuration files, modules, resources and their instance data. Several utilities are included to execute commands and administer the framework.

Figure 1: CTL Software

The following diagram describes the components comprising the CTL framework.

Framework.png

Command dispatcher

The diagram below describes the command dispatching mechanism for a local command execution. When a user issues a command it is invoked via the Framework component. Internally, the Framework looks up the needed execution strategy based on the commands parameters. Local commands are executed by resolving the command to a module and command handler. The execution strategy loads the handler and creates a data binding context based on user input, command parameters, and model context data. The Framework then invokes the strategy to execute the command.

Local command dispatch

A module is a self contained component in the CTL system, responsible for its own data, its own activities, and the integrity of its actions. Module data is in the form of properties, key/value pairs, while its operations are defined in terms of commands.

The command dispatcher supports an object oriented programming paradigm. Modules are defined in terms of the ControlTier type model. Modules inherit commands from their "supertype", and can override inherited commands or define entirely new commands.

Module-concept.png

Users can define instances of types, called objects and call commands in the scope of their instance data. It is the framework's dispatcher that does the lookup for the named command specified by the user, resolve it to a command implementation and object, prepare a data context, and execute the implementation code.

For an internal view of the command dispatching mechanism see: Model-driven command dispatching

Projects

The framework repository is organized into projects. For each project name, the framework provides a file structure. Within each project, there is a space for configuration, a module library, and an resource model store.

Nodes

A machine hosting a CTL software instance is called a node. By convention a node can take on one of two roles, target node or admin node. A target node is one that receives commands from an admin and executes them. An admin node is a central server from which remote management of target nodes will be performed. Typically, the admin node hosts a #Repository.

Node-command-concept.png

Nodes are described with metadata in the nodes.properties configuration file. This metadata is used by the node dispatching mechanism, and facilitates keyword based filtering.

Command Dispatching

The internal dispatch mechanism supports an execution strategy referred to as nodedispatch. The dispatcher is able to lookup the node of the target, dispatching the command remotely or locally as appropriate. This feature provides network abstraction to distributed command execution and makes management of server pools and clusters more convenient.

Nodedispatching.png

The command dispatcher supports two styles of dispatching:

The nodedispatch strategy uses SSH to invoke CTL actions on remote hosts.

Modules

A module is a packaged set of defined commands created to execute some set of procedures. Modules can be likened to a plugin to the framework. Once a module has been installed the framework's command dispatcher provides access to execute its commands.

New modules are developed with ProjectBuilder or generated by Graphical type editor.

Modules are organized into an inheritance hierarcy of super- and sub-types to support generic/specific behavior and provide a means for reuse.

The figure below shows how a user executes a command via CTL. The dispatcher receives the request to run a command, looks up the command's handler, and then, provides as input, a data context that can be managed within the framework.

Figure 2: CTL Dispatching

Fwk-graph.png

Module Structure

At a file level, a module has a directory stucture that organizes files into several locations. Modules are defined in an XML file called type.xml. The ProjectBuilder build-type command reads the type.xml file and generates an executable set of commands. Alternatively, Workbench can be used to develop any aspect of a type and then be generated into a CTL module.

Figure 3: Module structure

Cmdmod.png

Inside the type.xml file, you define one or more commands. Commands can be used to control life cycle actions but can also be used to control processes and interface with other tools. The implementation of a command is called its handler. Command handlers are XML files that read property files to establish a data context and execute the defined action.

Given the supplied parameters, the dispatcher knows how to lookup command handlers in the module library, generate a data context, and execute them.

Figure 4: Command dispatcher mechanism

Command-dispatcher.png

A fundamental tenet in CTL is to "soft code" commands by stating important detail in data files in order to separate the procedural logic from environment detail. This leads to commands that are more flexible and reusable in different environments.

Data Context

As mentioned earlier, commands in CTL are driven by a data context. The CTL framework assumes standard data files generated from the type.xml file but you are free to create and use data from any source for your commands.

Data you might store in the property files include:

The framework uses several configuration files where global configuration data is stored. Every command handler can access this global data as it is loaded by the dispatcher when the handler is loaded.

CTL uses Java property file format, key-value pairs, as its native format. Global configuration is stored in the framework.properties file.

Module Context

The module defines several standard property files:

  1. module.properties: This contains metadata about the module.
  2. type.properties: This contains attribute data
  3. commands.properties: This contains metadata about each command such as command parameters.

Modules load this property data when executed. Other data can be stored in other files and read in by the command handler.

Resource Context

When there is a lot of data, or when your commands need to use different sets of data depending on environment or location, the CTL framework provides the capability of defining resources to organize and discretely maintain the data. See the Category:Resource model page for more information about defining and using resources.

The standard file for storing resource specific data is called the resource.properties file. This file can contain anything you wish and it is obtained and updated via the Managed-Entity Get-Properties command.

File share

An important facility for managing a network of CTL nodes is a central file share. The file share is used as a common repository for various artifacts. Once command modules have been developed they can be stored in the file share so that they can be distributed to nodes that require them. The file share can be a simple web server or if one wishes to publish files via PUT, a server based on WebDAV.

The file share organizes content into the following categories:

Each project name on the file share has a directory for each of these content categories:

Repo-structure.png

Glossary

Personal tools
Namespaces
Variants
Actions
Navigation
Communication
Development
Toolbox
Print/export