Difference between revisions of "Software Repository"

From Gcube Wiki
Jump to: navigation, search
Line 71: Line 71:
 
:5. '''listPending'''
 
:5. '''listPending'''
 
<pre>
 
<pre>
listPending ( ) -> String
+
listPending( ) -> String
 
</pre>
 
</pre>
  
Line 86: Line 86:
 
</pre>
 
</pre>
  
:9. '''listNonDeployableServices'''
 
<pre>
 
listNonDeployableServices ( ) -> String
 
</pre>
 
  
With this functionality it is possible to know which stored packages are not deployable due missing dependencies.
 
  
''Return'' a XML with the following structure:
+
:6. '''isDeployable'''
 
<pre>
 
<pre>
<Resultset>
+
isDeployable(String) -> StringArray
  <Result>
+
    <Class>String</Class>
+
    <Name>String</Name>
+
    <PackageName>String</PackageName>
+
  </Result>
+
</Resultset>
+
 
</pre>
 
</pre>
  
:10. '''listAllDependenciesChain'''
+
With this functionality it is possible to know if a service is deployable. This means all dependences are deployable too.
<pre>
+
listAllDependenciesChain (String) -> ListPackageArray
+
</pre>
+
  
This operation lists all dependencies declared on the WSRF package declared on the service profile of a given unique ID.
+
''String'' Service ID
  
''Return'' Returned object type includes unique ID, package name, and type.
+
''Return'' StringArray containing on each element a piece of xml that describes the dependency
  
:11. '''listSameDHNPackages'''
 
 
<pre>
 
<pre>
listSameDHNPackages (String) -> ListPackageArray
+
<Dependency>
 +
<Service>
 +
<Class>Class</Class>
 +
<Name>Name</Name>
 +
<Version>1.0</Version>
 +
</Service>
 +
<Package>MainPackage</Package>
 +
<Version>1.1</Version>
 +
<Scope level="GHN"/>
 +
</Dependency>
 
</pre>
 
</pre>
  
This operation lists all same DHN dependencies declared on the WSRF package declared on the service profile of a given unique ID.
 
  
''Return'' Returned object type includes unique ID, package name, and type.
+
:7. '''listScopedPackages'''
 
+
:12. '''listSameDLPackages'''
+
 
<pre>
 
<pre>
listSameDLPackages (String) -> ListPackageArray
+
listScopedPackages(ListScopedPackagesMessage) -> StringArray
 
</pre>
 
</pre>
  
This operation lists all same DL dependencies declared on the WSRF package declared on the service profile of a given unique ID.  
+
This operation lists all dependencies with a certain scope level given as argument.  
  
''Return'' Returned object type includes unique ID, package name, and type.
+
''ListScopedPackagesMessage'' type contains serviceID and scope(GHN, VRE, VO)
 +
 
 +
''Return'' StringArray containing on each element a piece of xml that describes the dependency
  
:13. '''listSameVOPackages'''
 
 
<pre>
 
<pre>
listSameVOPackages (String) -> ListPackageArray
+
<Dependency>
 +
<Service>
 +
<Class>Class</Class>
 +
<Name>Name</Name>
 +
<Version>1.0</Version>
 +
</Service>
 +
<Package>MainPackage</Package>
 +
<Version>1.1</Version>
 +
<Scope level="GHN"/>
 +
</Dependency>
 
</pre>
 
</pre>
  
This operation lists all same VO dependencies declared on the WSRF package declared on the service profile of a given unique ID.
 
 
''Return'' Returned object type includes unique ID, package name, and type.
 
  
 
=== Dependencies ===
 
=== Dependencies ===
  
 
The dependencies of the Package Repository Service are:
 
The dependencies of the Package Repository Service are:
*DHN: to host service.
+
*GHN: to host service.
*NAL: to access to HNM.
+
*Keeper common: for type definition.
+
*Grid Storage: to store DILIGENT packages on the Grid.
+
*Profile Manager: to parse Service Profile
+
*Commons-io from Jakarta: to File system functionality.
+
 
*Commons-compress from Jakarta: to File compress functionality.
 
*Commons-compress from Jakarta: to File compress functionality.
 +
*hsqldb: to use the DB
 +
*MavenCustom: to use maven repository functionality
  
=== Usage Example ===
 
 
==== Package Repository client ====
 
 
A Package Repository client is provided. The client uses all PR functionality in different ways, i.e. by calling directly the PR operations and by pre-processing the client input to generate the appropriate series of PR service calls.
 
 
===== Dependencies =====
 
* Package Repository service
 
* Keeper common
 
 
===== Usage =====
 
<pre>
 
