Difference between revisions of "VRE Manager"
Manuele.simi (Talk | contribs) (→Sample Usage) |
Manuele.simi (Talk | contribs) (→Requesting a deployment) |
||
(60 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
Manipulating a resource means to add or remove it from the scope managed by the VREManager instance. Howvere, there is one exception: the service resource. This type of resource represents a bunch of packages stored in the [[Software_Repository|Software Repository]] ready to be deployed. When a client asks to the VREManager to add a service to its scope, the VREManager creates a new instance of that service and joins such an instance to its scope. | Manipulating a resource means to add or remove it from the scope managed by the VREManager instance. Howvere, there is one exception: the service resource. This type of resource represents a bunch of packages stored in the [[Software_Repository|Software Repository]] ready to be deployed. When a client asks to the VREManager to add a service to its scope, the VREManager creates a new instance of that service and joins such an instance to its scope. | ||
− | + | ==== Interface ==== | |
− | The operations exposed by the VREManager | + | The operations exposed by the VREManager portType are: |
* '''AddResources''' - the AddResources operation allows to add one or more resources to the managed Scope. Depending on the type of the resource, a range of different actions is started after its invocation. | * '''AddResources''' - the AddResources operation allows to add one or more resources to the managed Scope. Depending on the type of the resource, a range of different actions is started after its invocation. | ||
* '''RemoveResources''' - the RemoveResources operation is the counterpart of the AddResources. It removes from the managed Scope a set of GCUBEResources. | * '''RemoveResources''' - the RemoveResources operation is the counterpart of the AddResources. It removes from the managed Scope a set of GCUBEResources. | ||
− | * '''GetReport''' - this operation permits to access the Resource Report produced by | + | * '''GetReport''' - this operation permits to access the [[VRE_Manager#Resource_Report|Resource Report]] produced by either the two previous operations |
− | * '''SendReport''' - this operation is invoked by the Deployer Services to send the Deployment Report | + | * '''SendReport''' - this operation is invoked by the Deployer Services to send the [[Deployer#Deployment_Report|Deployment Report]] |
* '''SetScopeOptions''' - this operation can be used to change some options related to the current scope management | * '''SetScopeOptions''' - this operation can be used to change some options related to the current scope management | ||
The public interface of the VREManager port-type can be found [[VREManager_WSDL|here]]. | The public interface of the VREManager port-type can be found [[VREManager_WSDL|here]]. | ||
− | ===== | + | ===== Requesting a deployment ===== |
− | A request to deploy new service instances within the VREManager | + | A request to deploy new service instances within the VREManager scope is performed through the <code>AddResources</code> operation. There are two main information to provide: |
* the list of services to deploy | * the list of services to deploy | ||
* the target GHNs | * the target GHNs | ||
Line 29: | Line 29: | ||
In the case number 1., the deployment of the related service is always tried on the given GHN. In the case number 2., the service tries to find out the best allocation of the services by minimizing the required deployment operation and optimizing the services' distribution. In the last case, the deployments are performed by taking into account the current GHNs available in the scope. | In the case number 1., the deployment of the related service is always tried on the given GHN. In the case number 2., the service tries to find out the best allocation of the services by minimizing the required deployment operation and optimizing the services' distribution. In the last case, the deployments are performed by taking into account the current GHNs available in the scope. | ||
The first twos can be combined, by forcing some deployments on specific GHNs, and leaving the others to be decided by the VREManager. | The first twos can be combined, by forcing some deployments on specific GHNs, and leaving the others to be decided by the VREManager. | ||
+ | ''' | ||
+ | Sample Usage''' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | The <code>AddResource</code> operation to request a deployment can be invoked as follows: | ||
+ | <source lang="java"> | ||
+ | ... | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.AddResourcesParameters; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.ServiceItem; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.ServiceList; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; | ||
+ | ... | ||
+ | |||
+ | EndpointReferenceType endpoint = new EndpointReferenceType(); | ||
+ | int numberOfServicesToDeploy = ... ; | ||
+ | try { | ||
+ | endpoint.setAddress(new Address("http://"+ <VREManager hostname>+":"+ <VREManager port> +"/wsrf/services/gcube/vremanagement/VREManager")); | ||
+ | VREManagerPortType pt; | ||
+ | |||
+ | GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { | ||
+ | public boolean isSecurityEnabled() {return false;}}; | ||
+ | pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), | ||
+ | GCUBEScope.getScope(...,managerSec); | ||
+ | |||
+ | AddResourcesParameters add = new AddResourcesParameters(); | ||
+ | ServiceItem[] servicelist = new ServiceItem[numberOfServicesToDeploy]; | ||
+ | for (int i = 0 ; i < ServiceItem.length; i++) { | ||
+ | servicelist[i] = new ServiceItem(); | ||
+ | servicelist[i].setServiceClass(...); | ||
+ | servicelist[i].setServiceName(...); | ||
+ | servicelist[i].setServiceVersion(...); | ||
+ | servicelist[i].setGHN(...); //forces target gHN for the service, if any | ||
+ | } | ||
+ | |||
+ | ServiceList l = new ServiceList(); | ||
+ | l.setService(servicelist); | ||
+ | add.setServices(l); | ||
+ | pt.addResources(add); | ||
+ | } catch (Exception e) { | ||
+ | //managing the error | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | In the example above, the target gHN for each service is explicitly set. If one wants to let the VREManager to decide on which gHN to deploy the input services, it suffices to do not pass a GHN per ServiceItem, but to set a gHNs list in the ServiceList object, like in the following example: | ||
+ | <pre> | ||
+ | String ghns = "GHN1ID,GHN2ID,GHN3ID,GHN4ID,GHN5ID" | ||
+ | ServiceList l = new ServiceList(); | ||
+ | l.setService(servicelist); | ||
+ | l.setGHN(ghns); | ||
+ | </pre> | ||
+ | The list of GHNs must be a comma-separated list of GHN IDs. | ||
===== Request to join a resource to the scope ===== | ===== Request to join a resource to the scope ===== | ||
+ | A request to join a GCUBEResource to the VREManager scope is performed through the AddResources operation. For each resource there are two main information to provide: | ||
+ | * the resource identifier | ||
+ | * the resource type (e.g. GHN, RunningInstance, Collection, etc) | ||
+ | |||
+ | Usage example: | ||
+ | |||
+ | <source lang="java"> | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.AddResourcesParameters; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.ResourceItem; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.ResourceList; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; | ||
+ | ... | ||
+ | |||
+ | EndpointReferenceType endpoint = new EndpointReferenceType(); | ||
+ | |||
+ | try { | ||
+ | endpoint.setAddress(new Address("http://"+ <VREManager hostname>+":"+ <VREManager port> +"/wsrf/services/gcube/vremanagement/VREManager")); | ||
+ | VREManagerPortType pt; | ||
+ | |||
+ | GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { | ||
+ | public boolean isSecurityEnabled() {return false;}}; | ||
+ | pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), | ||
+ | GCUBEScope.getScope(<caller scope>,managerSec); | ||
+ | |||
+ | AddResourcesParameters add = new AddResourcesParameters(); | ||
+ | ResourceItem[] resourcelist = new ResourceItem[3]; | ||
+ | for (int i = 1 ; i < (resourcelist.length +1); i++) { | ||
+ | resourcelist[i-1] = new ResourceItem(); | ||
+ | resourcelist[i-1].setID(<id>); | ||
+ | resourcelist[i-1].setType(<resource type>); | ||
+ | } | ||
+ | ResourceList r = new ResourceList(); | ||
+ | r.setResource(resourcelist); | ||
+ | add.setResources(r); | ||
+ | String reportID = pt.addResources(add); | ||
+ | System.out.println ("Returned report ID: " + reportID); | ||
+ | } catch (Exception e) { | ||
+ | //managing the error | ||
+ | } | ||
+ | |||
+ | |||
+ | </source> | ||
+ | |||
+ | ===== Getting the Resources Report ===== | ||
+ | The <code>GetReport</code> operation can be invoked as follows: | ||
+ | |||
+ | <source lang="java"> | ||
+ | |||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; | ||
+ | |||
+ | ... | ||
+ | |||
+ | EndpointReferenceType endpoint = new EndpointReferenceType(); | ||
+ | |||
+ | try { | ||
+ | endpoint.setAddress(new Address("http://"+ <VREManager hostname>+":"+ <VREManager port> +"/wsrf/services/gcube/vremanagement/VREManager")); | ||
+ | GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { | ||
+ | public boolean isSecurityEnabled() {return false;}}; | ||
+ | VREManagerPortType pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), | ||
+ | GCUBEScope.getScope(...),managerSec); | ||
+ | String report = pt.getReport(<Report ID >); | ||
+ | System.out.println (report); | ||
+ | } catch (Exception e) { | ||
+ | //manage the error | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | ===== Setting the scope options ===== | ||
+ | A number of options can be set on a scope by invoking the <code>SetScopeOptions</code> oepration. Actually, the following properties are accepted: | ||
+ | * ''Designer'': the designer of the scope | ||
+ | * ''Creator'': the creator of the scope | ||
+ | * ''StartTime'': the activation time of the scope (accepted format is yyyy-MM-dd'T'HH:mm:ssZ, example: 2008-11-11T16:58:12+01:00) | ||
+ | * ''EndTime'': the last time of the scope (accepted format is yyyy-MM-dd'T'HH:mm:ssZ, example: 2008-11-11T16:58:12+01:00) | ||
+ | * ''Description'': a scope description | ||
+ | * ''DisplayName'': a name to display in any GUI | ||
+ | * ''SecurityEnabled'': a boolean flag to set up a secure or non-secure VRE | ||
+ | |||
+ | All of them are optionals and, in the current version of the VREManager, they make sense only in a VRE scope. Moreover they can be set/updated any time, even if for some of them (like changing the start time once the scope is activated) such an action do not have any effect. | ||
+ | |||
+ | '''Sample Usage''' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | The <code>SetScopeOptions</code> operation can be invoked as follows: | ||
+ | |||
+ | <source lang="java"> | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; | ||
+ | import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; | ||
+ | |||
+ | ... | ||
+ | protected static String[] optionNames = new String[] {"creator", "designer", "endTime", "startTime", | ||
+ | "description", "displayName", "securityenabled"}; | ||
+ | |||
+ | EndpointReferenceType endpoint = new EndpointReferenceType(); | ||
+ | try { | ||
+ | endpoint.setAddress(new Address("http://"+ args[0]+":"+ args[1] +"/wsrf/services/gcube/vremanagement/VREManager")); | ||
+ | GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { | ||
+ | public boolean isSecurityEnabled() {return false;}}; | ||
+ | VREManagerPortType pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), | ||
+ | GCUBEScope.getScope(resources.getProperty("callerScope")),managerSec); | ||
+ | |||
+ | OptionsParameters options = new OptionsParameters(); | ||
+ | ScopeOption[] scopeOptionList = new ScopeOption[optionNames.length]; | ||
+ | for (int i=0; i < optionNames.length; i++) | ||
+ | scopeOptionList[i] = new ScopeOption(optionNames[i], <PROPERTY VALUE>); | ||
+ | |||
+ | options.setScopeOptionList(scopeOptionList); | ||
+ | pt.setScopeOptions(options); | ||
+ | |||
+ | } catch (Exception e) { | ||
+ | //manage the error | ||
+ | } | ||
+ | |||
+ | </source> | ||
+ | |||
+ | ==== State ==== | ||
+ | |||
+ | The Service publishes its state into the IS modelled as a Generic Resource. Such a state is a picture of the set of GCUBEResources joining the managed scope. Here it is a template for such a resource: | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
+ | <Resource> | ||
+ | ...usual GCUBEResouce headed... | ||
+ | <Profile> | ||
+ | <SecondaryType>VRE|VO|Infrastructure</SecondaryType> | ||
+ | <Name>scope name</Name> | ||
+ | <Description>scope description</Description> | ||
+ | <Body> | ||
+ | <Scope>scope expression</Scope> | ||
+ | <Service>URI of the VREManager managing the scope</Service> | ||
+ | <Creator>DN of the creator</Creator> | ||
+ | <Designer>DN of the designer</Designer> | ||
+ | <StartTime>start up time</StartTime> | ||
+ | <SecurityEnabled>boolean flag</SecurityEnabled> | ||
+ | <ScopedRescources> | ||
+ | ... list of GCUBEResources belonging the scope... | ||
+ | </ScopedRescources> | ||
+ | </Body> | ||
+ | </Profile> | ||
+ | </Resource> | ||
+ | </source> | ||
+ | |||
+ | Depending on the scope type, the Scope Resource may have a different SecondaryType (''Infrastructure'', ''VO'' and ''VRE''). | ||
+ | |||
+ | The state of the VREManager is serialized either in the IS and locally on the file system. At start up time the instance queries the IS for the remote serialization of its state and, in case it is not found, it looks for the local serialization. | ||
+ | |||
+ | The following is a sample serialization of the state taken when the managed scope is composed by 3 running instances and 1 content collection: | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
+ | <Resource> | ||
+ | <ID>f66c6af0-b26e-11dd-b52d-a0a66b833425</ID> | ||
+ | <Type>GenericResource</Type> | ||
+ | <Scopes> | ||
+ | <Scope>/gcube/devsec/BigBang</Scope> | ||
+ | </Scopes> | ||
+ | <Profile> | ||
+ | <SecondaryType>VRE</SecondaryType> | ||
+ | <Name>BigBangVRE</Name> | ||
+ | <Description>secondVRE</Description> | ||
+ | <Body> | ||
+ | <Scope>/gcube/devsec/BigBang</Scope> | ||
+ | <Service>http://dlib33.isti.cnr.it:8002/wsrf/services/gcube/vremanagement/VREManager</Service> | ||
+ | <Creator>CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT</Creator> | ||
+ | <Designer>CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT</Designer> | ||
+ | <StartTime>2008-11-14T18:09:14+01:00</StartTime> | ||
+ | <SecurityEnabled>false</SecurityEnabled> | ||
+ | <ScopedRescources> | ||
+ | <ScopedRescource> | ||
+ | <ResourceID>af4ede50-b28c-11dd-9f37-e238d9877c06</ResourceID> | ||
+ | <ResourceType>RunningInstance</ResourceType> | ||
+ | <HostedOn>dlib33.isti.cnr.it:8001</HostedOn> | ||
+ | </ScopedRescource> | ||
+ | <ScopedRescource> | ||
+ | <ResourceID>4a2eca60-b293-11dd-8c95-9a3d3d893fb0</ResourceID> | ||
+ | <ResourceType>RunningInstance</ResourceType> | ||
+ | <HostedOn>dlib33.isti.cnr.it:8001</HostedOn> | ||
+ | </ScopedRescource> | ||
+ | <ScopedRescource> | ||
+ | <ResourceID>2fc77e50-b294-11dd-80a0-f5a49621b0ea</ResourceID> | ||
+ | <ResourceType>RunningInstance</ResourceType> | ||
+ | <HostedOn>dlib16.isti.cnr.it:8080</HostedOn> | ||
+ | </ScopedRescource> | ||
+ | <ScopedRescource> | ||
+ | <ResourceID>f66c6af0-b26e-11dd-b52d-a0a66b833425</ResourceID> | ||
+ | <ResourceType>Collection</ResourceType> | ||
+ | </ScopedRescource> | ||
+ | </ScopedRescources> | ||
+ | </Body> | ||
+ | </Profile> | ||
+ | </Resource> | ||
+ | </source> | ||
==== Resource Report ==== | ==== Resource Report ==== | ||
− | After each resource management request, a report is produced | + | After each resource management request, a report is produced and disseminated. |
For each service, information about the service's dependencies resolution and package deployment are reported. | For each service, information about the service's dependencies resolution and package deployment are reported. | ||
Line 54: | Line 301: | ||
* ''FAILED'': the deployment failed | * ''FAILED'': the deployment failed | ||
* ''DEPLOYED'': the package has been deployed | * ''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 | * ''ACTIVATED'': the package has been activated | ||
* ''RUNNING'': the related instance is running | * ''RUNNING'': the related instance is running | ||
Line 63: | Line 311: | ||
* ''FAILED'': an error occurred and the resource has not been managed | * ''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: | |
− | < | + | <source lang="xml"> |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<ResourceReport> | <ResourceReport> | ||
Line 114: | Line 362: | ||
<PackageName>Notifier-service</PackageName> | <PackageName>Notifier-service</PackageName> | ||
<PackageVersion>1.01.00</PackageVersion> | <PackageVersion>1.01.00</PackageVersion> | ||
− | <Status> | + | <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> | <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> | ||
Line 123: | Line 371: | ||
<PackageName>Notifier-stubs</PackageName> | <PackageName>Notifier-stubs</PackageName> | ||
<PackageVersion>1.00.01</PackageVersion> | <PackageVersion>1.00.01</PackageVersion> | ||
− | <Status> | + | <Status>ACTIVATED</Status> |
<Message>The package could not be deployed because it depends on a package which has an error</Message> | <Message>The package could not be deployed because it depends on a package which has an error</Message> | ||
</Package> | </Package> | ||
Line 136: | Line 384: | ||
<Status>ADDED</Status> | <Status>ADDED</Status> | ||
<ErrorDescription>-</ErrorDescription> | <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> | </Resource> | ||
</Resources> | </Resources> | ||
</ResourceReport> | </ResourceReport> | ||
− | </ | + | </source> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
==== Configuration ==== | ==== Configuration ==== | ||
Line 232: | Line 420: | ||
|-addresource.sh | |-addresource.sh | ||
|-getreport.sh | |-getreport.sh | ||
+ | |-setscopeoptions.sh | ||
|-... | |-... | ||
</pre> | </pre> | ||
− | Each script allows to test | + | Each script allows to test a different service's operation or group of operations logically related. In the following, an explanation of each script and its usage is provided. |
+ | '''SetScopeOptions''' | ||
+ | |||
+ | ---- | ||
+ | The SetScopeOptions script invokes the <code>SetScopeOptions</code> operation to set some options on a scope. It must be executed as follows: | ||
+ | <pre> | ||
+ | ./setscopeoptions.sh <VREManager host> <VREManager port> <configuration file> | ||
+ | </pre> | ||
+ | This is an example of configuration file that can be provided: | ||
+ | <pre> | ||
+ | callerScope=/gcube/devsec/BigBang | ||
+ | |||
+ | # scope options | ||
+ | creator=CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT | ||
+ | designer=CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT | ||
+ | securityenabled=false | ||
+ | displayName=BigBangVRE | ||
+ | description=secondVRE | ||
+ | startTime=2008-11-11T16:58:12+01:00 | ||
+ | endTime=2008-11-21T19:00:00+01:00 | ||
+ | </pre> | ||
'''AddResource''' | '''AddResource''' | ||
---- | ---- | ||
− | The AddResources script invokes the AddResources operation to add new GCUBEResources on a scope. It must be executed as follows | + | The AddResources script invokes the <code>AddResources</code> operation to add new GCUBEResources on a scope. It must be executed as follows |
<pre> | <pre> | ||
Line 253: | Line 462: | ||
<pre> | <pre> | ||
#global properties | #global properties | ||
+ | numOfResourcesToAdd=0 | ||
numOfServicesToAdd=2 | numOfServicesToAdd=2 | ||
targetScope=/gcube/devsec | targetScope=/gcube/devsec | ||
callerScope=/gcube/devsec | callerScope=/gcube/devsec | ||
− | # | + | # resources' list |
service.1.name=IS-Notifier | service.1.name=IS-Notifier | ||
service.1.class=InformationSystem | service.1.class=InformationSystem | ||
Line 271: | Line 481: | ||
</pre> | </pre> | ||
− | This request will trigger the creation of | + | This request will trigger the creation of a running instance for each of the two given services on the gHN identified by the ''service.X.GHN'' parameter.The VREManager is contacted with a call in the scope reported as value of the ''callerScope'' parameter and the instances will be created within the ''targetScope''. |
+ | |||
+ | If we want to let the VREManager to decide on which gHNs to deploy, we must pass the ''GHNSet'' property with a comma-separated list of GHN IDs and remove the ''service.X.GHN'' properties: | ||
+ | |||
+ | <pre> | ||
+ | #GHNID on which the service will be deployed | ||
+ | GHNSet=ad9e4820-b28c-11dd-9f37-e238d9877c06,a938b7d0-88ce-11dd-a38a-f9b09f00a04e | ||
+ | </pre> | ||
+ | |||
+ | This is another example requesting to add two existing GCUBEResources to the managed scope: | ||
+ | |||
+ | <pre> | ||
+ | numOfServicesToAdd=0 | ||
+ | numOfResourcesToAdd=2 | ||
+ | targetScope=/gcube/devsec | ||
+ | callerScope=/gcube/devsec | ||
+ | |||
+ | # resources' list | ||
+ | resource.1.id=61927680-a996-11dd-961c-8eba14a244c3 | ||
+ | resource.1.type=MetadataCollection | ||
+ | |||
+ | resource.2.id=c7f58c70-ab29-11dd-9aa4-a9079c16574b | ||
+ | resource.2.type=GenericResource | ||
+ | </pre> | ||
− | + | The operation always returns the Resource Report ID that can be used to invoke the GetReport operation. | |
'''GetReport''' | '''GetReport''' | ||
Line 283: | Line 516: | ||
</pre> | </pre> | ||
− | This request will print out the [[VRE_Manager# | + | This request will print out the [[VRE_Manager#Resource_Report|resource report]] related to the given report ID. |
[[Category:VRE Management]] | [[Category:VRE Management]] |
Latest revision as of 20:37, 5 February 2010
The VREManager is a gCube Service offering the facilities for managing the constituents of the VREs, namely the service instances. It is the service in charge to coordinate the overall deployment and operation of each VRE.
Contents
Design
Within the gCube architecture, the VREManager is placed at the top of a stack of the VREManagement services, below only the VRE Modeler service. Each instance of the service is devoted to manage one and only one specific scope and, within such a scope, it is in charge of adding/updating/removing GCUBEResource. For a detailed explanation about what is a scope and what is in scope, check the Scope Management section of the gCore Developer Guide.
The VREManager adopts the Singleton pattern and it exposes a single port-type, gcube/vremanagement/vremanager/VREManager
. Clients may manipulate GCUBEResources within the scope and get back information about what's going on by using the operations of such a port-type.
Manipulating a resource means to add or remove it from the scope managed by the VREManager instance. Howvere, there is one exception: the service resource. This type of resource represents a bunch of packages stored in the Software Repository ready to be deployed. When a client asks to the VREManager to add a service to its scope, the VREManager creates a new instance of that service and joins such an instance to its scope.
Interface
The operations exposed by the VREManager portType are:
- AddResources - the AddResources operation allows to add one or more resources to the managed Scope. Depending on the type of the resource, a range of different actions is started after its invocation.
- RemoveResources - the RemoveResources operation is the counterpart of the AddResources. It removes from the managed Scope a set of GCUBEResources.
- GetReport - this operation permits to access the Resource Report produced by either the two previous operations
- SendReport - this operation is invoked by the Deployer Services to send the Deployment Report
- SetScopeOptions - this operation can be used to change some options related to the current scope management
The public interface of the VREManager port-type can be found here.
Requesting a deployment
A request to deploy new service instances within the VREManager scope is performed through the AddResources
operation. There are two main information to provide:
- the list of services to deploy
- the target GHNs
The former must be specified by populating the ServiceList
object defined in the WSDL interface. Rather, there are several options to define the GHNs on which the deployment is done:
- to provide a GHN per each service
- to provide a list of GHNs for all the services
- to provide an empty list
In the case number 1., the deployment of the related service is always tried on the given GHN. In the case number 2., the service tries to find out the best allocation of the services by minimizing the required deployment operation and optimizing the services' distribution. In the last case, the deployments are performed by taking into account the current GHNs available in the scope. The first twos can be combined, by forcing some deployments on specific GHNs, and leaving the others to be decided by the VREManager. Sample Usage
The AddResource
operation to request a deployment can be invoked as follows:
... import org.gcube.vremanagement.vremanager.stubs.vremanager.AddResourcesParameters; import org.gcube.vremanagement.vremanager.stubs.vremanager.ServiceItem; import org.gcube.vremanagement.vremanager.stubs.vremanager.ServiceList; import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; ... EndpointReferenceType endpoint = new EndpointReferenceType(); int numberOfServicesToDeploy = ... ; try { endpoint.setAddress(new Address("http://"+ <VREManager hostname>+":"+ <VREManager port> +"/wsrf/services/gcube/vremanagement/VREManager")); VREManagerPortType pt; GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { public boolean isSecurityEnabled() {return false;}}; pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), GCUBEScope.getScope(...,managerSec); AddResourcesParameters add = new AddResourcesParameters(); ServiceItem[] servicelist = new ServiceItem[numberOfServicesToDeploy]; for (int i = 0 ; i < ServiceItem.length; i++) { servicelist[i] = new ServiceItem(); servicelist[i].setServiceClass(...); servicelist[i].setServiceName(...); servicelist[i].setServiceVersion(...); servicelist[i].setGHN(...); //forces target gHN for the service, if any } ServiceList l = new ServiceList(); l.setService(servicelist); add.setServices(l); pt.addResources(add); } catch (Exception e) { //managing the error }
In the example above, the target gHN for each service is explicitly set. If one wants to let the VREManager to decide on which gHN to deploy the input services, it suffices to do not pass a GHN per ServiceItem, but to set a gHNs list in the ServiceList object, like in the following example:
String ghns = "GHN1ID,GHN2ID,GHN3ID,GHN4ID,GHN5ID" ServiceList l = new ServiceList(); l.setService(servicelist); l.setGHN(ghns);
The list of GHNs must be a comma-separated list of GHN IDs.
Request to join a resource to the scope
A request to join a GCUBEResource to the VREManager scope is performed through the AddResources operation. For each resource there are two main information to provide:
- the resource identifier
- the resource type (e.g. GHN, RunningInstance, Collection, etc)
Usage example:
import org.gcube.vremanagement.vremanager.stubs.vremanager.AddResourcesParameters; import org.gcube.vremanagement.vremanager.stubs.vremanager.ResourceItem; import org.gcube.vremanagement.vremanager.stubs.vremanager.ResourceList; import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; ... EndpointReferenceType endpoint = new EndpointReferenceType(); try { endpoint.setAddress(new Address("http://"+ <VREManager hostname>+":"+ <VREManager port> +"/wsrf/services/gcube/vremanagement/VREManager")); VREManagerPortType pt; GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { public boolean isSecurityEnabled() {return false;}}; pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), GCUBEScope.getScope(<caller scope>,managerSec); AddResourcesParameters add = new AddResourcesParameters(); ResourceItem[] resourcelist = new ResourceItem[3]; for (int i = 1 ; i < (resourcelist.length +1); i++) { resourcelist[i-1] = new ResourceItem(); resourcelist[i-1].setID(<id>); resourcelist[i-1].setType(<resource type>); } ResourceList r = new ResourceList(); r.setResource(resourcelist); add.setResources(r); String reportID = pt.addResources(add); System.out.println ("Returned report ID: " + reportID); } catch (Exception e) { //managing the error }
Getting the Resources Report
The GetReport
operation can be invoked as follows:
import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; ... EndpointReferenceType endpoint = new EndpointReferenceType(); try { endpoint.setAddress(new Address("http://"+ <VREManager hostname>+":"+ <VREManager port> +"/wsrf/services/gcube/vremanagement/VREManager")); GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { public boolean isSecurityEnabled() {return false;}}; VREManagerPortType pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), GCUBEScope.getScope(...),managerSec); String report = pt.getReport(<Report ID >); System.out.println (report); } catch (Exception e) { //manage the error }
Setting the scope options
A number of options can be set on a scope by invoking the SetScopeOptions
oepration. Actually, the following properties are accepted:
- Designer: the designer of the scope
- Creator: the creator of the scope
- StartTime: the activation time of the scope (accepted format is yyyy-MM-dd'T'HH:mm:ssZ, example: 2008-11-11T16:58:12+01:00)
- EndTime: the last time of the scope (accepted format is yyyy-MM-dd'T'HH:mm:ssZ, example: 2008-11-11T16:58:12+01:00)
- Description: a scope description
- DisplayName: a name to display in any GUI
- SecurityEnabled: a boolean flag to set up a secure or non-secure VRE
All of them are optionals and, in the current version of the VREManager, they make sense only in a VRE scope. Moreover they can be set/updated any time, even if for some of them (like changing the start time once the scope is activated) such an action do not have any effect.
Sample Usage
The SetScopeOptions
operation can be invoked as follows:
import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType; import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator; ... protected static String[] optionNames = new String[] {"creator", "designer", "endTime", "startTime", "description", "displayName", "securityenabled"}; EndpointReferenceType endpoint = new EndpointReferenceType(); try { endpoint.setAddress(new Address("http://"+ args[0]+":"+ args[1] +"/wsrf/services/gcube/vremanagement/VREManager")); GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { public boolean isSecurityEnabled() {return false;}}; VREManagerPortType pt = GCUBERemotePortTypeContext.getProxy(new VREManagerServiceAddressingLocator().getVREManagerPortTypePort(endpoint), GCUBEScope.getScope(resources.getProperty("callerScope")),managerSec); OptionsParameters options = new OptionsParameters(); ScopeOption[] scopeOptionList = new ScopeOption[optionNames.length]; for (int i=0; i < optionNames.length; i++) scopeOptionList[i] = new ScopeOption(optionNames[i], <PROPERTY VALUE>); options.setScopeOptionList(scopeOptionList); pt.setScopeOptions(options); } catch (Exception e) { //manage the error }
State
The Service publishes its state into the IS modelled as a Generic Resource. Such a state is a picture of the set of GCUBEResources joining the managed scope. Here it is a template for such a resource:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Resource> ...usual GCUBEResouce headed... <Profile> <SecondaryType>VRE|VO|Infrastructure</SecondaryType> <Name>scope name</Name> <Description>scope description</Description> <Body> <Scope>scope expression</Scope> <Service>URI of the VREManager managing the scope</Service> <Creator>DN of the creator</Creator> <Designer>DN of the designer</Designer> <StartTime>start up time</StartTime> <SecurityEnabled>boolean flag</SecurityEnabled> <ScopedRescources> ... list of GCUBEResources belonging the scope... </ScopedRescources> </Body> </Profile> </Resource>
Depending on the scope type, the Scope Resource may have a different SecondaryType (Infrastructure, VO and VRE).
The state of the VREManager is serialized either in the IS and locally on the file system. At start up time the instance queries the IS for the remote serialization of its state and, in case it is not found, it looks for the local serialization.
The following is a sample serialization of the state taken when the managed scope is composed by 3 running instances and 1 content collection:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Resource> <ID>f66c6af0-b26e-11dd-b52d-a0a66b833425</ID> <Type>GenericResource</Type> <Scopes> <Scope>/gcube/devsec/BigBang</Scope> </Scopes> <Profile> <SecondaryType>VRE</SecondaryType> <Name>BigBangVRE</Name> <Description>secondVRE</Description> <Body> <Scope>/gcube/devsec/BigBang</Scope> <Service>http://dlib33.isti.cnr.it:8002/wsrf/services/gcube/vremanagement/VREManager</Service> <Creator>CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT</Creator> <Designer>CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT</Designer> <StartTime>2008-11-14T18:09:14+01:00</StartTime> <SecurityEnabled>false</SecurityEnabled> <ScopedRescources> <ScopedRescource> <ResourceID>af4ede50-b28c-11dd-9f37-e238d9877c06</ResourceID> <ResourceType>RunningInstance</ResourceType> <HostedOn>dlib33.isti.cnr.it:8001</HostedOn> </ScopedRescource> <ScopedRescource> <ResourceID>4a2eca60-b293-11dd-8c95-9a3d3d893fb0</ResourceID> <ResourceType>RunningInstance</ResourceType> <HostedOn>dlib33.isti.cnr.it:8001</HostedOn> </ScopedRescource> <ScopedRescource> <ResourceID>2fc77e50-b294-11dd-80a0-f5a49621b0ea</ResourceID> <ResourceType>RunningInstance</ResourceType> <HostedOn>dlib16.isti.cnr.it:8080</HostedOn> </ScopedRescource> <ScopedRescource> <ResourceID>f66c6af0-b26e-11dd-b52d-a0a66b833425</ResourceID> <ResourceType>Collection</ResourceType> </ScopedRescource> </ScopedRescources> </Body> </Profile> </Resource>
Resource Report
After each resource management request, a report is produced and disseminated.
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>
Configuration
The only configuration parameter is the Scope in which the instance has to operate in. This can be specified in two ways:
- as static start Scope of the RI (see the releate section on the gCore Developer Guide for details);
- as deployment parameter, in case the VREManager itself is dynamically deployed trough the Deployer facilities.
The test-suite
The VREManager comes with a test-suite package allowing to test its functionalities.The test-suite is completely independent and does not require any other gCube package, except than a local gCore installation. The package is composed by a set of classes, sample configuration files and scripts ready to be executed.
|-lib |--org.gcube.vremanagement.vremanager.testsuite.jar | |-samples |---... | |-addresource.sh |-getreport.sh |-setscopeoptions.sh |-...
Each script allows to test a different service's operation or group of operations logically related. In the following, an explanation of each script and its usage is provided.
SetScopeOptions
The SetScopeOptions script invokes the SetScopeOptions
operation to set some options on a scope. It must be executed as follows:
./setscopeoptions.sh <VREManager host> <VREManager port> <configuration file>
This is an example of configuration file that can be provided:
callerScope=/gcube/devsec/BigBang # scope options creator=CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT designer=CN=Manuele Simi, L=NMIS-ISTI, OU=Personal Certificate, O=INFN, C=IT securityenabled=false displayName=BigBangVRE description=secondVRE startTime=2008-11-11T16:58:12+01:00 endTime=2008-11-21T19:00:00+01:00
AddResource
The AddResources script invokes the AddResources
operation to add new GCUBEResources on a scope. It must be executed as follows
./addresource.sh <VREManager host> <VREManager port> <configuration file>
Clearly, the VREManager host and port are the information needed to contact the VREManager instance, while the configuration file reports the information about the resources to add or create and the scope in which they have to be managed.
This is an example of configuration file requesting the creation of two resources of type Service:
#global properties numOfResourcesToAdd=0 numOfServicesToAdd=2 targetScope=/gcube/devsec callerScope=/gcube/devsec # resources' list service.1.name=IS-Notifier service.1.class=InformationSystem service.1.version=1.00.00 #GHNID on which the resource will be created service.1.GHN=a938b7d0-88ce-11dd-a38a-f9b09f00a04e service.2.name=AuthorizationService service.2.class=DVOS service.2.version=1.00.00 #GHNID on which the resource will be created service.2.GHN=a938b7d0-88ce-11dd-a38a-f9b09f00a04e
This request will trigger the creation of a running instance for each of the two given services on the gHN identified by the service.X.GHN parameter.The VREManager is contacted with a call in the scope reported as value of the callerScope parameter and the instances will be created within the targetScope.
If we want to let the VREManager to decide on which gHNs to deploy, we must pass the GHNSet property with a comma-separated list of GHN IDs and remove the service.X.GHN properties:
#GHNID on which the service will be deployed GHNSet=ad9e4820-b28c-11dd-9f37-e238d9877c06,a938b7d0-88ce-11dd-a38a-f9b09f00a04e
This is another example requesting to add two existing GCUBEResources to the managed scope:
numOfServicesToAdd=0 numOfResourcesToAdd=2 targetScope=/gcube/devsec callerScope=/gcube/devsec # resources' list resource.1.id=61927680-a996-11dd-961c-8eba14a244c3 resource.1.type=MetadataCollection resource.2.id=c7f58c70-ab29-11dd-9aa4-a9079c16574b resource.2.type=GenericResource
The operation always returns the Resource Report ID that can be used to invoke the GetReport operation.
GetReport
The GetReport script invokes the GetReport operation to retrieve a Resource Report. It must be executed as follows
./getreport.sh <VREManager host> <VREManager port> <caller scope> <report ID>
This request will print out the resource report related to the given report ID.