Difference between revisions of "Resource Manager"

From Gcube Wiki
Jump to: navigation, search
(Resource Report)
(Code design)
Line 5: Line 5:
 
==== Design ====
 
==== Design ====
  
===== Code design =====
+
===== Service architecture and code design =====
 +
 
 +
The service adopts a singleton WSRF pattern. This means that there is a single stateful resource keeping the state of the managed Scope.
  
 
The following class diagram shows a simplified view of the organization and structure of the Resource Manager's source code.
 
The following class diagram shows a simplified view of the organization and structure of the Resource Manager's source code.

Revision as of 15:41, 19 March 2010

The ResourceManager service is in charge of managing gCube Scope contexts. An instance (and only one) of the service must be deployed for each scope (at any level, i.e. infrastructure, VO, VRE) in order to handle gCube Resources within the assigned scope.

...

Design

Service architecture and code design

The service adopts a singleton WSRF pattern. This means that there is a single stateful resource keeping the state of the managed Scope.

The following class diagram shows a simplified view of the organization and structure of the Resource Manager's source code.

Resource Manager Class Diagram

[TBD]

Concept, role and design of ScopedResource

A Resource Manager instance handles the Scope it is managing as a set of Scoped Resources. A Scoped Resource models a gCube Resource in a specific Scope. At the heart of the Scope management activities there is the management of the state of the Scoped Resources belonging the Scope.

The following diagram depicts the possible Scope Resource's statuses and the legal transitions among them. The starting point of the life of a Scope Resource is always the request to join an existing gCube Resource to the Scope.


Scoped Resource life cycle

The crucial statuses are ADDED and REMOVED, where the concrete (and resource specific) actions to join the gCube Resource to the Scope are performed. For instance, in case of a Service Resource, a new instance of the service is deployed when managing the ADDED status, while undeployment is performed in the REMOVED status.

[TBC]


Scope state
  • Scope state management versus old VRE state management
  • Raw state separated from the state behavior to avoid mis-serializations due to any future change in the service implementation
  • Local XStream serialization
  • Synchronization between local and remote (i.e. stored in the IS) state and vice versa
  • ...

[TBC]

Observer pattern strategy

The service adopts an observer pattern-based internal strategy for managing the scope state. Each time the state of any Scoped Resource changes, registered observers are properly notified in order to manage the new state.

[TBC]

Interface

The service exposes a single ResourceManager portType ...



Resource Report

After each resource management request, a report is produced and disseminated (via the getReport operation). The basic structure of the report is:

<ResourceReport>
  <ID><!--report ID --></ID>
  <LastUpdate><!--last update time --></LastUpdate>
  <TargetScope><!-- target scope of the operations reported in the following section --></TargetScope>
  <Resources>
     <!-- list of gCube resources involved and their actual status-->  
  </Resources>
  <Services>
   <!-- per each service involved in the request, a section like the following-->
    <Service>
 
     <!-- service data --> 
 
     <DependenciesResolution>
 
     <!-- information about service's dependencies (missed, resolved))-->
 
     </DependenciesResolution>
     <DeploymentActivity>
 
     <!-- information about deployment activities on the target gHN-->
 
     </DeploymentActivity>
    <Service>
  </Services>
</ResourceReport>

For each service, information about the service's dependencies resolution and package deployment are reported.

Possible dependencies statuses are:

  • SUCCESS: all the dependencies have been successfully resolved
  • FAILED: some dependencies are missing

Periodically, the Deployer service sends a report on the deployment activity (performed asynchronously with respect to the VREManager request). Such report has a status:

  • OPEN: the activity is still ongoing, other reports will follow
  • CLOSED : the activity is closed, no further report will be sent

Possible package statuses are:

  • WAITING: request is still pending
  • ALREADYDEPLOYED: the package was already available on the target gHN
  • SKIPPED: the package was not deployed due to an error in another service from which it depends on
  • FAILED: the deployment failed
  • DEPLOYED: the package has been deployed
  • NOTVERIFIED: the package has been deployed, but the correctness of the operation cannot be checked (and therefore guaranteed)
  • ACTIVATED: the package has been activated
  • RUNNING: the related instance is running

