Service Archive Specification

From Gcube Wiki
Jump to: navigation, search

Short background

A 'Service' in D4Science is a software system that delivers functionalities and it is composed by a set of related 'Packages'.

In the D4Science context, a 'Package' is a 'piece of software' that can be deployed in a GHN. Packages are single tarballs, compliant with the Package Model, that contain the files to be installed, along with rules describing software/packages dependencies, deployment instructions, etc.

Each service is described by a 'Profile' document, named 'Service Profile'.

For each Service Profile a corresponding 'Service Archive' should be delivered.


A Service Archive is a single TAR GZ file, which contains all the files declared on the Service Profile and has the following structure:

|  |--<GARArchive>
|  |--svnpath.txt
|  |--<additional files>
|  |--doc
|     \--api
|        |- index.html
|        \- others javadoc files
|  |--<LibraryFile>
|  |--svnpath.txt
|  |--<additional files>
|  |--doc
|     \--api
|        |-- index.html
|        \-- others javadoc files
   |--<additional files>
         |-- index.html
         \-- others javadoc files



  • at the root level, the archive contains the Service Profile of the service itself. All the file names included in the archive have to be reported with a relative path starting from their <PackageName> folder (not included) *as defined on the Service Profile*.
  • for every Package declared inside the Service Profile, the archive contains a directory (called with the same name of the PackageName field of the profile) including the corresponding jar/gar file:
    • for a WSRF service the name reported into the GARArchive field;
    • for a library/stubs the name reported into the LibraryFile field.

and any other additional file declared in the service profile (e.g. installation or reboot scripts)

In Main packages the 'doc/api' folder with javadoc is mandatory, optional for the others packages.

The 'svnpath.txt' file is mandatory for each packages and contains the link to the svn source code.

Creating Service Archives


An easy way to create a Service Archive is to do it manually.

  1. Create a folder structure as described in previous section according to the corresponding Service Profile.
  2. Create a TAR GZ file of the created folder structure.

Using ETICS to automatically create Service Archives

Create a new component in ETICS for each service profile you already defined in order to create the related Service Archive as artefact. Let see now how you should do this in ETICS.

  1. name the component as <ServiceName>-servicearchive
  2. declare a dynamic dependency against each ETICS component that produces a package to be included in the Service Archive. In this way, the packages forming the whole service are available and they are built immediately before they are packaged. Link this configuration with the corresponding parent configuration.
  3. use the CVS Commands to download additional files related to the whole service, but not included in the packages (like the Service Profile)
  4. use the Build Commands available in ETICS in the following way:
The init command has to be used to create the ${prefix} directory and all the <PackageName> subdirs

The install command has to be used to move the GAR/JAR files and other additional files from their ${moduleDir} directory to the appropriate <PackageName> directory previously created.
Copy the javadoc to the appropriate <PackageName> directory.
Furthermore echo command with vcsroot link have to be redirected to a file 'svnpath.txt' in the appropriate <PackageName> directory.

Leave this command blank. At the end of the build process the default ETICS package command will create a
tar.gz (the ServiceArchive!) of the ${prefix} folder

To better understand the final result of the process above, you can have a look to the *-servicearchive components already created in ETICS.


The following Profile describes a service and its stubs as two packages

<?xml version="1.0" encoding="UTF-8"?>
		<Mandatory level="VO"/>
		<Shareable level="VO"/>
			<Requirement category="Site" requirement="string" value="java1.5" operator="ge"/>
				<Scope level="GHN"/>
		<MultiVersion value="true"/>
		<Mandatory level="GHN"/>
		<Shareable level="VO"/>
			<Requirement category="Site" operator="ge" requirement="string" value="java1.5"/>

This service has to produce as ServiceArchive a tar.gz file with the following structure:

|  |--org.gcube.informationsystem.registry.gar
|  |--svnpath.txt
|  \--doc
|     \--api
|        |--index.html
|        \--others javadoc files

For this service archive the ETICS configuration is

mkdir -p ${prefix};
mkdir -p ${prefix}/IS-Registry-service;
mkdir -p ${prefix}/IS-Registry-stubs;

cp ${org.gcube.information-system.registry.moduleDir}/etc/profile.xml ${prefix};
cp ${org.gcube.information-system.registry-stubs.moduleDir}/lib/org.gcube.informationsystem.registry.stubs.jar ${prefix}/IS-Registry-stubs;
cp ${org.gcube.information-system.registry.moduleDir}/lib/*.gar ${prefix}/IS-Registry-service;
cp -r ${org.gcube.information-system.registry.moduleDir}/doc ${prefix}/IS-Registry-service;
echo ${org.gcube.information-system.registry.vcsroot}/${org.gcube.information-system.registry.tag} > ${prefix}/IS-Registry-service/svnpath.txt;
echo ${org.gcube.information-system.registry-stubs.vcsroot}/${org.gcube.information-system.registry-stubs.tag} > ${prefix}/IS-Registry-stubs/svnpath.txt;