Profile Specification

From Gcube Wiki
Revision as of 04:23, 18 July 2008 by Manuele.simi (Talk | contribs) (Package types)

Jump to: navigation, search

Alert icon2.gif THIS SECTION OF GCUBE DOCUMENTATION IS PARTIALLY OBSOLETE. THE NEW VERSION IS UNDER CONSTRUCTION.

Preliminary definitions

gCube resources and profiles

A gCube Resource is anything whose related information can be gathered, stored, monitored, and disseminated in order to provide the valuable amount of knowledge needed during the creation and management of a VRE as well as to operate an entire gCube infrastructure. In order to be appropriately managed and discovered, a gCube resource has to be described by creating a profile document compliant with its XML schema. The following resources have been identified:

Such resources can be combined or created at VRE creation time in order to set up a new Virtual Research Environment.

The gHN resource

A Grid Hosting Node (shortly, a gHN) is the resource modelling a node of an infrastructure able to host gCube Running Instances.

[TBC]

The Service resource

Usually, a Service is defined as a software system that delivers functionalities. In gCube, a Service is a not-empty set of related Packages (connected through dependencies) forming an unique logical entity. A Package is the smallest installable unit of software that can be deployed on a gHN (e.g. a JAR o a GAR archive). Packages are the way in which the software needed to set up a VRE has to prepared in order to be used and stored in the system. Once the service components have been developed, they must be described by compiling the service profile.

Package types

Concretely, a Package is a “piece of software” that can be deployed on a gHN. A Package can be:

  • a MainPackage, representing a package that once deployed produces a WSRF Service (a service able to manage stateful resources following the WS-Resource patterns);
  • Software, a software library (typically composed by one or more JAR archives) offering functionality for interacting with Service or a thirdy party software distributed with the service that can be dynamically deployed;

About how to define a package, see the Packages section.

Composition

The set of Packages forming a Service is composed by:

  1. one and only one MainPackage
  2. an arbitrary number of other Packages of different types logically related (even if not used) to the MainPackage

An exception to this rule is represented by the Software Archive.

The "main" part of a Service is, of course, the MainPackage from which the related Running Instance resource is generated. The other packages can be:

  • helper modules developed and used by the MainPackage
  • thirdy parties software used by the MainPackage
  • helper modules developed and distributed with the MainPackage in order to be used by other Services to interact with a Running Instance of the Service.
How to specify dependencies

A package, once deployed, can rely on other software to perform its activities. Let's see how to specify these dependencies by distinguishing among:

  • software developed within this service (this is the case of a stub library, for instance)
    → the software has to be declared as Library and the dependency is specified as package Dependency
  • software developed and distributed within other DILIGENT services
    → the dependency is specified as package Dependency against a package defined in another Service profile
  • thirdy party deployable software used only by this service
    → the software has to be declared as Software or Library (it depends on the nature of the software) and the dependency is specified as package Dependency
  • thirdy party deployable software used by other services
    → the software has to be uploaded in the ETICS repository, the package has to be declared as ExternalSoftware and the dependency is specified as package Dependency
  • thirdy party software that is not dynamically deployable
    → the software has to be manually installed, the label has to be manually declared in the DHN profile (by the DHN owner) and the dependency is specified as DHN Requirement

How to compile a Service profile

The following example shows the common elements that compose the Service profile. The Package-specific sections are explained apart later.

<Resource xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <UniqueID/>
	<Type>Service</ResourceType>
	<Scopes>
	</Scopes>
	<Profile>
                <Description> ...a description...</Description>
                <Class> ... a class name... </Class>
                <Name>...a service name...</Name>
                <Version>\d{1,2}+.\d{1,2}+(.\d{1,2}){0,1}</Version>		
		<Dependencies>
			<Dependency>
				<Class>...</Class>
				<Name>...</Name>
				<Version>\d{1,2}+.\d{1,2}+(.\d{1,2}){0,1}</Version>
			</Dependency>
			<Dependency>
				<Class>...</Class>
				<Name>...</Name>
				<Version>\d{1,2}+.\d{1,2}+(.\d{1,2}){0,1}</Version>
			</Dependency>
			<Dependency>
				<Class>...</Class>
				<Name>...</Name>
				<Version>\d{1,2}+.\d{1,2}+(.\d{1,2}){0,1}</Version>
			</Dependency>
		</Dependencies>
		<SpecificData/>
		<Packages>
                 [...]
		</Packages>
	</Profile>