java ClientPackageRepository pkgRepositoryURI store diligentID serviceArchiveURI description
 
 
java ClientPackageRepository pkgRepositoryURI storeList storeListFile
 
 
java ClientPackageRepository pkgRepositoryURI storeAndApproveList storeListFile
 
 
java ClientPackageRepository pkgRepositoryURI approve diligentID
 
 
java ClientPackageRepository pkgRepositoryURI approveList storeListFile
 
 
java ClientPackageRepository pkgRepositoryURI get diligentID packageName
 
 
java ClientPackageRepository pkgRepositoryURI delete diligentID
 
 
java ClientPackageRepository pkgRepositoryURI getServProfile diligentID
 
 
java ClientPackageRepository pkgRepositoryURI getServProfileID class name
 
 
java ClientPackageRepository pkgRepositoryURI listPending
 
 
java ClientPackageRepository pkgRepositoryURI listApproved
 
 
java ClientPackageRepository pkgRepositoryURI listNonDeployable
 
 
java ClientPackageRepository pkgRepositoryURI listAllDependenciesChain serviceID
 
 
java ClientPackageRepository pkgRepositoryURI listSameDHNPackages serviceID
 
 
java ClientPackageRepository pkgRepositoryURI listSameDLPackages serviceID
 
 
java ClientPackageRepository pkgRepositoryURI listSameVOPackages serviceID
 
</pre>
 
 
Where:
 
* pkgRepositoryURI: Package Repository address.
 
* diligentID: The unique ID of a Service Archive.
 
* serviceArchiveURI: The address from where the Service Archive can be downloaded.
 
* description: The Service Archive description.
 
* storeListFile: a list with Service Archives to store {diligentID, URI, description}.
 
* class: The Service Class.
 
* name: The Service Name.
 
* packageName: The package Name.
 
 
==== DILIGENT infrastructure initialization ====
 
 
In order to speed up the setting up of a DILIGENT infrastructure, and align available DILIGENT packages with current development process, an automated client that initialize the core DCL services (DIS and PR) is provided with the Package Repository component.
 
 
The procedure consists on a Thread that run the initialization method described below:
 
<pre>
 
1. Download from ETICS list of last SA built
 
2. Delete from DIS all SPs
 
3. Delete from PR all packages
 
4. For each SA built
 
    4.1. create a new resource into the DIS
 
    4.2. if successful store SA on PR
 
            4.2.1. if successful log success
 
                        else remove resource from DIS and log failure
 
            else log failure
 
</pre>
 
 
The Infrastructure Initialization Thread can be run by typing:
 
<pre>
 
java org.diligentproject.keeperservice.packagerepositoryclients.InfrastructureInitialization  -initInfra
 
</pre>
 
 
The same client can be used to download togheter with the SA the related Source Packages and Javadoc Packages,
 
and create a local storage of source/bynaries/javadoc that can be stored on CVS/SVN repository.
 
To store a SA on the PR:
 
<pre>
 
java org.diligentproject.keeperservice.packagerepositoryclients.InfrastructureInitialization  -insert -module:<SERVICE_ARCHIVE_MODULE_NAME>
 
</pre>
 
To update a previously stored SA on the PR ( and the related Service Profile on the DIS):
 
<pre>
 
java org.diligentproject.keeperservice.packagerepositoryclients.InfrastructureInitialization  -update -module:<SERVICE_ARCHIVE_MODULE_NAME>
 
-id:<SA_ID>
 
</pre>
 
To Remove a SA from the PR (and the related ServiceProfile from the DIS)
 
<pre>
 
java org.diligentproject.keeperservice.packagerepositoryclients.InfrastructureInitialization  -delete -id:<SA_ID>
 
</pre>
 
To Download a SA binary package togheter with the related source packages and javadoc packages:
 
<pre>
 
java org.diligentproject.keeperservice.packagerepositoryclients.InfrastructureInitialization  -get -module:<SERVICE_ARCHIVE_MODULE_NAME>
 
</pre>
 
 
 
 
===== Dependencies =====
 
* activation.jar
 
* commons-compress-20061201.jar
 
* jaxb-api.jar
 
* jaxb-impl.jar
 
* jaxb-xjc.jar
 
* jaxb1-impl.jar
 
* jsr173_api.jar
 
* org_diligentproject_common_profilemanager.jar
 
* org_diligentproject_keeperservice_packagerepository_stubs.jar
 
* org_diligentproject_informationservice_disregistry_stubs.jar
 
 
===== Usage =====
 
 
Update appropriately the required parameters on the properties file
 
<pre>
 
org/diligentproject/keeperservice/packagerepositoryclients/InfrastructureInitialization.properties
 
</pre>
 
to refer to a completely deployed infrastructure:
 
* VERSION the gCube SA Version (i.e. 0.3.0)
 
* REPOSITORY_DIR the local dir where a SVN/CVS Repository is defined
 
* SLEEP_TIME: Thread sleep time in minutes
 
