Difference between revisions of "Software Archive Specification"

From Gcube Wiki
Jump to: navigation, search
(Updating the Etics configuration for the Service)
m
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
<!-- CATEGORIES -->
 +
[[Category:Developer's Guide]]
 +
<!-- END CATEGORIES -->
 
==Short background==
 
==Short background==
  
A 'Service' in gCube is a software system that delivers functionalities and it is composed by a set of related 'Packages'.
+
A 'Service' in gCube is a software system which delivers functionality. It is composed by a set of related 'Packages'.
  
In the gCube 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.
+
In the gCube context, a 'Package' is a 'piece of software' that can be deployed into a gHN. Packages are single tarballs, compliant with the Package Model, that contains the files to be installed, along with rules describing software/packages dependencies, deployment instructions and so on.
  
Each service is described by a 'Profile' document, named 'Service Profile'.  
+
Each service is described by a 'Profile' document, named ''Service Profile''.  
  
For each Service Profile a corresponding 'Software Archive' should be delivered.
+
For each ''Service Profile'' a corresponding 'Software Archive' should be delivered.
  
 
==Software Archive Structure==
 
==Software Archive Structure==
Line 44: Line 47:
 
  |        \-- others javadoc files
 
  |        \-- others javadoc files
 
  |
 
  |
 +
|-- README
 +
|-- MANTAINERS
 +
|-- CHANGELOG
 +
|-- INSTALL
 +
|-- LICENSE
 
  |
 
  |
 
  \-profile.xml
 
  \-profile.xml
Line 58: Line 66:
  
 
The 'svnpath.txt' file is mandatory for each packages and contains the link to the source code or to the library download location in cases of external library not open source.
 
The 'svnpath.txt' file is mandatory for each packages and contains the link to the source code or to the library download location in cases of external library not open source.
 
 
  
 
==Creating Software Archives==
 
==Creating Software Archives==
Line 104: Line 110:
 
The following Profile describes a service and its stubs as two packages
 
The following Profile describes a service and its stubs as two packages
  
<?xml version="1.0" encoding="UTF-8"?>
+
<source lang=xml>
<Resource xsi:noNamespaceSchemaLocation="service.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
<?xml version="1.0" encoding="UTF-8"?>
<ID></ID>
+
<Resource xsi:noNamespaceSchemaLocation="service.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Type>Service</Type>
+
<ID></ID>
<Profile>
+
<Type>Service</Type>
<Description>Description</Description>
+
<Profile>
<Class>Class</Class>
+
<Description>Description</Description>
<Name>Name</Name>
+
<Class>Class</Class>
<Version>1.0.0</Version>
+
<Name>Name</Name>
<Configuration>
+
<Version>1.0.0</Version>
<Static>
+
<Configuration>
<Configs>
+
<Static>
<Config>
+
<Configs>
<File>aux.txt</File>
+
<Config>
<Description>aux</Description>
+
<File>aux.txt</File>
<Label>aux</Label>
+
<Description>aux</Description>
</Config>
+
<Label>aux</Label>
<Config>
+
</Config>
<File>aux2.txt</File>
+
<Config>
<Description>aux2</Description>
+
<File>aux2.txt</File>
<Label>aux2</Label>
+
<Description>aux2</Description>
</Config>
+
<Label>aux2</Label>
</Configs>
+
</Config>
</Static>
+
</Configs>
<Dynamic/>
+
</Static>
</Configuration>
+
<Dynamic/>
<Dependencies>
+
</Configuration>
<Dependency>
+
<Dependencies>
<Class>DepClass</Class>
+
<Dependency>
<Name>DepName</Name>
+
<Class>DepClass</Class>
<Version>1.0.0</Version>
+
<Name>DepName</Name>
</Dependency>
+
<Version>1.0.0</Version>
</Dependencies>
+
</Dependency>
<Packages>
+
</Dependencies>
<Main>
+
<Packages>
<Description>Main Package Description</Description>
+
<Main>
<Name>Name-service</Name>
+
<Description>Main Package Description</Description>
<Version>1.1.0</Version>
+
<Name>Name-service</Name>
<MultiVersion value="true"/>
+
<Version>1.1.0</Version>
<Mandatory level="GHN"/>
+
<MultiVersion value="true"/>
<Shareable level="VO"/>
+
<Mandatory level="GHN"/>
<InstallScripts>
+
<Shareable level="VO"/>
<File>maininstall.sh</File>
+
<InstallScripts>
</InstallScripts>
+
<File>maininstall.sh</File>
<UninstallScripts>
+
</InstallScripts>
<File>mainuninstall.sh</File>
+
<UninstallScripts>
</UninstallScripts>
+
<File>mainuninstall.sh</File>
<RebootScripts>
+
</UninstallScripts>
<File>mainreboot.sh</File>
+
<RebootScripts>
</RebootScripts>
+
<File>mainreboot.sh</File>
<Dependencies>
+
</RebootScripts>
<Dependency>
+
<Dependencies>
<Service>
+
<Dependency>
<Class>MainDepClass</Class>
+
<Service>
<Name>MainDepName</Name>
+
<Class>MainDepClass</Class>
<Version>1.0.0</Version>
+
<Name>MainDepName</Name>
</Service>
+
<Version>1.0.0</Version>
<Package>DepPackage</Package>
+
</Service>
<Version>1.0.0</Version>
+
<Package>DepPackage</Package>
<Scope level="GHN"/>
+
<Version>1.0.0</Version>
<Optional>true</Optional>
+
<Scope level="GHN"/>
</Dependency>
+
<Optional>true</Optional>
</Dependencies>
+
</Dependency>
<SpecificData>text</SpecificData>
+
</Dependencies>
<GARArchive>main.gar</GARArchive>
+
<SpecificData>text</SpecificData>
<ServiceEquivalenceFunctions>...</ServiceEquivalenceFunctions>
+
<GARArchive>main.gar</GARArchive>
<PortType>...</PortType>
+
<ServiceEquivalenceFunctions>...</ServiceEquivalenceFunctions>
</Main>
+
<PortType>...</PortType>
<Software>
+
</Main>
<Description>Software Description</Description>
+
<Software>
<Name>Name-stubs</Name>
+
<Description>Software Description</Description>
<Version>1.0.0</Version>
+
<Name>Name-stubs</Name>
<MultiVersion value="true"/>
+
<Version>1.0.0</Version>
<Mandatory level="GHN"/>
+
<MultiVersion value="true"/>
<Shareable level="VO"/>
+
<Mandatory level="GHN"/>
<GHNRequirements>....</GHNRequirements>
+
<Shareable level="VO"/>
<InstallScripts>
+
<GHNRequirements>....</GHNRequirements>
<File>softwareinstall.sh</File>
+
<InstallScripts>
</InstallScripts>
+
<File>softwareinstall.sh</File>
<UninstallScripts>
+
</InstallScripts>
<File>softwareuninstall.sh</File>
+
<UninstallScripts>
</UninstallScripts>
+
<File>softwareuninstall.sh</File>
<RebootScripts>
+
</UninstallScripts>
<File>softwarereboot.sh</File>
+
<RebootScripts>
</RebootScripts>
+
<File>softwarereboot.sh</File>
<Dependencies>
+
</RebootScripts>
<Dependency>
+
<Dependencies>
<Service>
+
<Dependency>
<Class>SoftwareClass</Class>
+
<Service>
<Name>SoftwareName</Name>
+
<Class>SoftwareClass</Class>
<Version>1.0.0</Version>
+
<Name>SoftwareName</Name>
</Service>
+
<Version>1.0.0</Version>
<Package>SoftwarePackage</Package>
+
</Service>
<Version>1.0.0</Version>
+
<Package>SoftwarePackage</Package>
<Scope level="VO"/>
+
<Version>1.0.0</Version>
<Optional>false</Optional>
+
<Scope level="VO"/>
</Dependency>
+
<Optional>false</Optional>
</Dependencies>
+
</Dependency>
<SpecificData>text</SpecificData>
+
</Dependencies>
<Type>library</Type>
+
<SpecificData>text</SpecificData>
<Files>
+
<Type>library</Type>
<File>stubs.jar</File>
+
<Files>
</Files>
+
<File>stubs.jar</File>
</Software>
+
</Files>
<Software>
+
</Software>
<Description>Test Suite</Description>
+
<Software>
<Name>Name-test-suite</Name>
+
<Description>Test Suite</Description>
<Version>1.0.0</Version>
+
<Name>Name-test-suite</Name>
[...]
+
<Version>1.0.0</Version>
<Type>library</Type>
+
[...]
<Files>
+
<Type>library</Type>
<File>test.jar</File>
+
<Files>
</Files>
+
<File>testsuite.jar</File>
</Software>
+
</Files>
</Packages>
+
</Software>
<SpecificData>text</SpecificData>
+
</Packages>
</Profile>
+
<SpecificData>text</SpecificData>
</Resource>
+
</Profile>
 +
</Resource>
 +
</source>
  
  
Line 248: Line 256:
 
  |
 
  |
 
  |-- Name-test-suite
 
  |-- Name-test-suite
  |  |-- test.jar
+
  |  |-- testsuite.jar
 
  |  \-- svnpath.txt
 
  |  \-- svnpath.txt
 
  |
 
  |
 
  \-- profile.xml
 
  \-- profile.xml
 
  
 
==Software Archive Validation Process==
 
==Software Archive Validation Process==
Line 270: Line 277:
  
 
===Configuration Section===
 
===Configuration Section===
 
+
<source lang=xml>
 
  <Configuration>
 
  <Configuration>
 
  <Static>
 
  <Static>
Line 288: Line 295:
 
  <Dynamic/>
 
  <Dynamic/>
 
  </Configuration>
 
  </Configuration>
 
+
</source>
 
+
 
  .
 
  .
 
  |-- Name-service
 
  |-- Name-service
Line 312: Line 318:
 
  |
 
  |
 
  |-- Name-test-suite
 
  |-- Name-test-suite
  |  |-- test.jar
+
  |  |-- testsuite.jar
 
  |  \-- svnpath.txt
 
  |  \-- svnpath.txt
 
  |
 
  |
Line 323: Line 329:
  
 
===InstallScripts/UninstallScripts/RebootScripts Tag===
 
===InstallScripts/UninstallScripts/RebootScripts Tag===
 
+
<source lang=xml>
 
  <Main>
 
  <Main>
 
   ...
 
   ...
Line 339: Line 345:
 
  [...]
 
  [...]
 
  </Main>
 
  </Main>
 +
</source>
  
 
+
<source lang=xml>
 
+
 
  <Software>
 
  <Software>
 
  [...]
 
  [...]
Line 357: Line 363:
 
  [...]
 
  [...]
 
  </Software>
 
  </Software>
 
+
</source>
  
 
  .
 
  .
Line 381: Line 387:
 
  |
 
  |
 
  |-- Name-test-suite
 
  |-- Name-test-suite
  |  |-- test.jar
+
  |  |-- testsuite.jar
 
  |  \-- svnpath.txt
 
  |  \-- svnpath.txt
 
  |
 
  |
Line 393: Line 399:
 
===Specific Main Package Sections===
 
===Specific Main Package Sections===
 
====GARArchive Tag====
 
====GARArchive Tag====
 +
<source lang=xml>
 
  <Main>
 
  <Main>
 
  [...]
 
  [...]
Line 400: Line 407:
 
  [...]
 
  [...]
 
  <Main>
 
  <Main>
 
+
</source>
  
 
  .
 
  .
Line 424: Line 431:
 
  |
 
  |
 
  |-- Name-test-suite
 
  |-- Name-test-suite
  |  |-- test.jar
+
  |  |-- testsuite.jar
 
  |  \-- svnpath.txt
 
  |  \-- svnpath.txt
 
  |
 
  |
Line 434: Line 441:
  
 
====Files Section====
 
====Files Section====
 
+
<source lang=xml>
 
  <Software>
 
  <Software>
 
  [...]
 
  [...]
Line 444: Line 451:
 
  [...]
 
  [...]
 
  </Software>
 
  </Software>
 
+
</source>
  
 
  .
 
  .
Line 468: Line 475:
 
  |
 
  |
 
  |-- Name-test-suite
 
  |-- Name-test-suite
  |  |-- test.jar
+
  |  |-- testsuite.jar
 
  |  \-- svnpath.txt
 
  |  \-- svnpath.txt
 
  |
 
  |
Line 481: Line 488:
 
URI tag can be used instead of a Files tag whenever the actual content is stored remotely. This case is not showed in the example above.
 
URI tag can be used instead of a Files tag whenever the actual content is stored remotely. This case is not showed in the example above.
  
 
+
<source lang=xml>
 
  <URI>http://dlib25.isti.cnr.it/maven/Service3.tar.gz<URI>
 
  <URI>http://dlib25.isti.cnr.it/maven/Service3.tar.gz<URI>
 
+
</source>
 
During the validation phase Software Repository tries to download the file. If it is not downloadable the validation fails.
 
During the validation phase Software Repository tries to download the file. If it is not downloadable the validation fails.
 
If you specify this tag you have to make sure this file will be available for a long period in the future. If not it would be better to include it directly on the Software Archive
 
If you specify this tag you have to make sure this file will be available for a long period in the future. If not it would be better to include it directly on the Software Archive
Line 493: Line 500:
 
This task should be accomplished adding a Package to the profile declaration. The name of this package should be ''<ServiceName>''-test-suite
 
This task should be accomplished adding a Package to the profile declaration. The name of this package should be ''<ServiceName>''-test-suite
  
 
+
<source lang=xml>
 
  <Software>
 
  <Software>
 
  [...]
 
  [...]
Line 499: Line 506:
 
  [...]
 
  [...]
 
  <Files>
 
  <Files>
  <File>'''test.jar'''</File>
+
  <File>'''testsuite.jar'''</File>
 
  </Files>
 
  </Files>
 
  [...]
 
  [...]
 
  </Software>
 
  </Software>
 
+
</source>
  
 
This service has to produce as ServiceArchive a tar.gz file with the following structure:
 
This service has to produce as ServiceArchive a tar.gz file with the following structure:
Line 529: Line 536:
 
  |
 
  |
 
  |-- '''Name-test-suite'''
 
  |-- '''Name-test-suite'''
  |  |-- '''test.jar'''
+
  |  |-- '''testsuite.jar'''
 
  |  \-- svnpath.txt
 
  |  \-- svnpath.txt
 
  |
 
  |
Line 538: Line 545:
 
The following Profile describes a service and its stubs as two packages
 
The following Profile describes a service and its stubs as two packages
  
<pre>
+
<source lang=xml>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<Resource xmlns:p1="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
<Resource xmlns:p1="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Line 547: Line 554:
 
<Class>VREManagement</Class>
 
<Class>VREManagement</Class>
 
<Name>Deployer</Name>
 
<Name>Deployer</Name>
<Version>1.0</Version>
+
<Version>1.0.0</Version>
 +
<Dependencies>
 +
<Dependency>
 +
<Class>VREManagement</Class>
 +
<Name>SoftwareRepository</Name>
 +
<Version>1.0.0</Version>
 +
</Dependency>
 +
<Dependency>
 +
<Class>VREManagement</Class>
 +
<Name>VREManager</Name>
 +
<Version>1.0.0</Version>
 +
</Dependency>
 +
</Dependencies>
 
<Packages>
 
<Packages>
<Main deployable="true">
+
<Main deployable="false">
 
<Name>Deployer-service</Name>
 
<Name>Deployer-service</Name>
<Version>1.0</Version>
+
<Version>1.0.2</Version>
 
<Mandatory level="GHN"/>
 
<Mandatory level="GHN"/>
 
<Shareable level="VO"/>
 
<Shareable level="VO"/>
Line 562: Line 581:
 
<Class>VREManagement</Class>
 
<Class>VREManagement</Class>
 
<Name>Deployer</Name>
 
<Name>Deployer</Name>
 +
<Version>1.0.0</Version>
 
</Service>
 
</Service>
 
<Package>Deployer-stubs</Package>
 
<Package>Deployer-stubs</Package>
<Version>1.0</Version>
+
<Version>1.0.2</Version>
 
<Scope level="GHN"/>
 
<Scope level="GHN"/>
 
<Optional>false</Optional>
 
<Optional>false</Optional>
Line 572: Line 592:
 
<Class>VREManagement</Class>
 
<Class>VREManagement</Class>
 
<Name>SoftwareRepository</Name>
 
<Name>SoftwareRepository</Name>
<Version>1.0</Version>
+
<Version>1.0.0</Version>
 
</Service>
 
</Service>
 
<Package>SoftwareRepository-stubs</Package>
 
<Package>SoftwareRepository-stubs</Package>
<Version>1.0</Version>
+
<Version>[1.0.3,1.1.0)</Version>
 
<Scope level="GHN"/>
 
<Scope level="GHN"/>
 
<Optional>false</Optional>
 
<Optional>false</Optional>
Line 584: Line 604:
 
<Name>gcube/common/vremanagement/Deployer</Name>
 
<Name>gcube/common/vremanagement/Deployer</Name>
 
<Security/>
 
<Security/>
<WSDL>
+
<WSDL>...</WSDL>
</WSDL>
+
 
</PortType>
 
</PortType>
 
</Main>
 
</Main>
 
<Software>
 
<Software>
 
<Name>Deployer-stubs</Name>
 
<Name>Deployer-stubs</Name>
<Version>1.0</Version>
+
<Version>1.0.2</Version>
 
<MultiVersion value="true"/>
 
<MultiVersion value="true"/>
 
<Mandatory level="GHN"/>
 
<Mandatory level="GHN"/>
Line 597: Line 616:
 
<Requirement category="Site" operator="ge" requirement="string" value="java1.5"/>
 
<Requirement category="Site" operator="ge" requirement="string" value="java1.5"/>
 
</GHNRequirements>
 
</GHNRequirements>
<SpecificData>text</SpecificData>
 
 
<Type>library</Type>
 
<Type>library</Type>
 
<Files>
 
<Files>
 
<File>org.gcube.common.vremanagement.deployer.stubs.jar</File>
 
<File>org.gcube.common.vremanagement.deployer.stubs.jar</File>
 +
</Files>
 +
</Software>
 +
<Software>
 +
<Name>Deployer-test-suite</Name>
 +
<Version>1.0.1</Version>
 +
<MultiVersion value="true"/>
 +
<Shareable level="VO"/>
 +
<GHNRequirements>
 +
<Requirement category="Site" operator="ge" requirement="string" value="java1.5"/>
 +
</GHNRequirements>
 +
<Type>application</Type>
 +
<Files>
 +
<File>lib/org.gcube.common.vremanagement.deployer.testsuite.jar</File>
 
</Files>
 
</Files>
 
</Software>
 
</Software>
Line 606: Line 637:
 
</Profile>
 
</Profile>
 
</Resource>
 
</Resource>
</pre>
+
</source>
  
 
This service has to produce a SoftwareArchive (a tar.gz) file with the following structure:
 
This service has to produce a SoftwareArchive (a tar.gz) file with the following structure:
Line 630: Line 661:
  
  
For this service archive the ETICS configuration is
+
 
 +
The ETICS configuration (''org.gcube.vre-management.deployer-'''servicearchive''''') is:
  
  
Line 656: Line 688:
 
</pre>
 
</pre>
  
== On the automatic completion of profile.xml ==
 
  
It's often happening that the package version of components in the profile.xml is not aligned with the version specified in the corresponding ETICS configuration. It's also very problematic to declare a runtime dependency in the profile.xml by providing the correct version of the dependency to be used. Since, in principle, you don't know what version other developers are giving to their component, this issue is not easy to solve by hand-editing the profile.
+
The ''servicearchive'' configuration is related to the ''service'' configuration that should be as following:
  
Here, we propose a solution to solve the above two issues, i.e.: align ALL the versions in the profile.xml with the ones specified in the ETICS configuration. By doing so, version-related problems encountered during deployment are most-likely to disappear.
+
<pre>
 +
INIT:  
 +
mkdir -p ${prefix}
  
The solution requires the following two updates:
+
COMPILE:
 +
ant -Detics.build=true garService
  
=== Updating the profile.xml ===
+
DOC:
 +
ant -Detics.build=true doc
  
Replace each version occurring with a different placeholder.
+
INSTALL:
 
+
cp -R ${moduleDir}/lib/*.gar ${prefix}; cp -R ${moduleDir}/doc ${prefix}
In the following example (extracted from the delegation profile), versions are replaced with '''%%&lt;componentname&gt;.version%%''':
+
<pre>
+
[...]
+
<Main>
+
<Description>Local service in a GHN to delegate credentials to the services</Description>
+
<Name>delegation-service</Name>
+
<Version>%%delegation.version%%</Version>
+
<Dependencies>
+
<Dependency>
+
<Service>
+
<Class>DVOS</Class>
+
<Name>delegation</Name>
+
<Version>1.0.0</Version>
+
</Service>
+
<Package>delegation-stubs</Package>
+
<Version>%%delegation-stubs.version%%</Version>
+
<Scope level="GHN"/>
+
<Optional>false</Optional>
+
</Dependency>
+
</Dependencies>
+
[...]
+
</Main>
+
[...]
+
 
</pre>
 
</pre>
 
=== Updating the Etics configuration for the Service ===
 
 
All placeholders have to be replaced with the actual version numbers which are known by Etics and visible inside Etics Commands (e.g. build commands).
 
 
We suggest to perform the replacement in the '''init target''' of the '''build commands''' set.
 
 
The following example shows a possible replacement command for the above profile.xml:
 
<pre>
 
sed -i "s/%%delegation.version%%/${version}/g" etc/profile.xml;
 
sed -i "s/%%delegation-stubs.version%%/${org.gcube.vo-management.delegation-stubs.version}/g" etc/profile.xml;
 
</pre>
 
The above profile is also available at http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vo-management/delegation/etc/profile.xml
 
 
The commands are also available in Etics looking for ''vo-management.delegation'' configurations (both HEAD and 1.1.0)
 

Latest revision as of 18:14, 11 July 2013

Short background

A 'Service' in gCube is a software system which delivers functionality. It is composed by a set of related 'Packages'.

In the gCube context, a 'Package' is a 'piece of software' that can be deployed into a gHN. Packages are single tarballs, compliant with the Package Model, that contains the files to be installed, along with rules describing software/packages dependencies, deployment instructions and so on.

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

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

Software Archive Structure

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

.
|--<PackageName>(Main)
|  |--<GARArchive>
|  |--svnpath.txt
|  |--<additional files>
|  |--doc
|     \--api
|        |- index.html
|        \- others javadoc files
|
|
|--<PackageName>
|  |--<LibraryFile>
|  |--svnpath.txt
|  |--<additional files>
|  \--doc
|     \--api
|        |-- index.html
|        \-- others javadoc files
|
|....
|
|
|--<PackageName>
|  |--<LibraryFile>
|  |--svnpath.txt
|  |--<additional files>
|  \--doc
|     \--api
|        |-- index.html
|        \-- others javadoc files
|
|-- README
|-- MANTAINERS
|-- CHANGELOG
|-- INSTALL
|-- LICENSE
|
\-profile.xml

where:

  • 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 source code or to the library download location in cases of external library not open source.

Creating Software Archives

Manually

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

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:
INIT:
The init command has to be used to create the ${prefix} directory and all the <PackageName> subdirs

INSTALL:
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.

PACKAGING:
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.

Example

To better understand the example below check the Service Profile specification.

Service Profile Example

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

<?xml version="1.0" encoding="UTF-8"?>
<Resource xsi:noNamespaceSchemaLocation="service.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<ID></ID>
	<Type>Service</Type>
	<Profile>
		<Description>Description</Description>
		<Class>Class</Class>
		<Name>Name</Name>
		<Version>1.0.0</Version>
		<Configuration>
	 		<Static>
	 			<Configs>
	 				<Config>
	 					<File>aux.txt</File>
	 					<Description>aux</Description>
	 					<Label>aux</Label>
	 				</Config>
	 				<Config>
	 					<File>aux2.txt</File>
	 					<Description>aux2</Description>
	 					<Label>aux2</Label>
	 				</Config>
	 			</Configs>
	 		</Static>
			<Dynamic/>
		</Configuration>
		<Dependencies>
	 		<Dependency>
	 			<Class>DepClass</Class>
	 			<Name>DepName</Name>
	 			<Version>1.0.0</Version>
	 		</Dependency>
		</Dependencies>
		<Packages>
			<Main>
				<Description>Main Package Description</Description>
	 			<Name>Name-service</Name>
	 			<Version>1.1.0</Version>
	 			<MultiVersion value="true"/>
	 			<Mandatory level="GHN"/>
	 			<Shareable level="VO"/>
	 			<InstallScripts>
	 				<File>maininstall.sh</File>
	 			</InstallScripts>
	 			<UninstallScripts>
	 				<File>mainuninstall.sh</File>
	 			</UninstallScripts>
	 			<RebootScripts>
	 				<File>mainreboot.sh</File>
	 			</RebootScripts>
	 			<Dependencies>
	 				<Dependency>
	 					<Service>
	 						<Class>MainDepClass</Class>
	 						<Name>MainDepName</Name>
	 						<Version>1.0.0</Version>						
	 					</Service>
	 					<Package>DepPackage</Package>
	 					<Version>1.0.0</Version>
	 					<Scope level="GHN"/>
	 					<Optional>true</Optional>
	 				</Dependency>
	 			</Dependencies>
	 			<SpecificData>text</SpecificData>
	 			<GARArchive>main.gar</GARArchive>
	 			<ServiceEquivalenceFunctions>...</ServiceEquivalenceFunctions>
	 			<PortType>...</PortType>
	 		</Main>
			<Software>
				<Description>Software Description</Description>
				<Name>Name-stubs</Name>
				<Version>1.0.0</Version>
				<MultiVersion value="true"/>
				<Mandatory level="GHN"/>
				<Shareable level="VO"/>
				<GHNRequirements>....</GHNRequirements>
				<InstallScripts>
					<File>softwareinstall.sh</File>
				</InstallScripts>
				<UninstallScripts>
					<File>softwareuninstall.sh</File>
				</UninstallScripts>
				<RebootScripts>
					<File>softwarereboot.sh</File>
				</RebootScripts>
				<Dependencies>
					<Dependency>
						<Service>
							<Class>SoftwareClass</Class>
							<Name>SoftwareName</Name>
							<Version>1.0.0</Version>
						</Service>
						<Package>SoftwarePackage</Package>
						<Version>1.0.0</Version>
						<Scope level="VO"/>
						<Optional>false</Optional>
					</Dependency>
				</Dependencies>
				<SpecificData>text</SpecificData>
				<Type>library</Type>
				<Files>
					<File>stubs.jar</File>
				</Files>
			</Software>
			<Software>
				<Description>Test Suite</Description>
				<Name>Name-test-suite</Name>
				<Version>1.0.0</Version>
				[...]
				<Type>library</Type>
				<Files>
					<File>testsuite.jar</File>
				</Files>
			</Software>
		</Packages>
		<SpecificData>text</SpecificData>
	</Profile>
</Resource>


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

.
|-- Name-service
|   |-- aux.txt
|   |-- aux2.txt
|   |-- main.gar
|   |-- maininstall.sh
|   |-- mainreboot.sh
|   |-- mainuninstall.sh
|   |-- svnpath.txt
|   |--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|-- Name-stubs
|   |-- stubs.jar
|   |-- softwareinstall.sh
|   |-- softwarereboot.sh
|   |-- softwareuninstall.sh
|   \-- svnpath.txt
|
|-- Name-test-suite
|   |-- testsuite.jar
|   \-- svnpath.txt
|
\-- profile.xml

Software Archive Validation Process

The Software Archive validation process relies on the information contained in the following sections of the Service Profile to validate the actual constituents of the Software Archive.

Description Tag

The description supplied in the store(StoreMessage) method has priority with respect to the one supplied with the profile. If no description is supplied with the method invocation the one filled in the profile will be used. If no one of this choice are used to supply the description the validation fails.

Class & Name Tag

During validation the Class and Name must be the same to the one passed as argument to store(StoreMessage) API.

Version Tag

This tag is always replaced with the version supplied with the store(StoreMessage) method. This choice have been thought to simplify the life of the developer to avoid to change everytime profile.

Configuration Section

 <Configuration>
 	<Static>
 		<Configs>
 			<Config>
 				<File>'''aux.txt'''</File>
 				<Description>aux</Description>
 				<Label>aux</Label>
 			</Config>
 			<Config>
 				<File>'''aux2.txt'''</File>
 				<Description>aux2</Description>
 				<Label>aux2</Label>
 			</Config>
 		</Configs>
 	</Static>
 	<Dynamic/>
 </Configuration>
.
|-- Name-service
|   |-- aux.txt
|   |-- aux2.txt
|   |-- main.gar
|   |-- maininstall.sh
|   |-- mainreboot.sh
|   |-- mainuninstall.sh
|   |-- svnpath.txt
|   |--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|-- Name-stubs
|   |-- stubs.jar
|   |-- softwareinstall.sh
|   |-- softwarereboot.sh
|   |-- softwareuninstall.sh
|   \-- svnpath.txt
|
|-- Name-test-suite
|   |-- testsuite.jar
|   \-- svnpath.txt
|
\-- profile.xml


This section will be moved soon on Main section. For the time being you have just to remind that the files declared in this section must go inside the directory with the name of the Main Package on Software Archive.

InstallScripts/UninstallScripts/RebootScripts Tag

 <Main>
  ...
  <Name>'''Name-service'''</Name>
 	[...]
 	<InstallScripts>
 		<File>'''maininstall.sh'''</File>
 	</InstallScripts>
 	<UninstallScripts>
 		<File>'''mainuninstall.sh'''</File>
 	</UninstallScripts>
 	<RebootScripts>
 		<File>'''mainreboot.sh'''</File>
 	</RebootScripts>
 	[...]
 </Main>
 <Software>
 	[...]
 	<Name>'''Name-stubs'''</Name>
 	[...]
 	<InstallScripts>
 		<File>'''softwareinstall.sh'''</File>
 	</InstallScripts>
 	<UninstallScripts>
 		<File>'''softwareuninstall.sh'''</File>
 	</UninstallScripts>
 	<RebootScripts>
 		<File>'''softwarereboot.sh'''</File>
 	</RebootScripts>
 	[...]
 </Software>
.
|-- Name-service
|   |-- aux.txt
|   |-- aux2.txt
|   |-- main.gar
|   |-- maininstall.sh
|   |-- mainreboot.sh
|   |-- mainuninstall.sh
|   |-- svnpath.txt
|   |--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|-- Name-stubs
|   |-- stubs.jar
|   |-- softwareinstall.sh
|   |-- softwarereboot.sh
|   |-- softwareuninstall.sh
|   \-- svnpath.txt
|
|-- Name-test-suite
|   |-- testsuite.jar
|   \-- svnpath.txt
|
\-- profile.xml


Just remind the general rule for this section: The files must be go inside the directory with the name of the Package on Software Archive.

Specific Main Package Sections

GARArchive Tag

 <Main>
 	[...]
 	<Name>'''Name-service'''</Name>
 	[...]
 	<GARArchive>'''main.gar'''</GARArchive>
 	[...]
 <Main>
.
|-- Name-service
|   |-- aux.txt
|   |-- aux2.txt
|   |-- main.gar
|   |-- maininstall.sh
|   |-- mainreboot.sh
|   |-- mainuninstall.sh
|   |-- svnpath.txt
|   |--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|-- Name-stubs
|   |-- stubs.jar
|   |-- softwareinstall.sh
|   |-- softwarereboot.sh
|   |-- softwareuninstall.sh
|   \-- svnpath.txt
|
|-- Name-test-suite
|   |-- testsuite.jar
|   \-- svnpath.txt
|
\-- profile.xml

The gar archive must go under the Main Package folder (i.e. Name-service) on Software Archive

Specific Software Package Sections

Files Section

 <Software>
 	[...]
 	<Name>'''Name-stubs'''</Name>
 	[...]
 	<Files>
 		<File>'''stubs.jar'''</File>
 	</Files>
 	[...]
 </Software>
.
|-- Name-service
|   |-- aux.txt
|   |-- aux2.txt
|   |-- main.gar
|   |-- maininstall.sh
|   |-- mainreboot.sh
|   |-- mainuninstall.sh
|   |-- svnpath.txt
|   |--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|-- Name-stubs
|   |-- stubs.jar
|   |-- softwareinstall.sh
|   |-- softwarereboot.sh
|   |-- softwareuninstall.sh
|   \-- svnpath.txt
|
|-- Name-test-suite
|   |-- testsuite.jar
|   \-- svnpath.txt
|
\-- profile.xml


The files must go under the folder with the name of the Software Package (i.e. Name-stubs) on Software Archive

URI Tag

URI tag can be used instead of a Files tag whenever the actual content is stored remotely. This case is not showed in the example above.

 <URI>http://dlib25.isti.cnr.it/maven/Service3.tar.gz<URI>

During the validation phase Software Repository tries to download the file. If it is not downloadable the validation fails. If you specify this tag you have to make sure this file will be available for a long period in the future. If not it would be better to include it directly on the Software Archive

Test Suite

Test suite is a mandatory piece of code used to test the Service at deployment time. Test suite have to be declared as a package in the Service Profile. This task should be accomplished adding a Package to the profile declaration. The name of this package should be <ServiceName>-test-suite

 <Software>
 	[...]
 	<Name>'''Name-test-suite'''</Name>
 	[...]
 	<Files>
 		<File>'''testsuite.jar'''</File>
 	</Files>
 	[...]
 </Software>

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

.
|-- Name-service
|   |-- aux.txt
|   |-- aux2.txt
|   |-- main.gar
|   |-- maininstall.sh
|   |-- mainreboot.sh
|   |-- mainuninstall.sh
|   |-- svnpath.txt
|   |--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|-- Name-stubs
|   |-- stubs.jar
|   |-- softwareinstall.sh
|   |-- softwarereboot.sh
|   |-- softwareuninstall.sh
|   \-- svnpath.txt
|
|-- Name-test-suite
|   |-- testsuite.jar
|   \-- svnpath.txt
|
\-- profile.xml

Example

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

<?xml version="1.0" encoding="UTF-8"?>
<Resource xmlns:p1="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<ID/>
	<Type>Service</Type>
	<Profile>
		<Description>Deployer: perform local deployment/undeployment of GCUBE packages</Description>
		<Class>VREManagement</Class>
		<Name>Deployer</Name>
		<Version>1.0.0</Version>
		<Dependencies>
			<Dependency>			
					<Class>VREManagement</Class>
					<Name>SoftwareRepository</Name>
					<Version>1.0.0</Version>
			</Dependency>											
			<Dependency>			
					<Class>VREManagement</Class>
					<Name>VREManager</Name>
					<Version>1.0.0</Version>
			</Dependency>
		</Dependencies>
		<Packages>
			<Main deployable="false">
				<Name>Deployer-service</Name>
				<Version>1.0.2</Version>
				<Mandatory level="GHN"/>
				<Shareable level="VO"/>
				<GHNRequirements>
					<Requirement category="Site"  requirement="string" value="java1.5" operator="ge"/>
				</GHNRequirements>
				<Dependencies>
					<Dependency>
						<Service>
							<Class>VREManagement</Class>
							<Name>Deployer</Name>
							<Version>1.0.0</Version>
						</Service>
						<Package>Deployer-stubs</Package>
						<Version>1.0.2</Version>
						<Scope level="GHN"/>
						<Optional>false</Optional>
					</Dependency>
					<Dependency>
						<Service>
							<Class>VREManagement</Class>
							<Name>SoftwareRepository</Name>
							<Version>1.0.0</Version>						
						</Service>
						<Package>SoftwareRepository-stubs</Package>
						<Version>[1.0.3,1.1.0)</Version>
						<Scope level="GHN"/>
						<Optional>false</Optional>
					</Dependency>
				</Dependencies>
				<GARArchive>org.gcube.common.vremanagement.deployer.gar</GARArchive>
				<PortType>
						<Name>gcube/common/vremanagement/Deployer</Name>
						<Security/>			
						<WSDL>...</WSDL>
				</PortType>					
			</Main>
			<Software>
				<Name>Deployer-stubs</Name>
				<Version>1.0.2</Version>
				<MultiVersion value="true"/>
				<Mandatory level="GHN"/>
				<Shareable level="VO"/>
				<GHNRequirements>
					<Requirement category="Site" operator="ge" requirement="string" value="java1.5"/>
				</GHNRequirements>
				<Type>library</Type>
				<Files>
					<File>org.gcube.common.vremanagement.deployer.stubs.jar</File>
				</Files>
			</Software>
			<Software>
				<Name>Deployer-test-suite</Name>
				<Version>1.0.1</Version>
				<MultiVersion value="true"/>				
				<Shareable level="VO"/>
				<GHNRequirements>
					<Requirement category="Site" operator="ge" requirement="string" value="java1.5"/>
				</GHNRequirements>
				<Type>application</Type>
				<Files>
					<File>lib/org.gcube.common.vremanagement.deployer.testsuite.jar</File>
				</Files>
			</Software>
		</Packages>
	</Profile>
</Resource>

This service has to produce a SoftwareArchive (a tar.gz) file with the following structure:

.
|
|--Deployer-service
|  |--org.gcube.common.vremanagement.deployer.gar
|  |--svnpath.txt
|  \--doc
|     \--api
|        |--index.html
|        \--others javadoc files
|
|--Deployer-stubs
|  |--org.gcube.common.vremanagement.deployer.stubs.jar
|  \--svnpath.txt
|
|--Deployer-test-suite
|  \--org.gcube.common.vremanagement.deployer.testsuite.jar
|
\--profile.xml


The ETICS configuration (org.gcube.vre-management.deployer-servicearchive) is:



INIT: 
mkdir -p ${prefix};
mkdir -p ${prefix}/Deployer-service;
mkdir -p ${prefix}/Deployer-stubs;
mkdir -p ${prefix}/Deployer-test-suite;


INSTALL:
cp ${org.gcube.vre-management.deployer.moduleDir}/etc/profile.xml ${prefix};

cp ${org.gcube.vre-management.deployer.moduleDir}/lib/*.gar ${prefix}/Deployer-service;
cp -r ${org.gcube.vre-management.deployer.moduleDir}/doc ${prefix}/Deployer-service;
echo ${org.gcube.vre-management.deployer.vcsroot}/${org.gcube.vre-management.deployer.tag} > ${prefix}/Deployer-service/svnpath.txt;

cp ${org.gcube.vre-management.deployer-stubs.moduleDir}/lib/org.gcube.common.vremanagement.deployer.stubs.jar ${prefix}/Deployer-stubs;
echo ${org.gcube.vre-management.deployer-stubs.vcsroot}/${org.gcube.vre-management.deployer-stubs.tag} > ${prefix}/Deployer-stubs/svnpath.txt;

cp ${org.gcube.vre-management.deployer-test-suite.moduleDir}/lib/org.gcube.common.vremanagement.deployer.testsuite.jar ${prefix}/Deployer-test-suite;
echo ${org.gcube.vre-management.deployer-test-suite.vcsroot}/${org.gcube.vre-management.deployer-test-suite.tag} > ${prefix}/Deployer-test-suite/svnpath.txt;


The servicearchive configuration is related to the service configuration that should be as following:

INIT:    
mkdir -p ${prefix}

COMPILE:
ant -Detics.build=true garService

DOC:
ant -Detics.build=true doc

INSTALL:
cp -R ${moduleDir}/lib/*.gar ${prefix}; cp -R ${moduleDir}/doc ${prefix}