Possible resource statuses:

  • ADDED: the resource was successfully added to the scope
  • REMOVED: the resource was successfully removed to the scope
  • FAILED: an error occurred and the resource has not been managed

This is a sample report showing the results of a request including the add of a service, a generic resource, a collection and an existing running instance to the managed scope:

<?xml version="1.0" encoding="UTF-8"?>
<ResourceReport>
  <ID>4522f7c0-a54c-11dd-8525-e7e836b0fdde</ID>
  <LastUpdate>2008-10-29T00:58:17+01:00</LastUpdate>
  <TargetScope>/gcube/devsec</TargetScope>
  <Resources>
    <Resource>
      <ID>83080450-a235-11dd-8a29-b025e02401d5</ID>
      <Type>RunningInstance</Type>
      <Status>ADDED</Status>
      <ErrorDescription>-</ErrorDescription>
    </Resource>
    <Resource>
      <ID>61927680-a996-11dd-961c-8eba14a244c3</ID>
      <Type>MetadataCollection</Type>
      <Status>ADDED</Status>
      <ErrorDescription>-</ErrorDescription>
    </Resource>
    <Resource>
      <ID>f2c04460-b446-11dd-8aab-e7a1e3fdae89</ID>
      <Type>GenericResource</Type>
      <Status>ADDED</Status>
      <ErrorDescription>-</ErrorDescription>
    </Resource>
  </Resources>
  <Services>
    <Service>
      <ID>83080450-a235-11dd-8a29-b025e0249999</ID>
      <Class>InformationSystem</Class>
      <Name>IS-Notifier</Name>
      <Version>1.00.00</Version>
      <DependenciesResolutionStatus>SUCCESS</DependenciesResolutionStatus>
      <DeployedOn>9bf172d0-a30c-11dd-88bf-83f7edc13611</DeployedOn>
      <ErrorDescription>-</ErrorDescription>
      <DependenciesResolution>
        <ResolvedDependencies>
          <Dependency>
            <ServiceClass>InformationSystem</ServiceClass>
            <ServiceName>IS-Notifier</ServiceName>
            <ServiceVersion>1.00.00</ServiceVersion>
            <PackageName>Notifier-service</PackageName>
            <PackageVersion>1.01.00</PackageVersion>
          </Dependency>
          <Dependency>
            <ServiceClass>InformationSystem</ServiceClass>
            <ServiceName>IS-Notifier</ServiceName>
            <ServiceVersion>1.00.00</ServiceVersion>
            <PackageName>Notifier-stubs</PackageName>
            <PackageVersion>1.00.01</PackageVersion>
          </Dependency>
        </ResolvedDependencies>
        <MissingDependencies/>
      </DependenciesResolution>
      <DeploymentActivity>
        <GHN>
          <Host>dlib33.isti.cnr.it:8001</Host>
          <ID>9bf172d0-a30c-11dd-88bf-83f7edc13611</ID>
          <LastReportReceivedOn>2008-10-29T00:58:16+01:00</LastReportReceivedOn>
          <LastReportReceived>
            <Status>OPEN</Status>
            <Packages>
              <Package>
                <ServiceClass>InformationSystem</ServiceClass>
                <ServiceName>IS-Notifier</ServiceName>
                <ServiceVersion>1.00.00</ServiceVersion>
                <PackageName>Notifier-service</PackageName>
                <PackageVersion>1.01.00</PackageVersion>
                <Status>RUNNING</Status>
                <Message/>
              </Package>
              <Package>
                <ServiceClass>InformationSystem</ServiceClass>
                <ServiceName>IS-Notifier</ServiceName>
                <ServiceVersion>1.00.00</ServiceVersion>
                <PackageName>Notifier-stubs</PackageName>
                <PackageVersion>1.00.01</PackageVersion>
                <Status>ACTIVATED</Status>
                <Message/>
              </Package>
            </Packages>
          </LastReportReceived>
        </GHN>
      </DeploymentActivity>
    </Service>
  </Services>
</ResourceReport>

gHNManager integration

...

Deployer integration

...

Resource Broker integration

...

Test-suite and sample usages