</Resource>

Common elements

Class

The class of a service is its functional area. It's a free text field that should group packages belonging the same logical functionalities.

Name

The Name is an arbitrary string that uniquely identifies the service within a service class.

Version

The service version in the format: \d{1,2}+.\d{1,2}+(.\d{1,2}){0,1} (e.g. 1.0.12 or 1.0)

Dependencies

A gCube service is part of a complex system and it makes use of other services. At VRE definition time, firstly, it is compiled the list of services that satisfy the VRE definition criteria and, then, such a list is completed with the other services that allow the first ones to work properly. Therefore it is needed that a service declares which other services it will need to be available in order to do its work once it is deployed.


Packages section

This element groups an unbounded sequence of Package-derived elements. Each element describes a package that comes with the service. The structure of a Package element includes an initial common part and a package-specific part rooted by an element named as the service type (MainPackage and Software). The only constraint is that one and only one MainPackage element is accepted in the list.

Common elements
Example

The following example shows the elements of a Package definition common to both types of Package.

<Package>
	<Description>Describes port-types</Description>
	<Name>ResultSetService</Name>
	<Version>1.0</Version>
        <Mandatory level="VO"/>
	<Shareable level="VO"/>
	<GHNRequirements>
		<Requirement category="Site" requirement="string" value="java1.5" operator="ge"/>
	</GHNRequirements>
	<Dependencies>
		<Dependency>
			<Service>
		   		<Class>Search</Class>
 		   		<Name>ResultSetService</Name>
 		   		<Version>1.0</Version>
			</Service>
			<Package>ResultSetService-stubs</Package>
			<Version>1.0</Version>
			<Scope level="GHN"/>
			<Optional>false</Optional>
		</Dependency>
		<Dependency>
			<Service>
		   		<Class>Search</Class>
 		   		<Name>ResultSetService</Name>
 		   		<Version>1.0</Version>
			</Service>
			<Package>ResultSetLibrary</Package>
			<Version>1.0</Version>
			<Scope level="GHN"/>
			<Optional>false</Optional>
		</Dependency>
		<Dependency>
			<Service>
		   		<Class>Search</Class>
 		   		<Name>ResultSetService</Name>
 		   		<Version>1.0</Version>
			</Service>
			<Package>ResultSetGarbageCollector</Package>
			<Version>1.0</Version>
			<Scope level="GHN"/>
			<Optional>false</Optional>
		</Dependency>
	</Dependencies>
	<InstallScripts>
		<File>...</File>
	</InstallScripts>
	<UninstallScripts>
		<File>...</File>
	</UninstallScripts>
	<RebootScripts>
		<File>...</File>
	</RebootScripts>		
	<ConfigurationFiles>
		<File>....</File>
	</ConfigurationFiles>

	[package specific elements]		
</Package>
PackageName

An arbritrary string that uniquely identifies the package within this service.

Version

The version of the package. It has to be in the form of X.Y.


Shareable

It states if the package can be shared across multiple DLs (true) or if it is DL-Specific (false).

InstallScripts

This set of scripts are executed before the deployment of the package. They can be used to prepare the environment for the package execution (create a file system structure, install third parties software). The current folder where they are executed is the one where the package is downloaded and uncompressed.

UninstallScripts

This set of scripts are executed after the undeployment of the package. They can be used to clean up the environment. The current folder where they are executed is the one where the package is downloaded and uncompressed.

RebootScripts

This set of scripts are executed before each container startup.

Dependencies

The dependencies of the package are a list of other packages that allow the package to properly work. These packages *must* defined somewhere in the same profile (and in this case they have the same ServiceClass and ServiceName of the package) or in other profiles. It is important to point out that also the dependencies against the packages declared in the current profile has to be specified (like the one against its own stubs library).

A dependency is a declaration of the following elements:

  • Service
  • PackageName
  • Version (optional)
  • Scope level