* TMP_DIR: directory where all Service Archives from build repository will be downloaded and parsed
 
* ETICS_SA_LIST_URL: build repository URI
 
* VO: The VO to Initialize
 
* PR_EPR: PR to update address
 
* SECURITY_ENABLED true/false if the security is enabled on the infra
 
* UPDATE_PR true/false if the Initialization thread has to update the PR
 
* UPDATE_DIS true/false if the Initialization thread has to update the DIS
 
* PROXY_FILE the local proxy file
 
* BASE_HTTP_ULR teh base HTTP Url where Etics SA are stored
 
* LOG4JFILE a custom log4j
 
 
Run the program from a machine with the CLASSPATH set appropriately.
 
  
 
=== Know Bugs and Limitations ===
 
=== Know Bugs and Limitations ===
 
In current implementation the proxy to access to the Grid need to be created manually.
 

Revision as of 11:25, 5 June 2008

Software Repository

Introduction

The Software Repository validates, stores, and manages packages. It checks packages dependencies and giving both access to packages relations and access to the stored packages supports the dynamic packages deployment.

This repository accepts registration requests coming from the Sofware Archive Registration Portlet that is part of the VRE Management

Implentation Overview

This component is responsible for the validation, storage, and maintenance of the Software Archives, each software archive contains all files declared on the Service Profile . It checks packages dependencies and by ensuring access to them, it supports the dynamic packages deployment.

The Software Repository is a WSRF service, implemented as specified by the Singleton Pattern.

The service includes a Validation phase that checks software archives based on service profiles declarations. It control also that service profiles are valid against the service profile schema. Controls performed includes checking that all declared files are in the right place into the service archive structure. After validation phase (if successfull) it store in a pending state all packages declared in service profile. When the Software Archive is approved the Software Repository finally store all packages in the repository for dynamic deployment


Functionality

The signatures of the actual implemented methods are presented below. These operations allow uploading, deleting, listing, and getting package. As well as other advanced operations that operate over packages dependencies.


1. store
store(StoreMessage) -> String

This operation stores a software archive into the Software Repository in pending state. Pending status means that software archive is valid, and receive an unique ID that it was not previously used. The main issue of this method is the validation. You can find more informations about the controls performed on Software Archives Specification


StoreMessage type contains Service Class, Service Name and Version of the service, the URL from where the software archive can be downloaded, and the service description. Further contains a String[] with scopes where the Service should be published.

Return String with the result description NEW (if is the service is not already stored), UPDATE if the service is already present on Software Repsoitory and will be updated.


2. approve
approve (String) -> String

Approve an already stored service archive with the service ID passed as argument if exists.

String Service ID

Return It returns OK if operation success, an error message otherwise.


3. delete
delete (String) -> String

This operation deletes a stored pending software archive from the Software Repository with the service ID passed as argument if exists.

String Service ID

Return It returns OK if operation success, an error message otherwise.

4. get
get(GetMessage) -> String


GetMessage type contains Service Class, Service Name, Service Version, Package Name and Package Version of the requested package

Return The method returns the URI from where the requested package can be downloaded.


5. listPending
listPending( ) -> String

Return This operation returns an XML containing all stored service archives with status pending. The XML structure is as follow:

<Services>
 <Service>
  <Id>7d829530-20cc-11dd-9bb6-f65af7f707cc</Id>
  <Class>Class</Class>
  <Name>Name</Name>
  <Version>1.0</Version>
 </Service>
</Services>


6. isDeployable
isDeployable(String) -> StringArray

With this functionality it is possible to know if a service is deployable. This means all dependences are deployable too.

String Service ID

Return StringArray containing on each element a piece of xml that describes the dependency

<Dependency>
	<Service>
		<Class>Class</Class>
		<Name>Name</Name>
		<Version>1.0</Version>
	</Service>
	<Package>MainPackage</Package>
	<Version>1.1</Version>
	<Scope level="GHN"/>
</Dependency>


7. listScopedPackages
listScopedPackages(ListScopedPackagesMessage) -> StringArray

This operation lists all dependencies with a certain scope level given as argument.

ListScopedPackagesMessage type contains serviceID and scope(GHN, VRE, VO)

Return StringArray containing on each element a piece of xml that describes the dependency

<Dependency>
	<Service>
		<Class>Class</Class>
		<Name>Name</Name>
		<Version>1.0</Version>
	</Service>
	<Package>MainPackage</Package>
	<Version>1.1</Version>
	<Scope level="GHN"/>
</Dependency>


Dependencies

The dependencies of the Package Repository Service are:

  • GHN: to host service.
  • Commons-compress from Jakarta: to File compress functionality.
  • hsqldb: to use the DB
  • MavenCustom: to use maven repository functionality


Know Bugs and Limitations