Resource Manager

From Gcube Wiki
Revision as of 18:02, 17 March 2010 by Manuele.simi (Talk | contribs) (Code design)

Jump to: navigation, search

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

Code design

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]

Other points to expand
  • 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
  • Observer pattern-based internal strategy for managing the scope state
  • Local XStream serialization
  • Synchronization between local and remote (i.e. stored in the IS) state and vice versa
  • ...

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).

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

Possible dependencies states 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 state:

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

Possible package states 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 states:

  • 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" standalone="yes"?>
<ResourceReport>
  <ID>4522f7c0-a54c-11dd-8525-e7e836b0fdde</ID>
  <LastUpdate>2008-10-29T00:58:17+01:00</LastUpdate>
  <TargetScope>/gcube/devsec</TargetScope>
  <Services>
    <Service>
      <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>
    </Service>
  </Services>
  <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>The package has NOT been successfully deployed. Possible cause: unable to deploy because of a RI of the service is already deployed on this node</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>The package could not be deployed because it depends on a package which has an error</Message>
          </Package>
        </Packages>
      </LastReportReceived>
    </GHN>
  </DeploymentActivity>
  <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>
</ResourceReport>

gHNManager integration

...

Deployer integration

...

Resource Broker integration

...