..equals to "GHN" means that the package must be co-deployed on the same GHN
..equals to "VRE" means that the package must be deployed on a GHN and visible in the same VRE (typically used for dependencies against MainPackages)
..equals to "VO" means that the package must be deployed on a GHN and visible in the same VO (typically used for dependencies against MainPackages)
  • Optional
a false value means that the fulfilment of dependency is mandatory for a successful deployment of the package that declares the dependency

The example above defines three dependencies that requires that the stub classes of the ResultSet service, the ResultSetGarbageCollector and the ResultSetLibrary packages, all defined in defined in the ResultSet service profile, have to be co-deployed with the ResultSetService package.

GHNRequirements

A GHNRequirement is a requirement against the node where the package is deployed. These requirements are matched with the GHN profiles in order to find a suitable node that can host the package. A GHN requirement is composed by:

  • category
It is a name of an element in the DHN profile
  • operator
it is one of the following values:
  • eq (equal)
  • ne (not equal)
  • lt (less than)
  • le (less or equal than)
  • gt (greater than)
  • ge (greater or equal than)
  • requirement
It is one of the attributes/child elements defined for the selected category in the DHN profile
  • value
it is the value of the selected attribute defined for the category in the DHN profile

At the end of the story, a requirement is an expression evaluated in this form: <category/requirement operator value>

Example:

<GHNRequirements>
	<Req category="RunTimeEnv" operator="eq" requirement="Variable" value="java1.5"/>
	<Req category="OperatingSystem" operator="eq" requirement="Name" value="Linux"/>
</GHNRequirements>

The example above means: "I can be deployed on a DHN where there is a RunTimeEnv/Variable element equals to java 1.5 and an OperatingSystem[@Name] element equals to Linux"

A typical usage of GHNRequiremnts is when a package depends on a software that cannot be dynamically deployed. In this case, the software has to be manually installed and declared in the GHN profile as RunTimeEnv/Variable and then it has to be reported as DHN requirement in the package definition. A list of conventional labels that identify the software (and more in general, the GHN capabilities) has to be fixed:

  • java1.5 - a JVM v1.5 is available
  • gLiteSEAccess - the node is configured to access to a Storage Element on a gLite infrastructure
  • MySQLdb - a MySQL database is available
  • Oracle10g - an Oracle10g database is available

Of course, the list above can be enriched at any time.

ConfigurationFiles

...

Package-specific sections

MainPackage


Example:

<Packages>
	<Main>
		<Description>Describes port-types</Description>
		<Name>ResultSetService</Name>
		<Version>1.0</Version>
		<Dependencies/>			
		<GARArchive>org.gcube.searchservice.resultsetservice.gar</GARArchive>
		<PortType>
			<Name>gcube/searchservice/ResultSet</Name>
			<WSDL/>
		</PortType>
	</Main>

<Packages>
GARArchive

The full path of the GAR file. The path must start from the package folder. Example.

-ResultSetService
--archive
---org.gcube.searchservice.resultsetservice.gar

The declaration in the profile must be:

<GARArchive>archive/org.gcube.searchservice.resultsetservice.gar</GARArchive>
ArchitecturalPattern

This element declares the architectural pattern adopted by the WSRF service.

ServiceEquivalenceFunctions element: Fix the service equivalence

This element allows to define functions to use at runtime to understand when two Running Instances of the service are equivalents from a specific function point of view. They can be considered are a sort of criteria to find service's replicas. Each function defined here must have a corrispondent section in the Running Instance profile that gives the values to the formal parameter defined in the function. So far, the following fuction are used in the infrastructure:

  • match, used by the Active Planner service to discriminate among two Running Instances of the same service
PortType

A PortType is a WSDL interface generated by the deployment of the MainPackage's GAR. Each of them is declared in the Deployment Descriptor file (WSDD) with a <service> element.

Name

The value of the name attribute in the <service> element in the service's WSDD file.

Software

A Software package is a deployable library or a thirdy party package uploaded with the service.

Example:

<Packages>
	<Software>
		<Description>Describes port-type stubs</Description>
		<Name>ResultSetService-stubs</Name>
		<Version>1.0</Version>
		<Dependencies/>	
		<Files><File>org.gcube.searchservice.resultsetservice.stubs.jar</File></Files>
	</Software>
<Packages>
  • Files
The path and the name of the library's files in the service archive.