Ticket #120 (closed defect: wontfix)

Opened 9 years ago

Last modified 7 years ago

Revamp Site->Add resource pool

Reported by: aydan Owned by: ibaldin
Priority: major Milestone:
Component: ORCA: Web Portal Version: Camano 3.1
Keywords: Cc:

Description (last modified by ibaldin) (diff)

From Aydan on 12/21/2010:

The portal and the rest of the system communicate - separate the web piece from ORCA server. Might as well define bean classes that would be passed through that interface.

There is an xsd file in manage/standard/resource there is a types.xsd and standard.xsd. Types.xsd will have the definitions. types.xsd is the base one. add stuff to standard.xsd. Define bean there. There is an ant task one folder up called 'beans'

under trunk/pom.xml there is a profile called 'ant' . this profile is a way to prepare a classpath so ant can be invoked using maven to bring necessary jars (including wsgen). This profile defines properties and will invoke by default build.xml.

In manager/standard you say 'mvn -P ant -Dtarget=beans' to regenerate beans. Unfortunately these beans are (maybe) based on axis1.

Look at standard.wsdl . there is a container service that is defined somewhere in some wsdl file

core/shirako/resources/ look for wsdl files. There is a wsdl for the container, there is wsdl for an actor (also authority/broker/sm). The ones for the container is the initial attempt to provide management api for the container.

There is a big kludge - when a sm asks broker for a ticket. broker gives back a ticket that says it is from a site. if sm goes to talk to site, there were problem rampart problems with certificate validation. rampart running at the authority would not recognize the pubkey of the sm. so now sm makes a call to the site.

Going back to adding api. Resource pools are slices. so you can use slices. on the site every pool is a unique slice. every reservation from that pool is placed in this slice. meaning e.g. initial tickets delegated from that slice. Every ticket in the system originates form a site . a ticket is a reservation. that initial reservation is placed in the slice that represents the resource pool. This is used in recovery.

There is a lot of replication in the system. There is a lot in boot/ that should be under manage. Moving stuff around is possible. Or replicate.

Move orca.boot.inventory under manage and move ndlfactory

look at poolcreator line 37 - uses reflection (FYI).

Move orca.boot.inventory under manage - this will make manage depend on network but that's ok.

Fold manage into the core is the strategy, because some of functionality there should not be treated as an extension.

Create manage2 project and core-aux projects - manage2 will be the new xmlrpc formal guy and orca-aux would be things that are taken out of manage and eventually need to go into the core (but only after manage is retired).

Attachments

pool-add.vm (14.8 kB) - added by ibaldin 8 years ago.
pool-add.vm
pool-add-action.vm (1.7 kB) - added by ibaldin 8 years ago.
pool-add-action.vm

Change History

Changed 8 years ago by ibaldin

  • status changed from new to assigned
  • owner changed from aydan to ibaldin
  • description modified (diff)

Changed 8 years ago by ibaldin

  • version changed from Bella 2.1 to Camano 3.0

Previous attempt at making it work - there is a need for boot code in manage, however manage depends on boot, so no dice. Here is a diff of previous code as a reminder:

dhcp-54:manage ibaldin$ svn diff
Index: standard/src/main/java/orca/manage/extensions/standard/actors/proxies/local/LocalAuthorityManagementProxy.java
===================================================================
--- standard/src/main/java/orca/manage/extensions/standard/actors/proxies/local/LocalAuthorityManagementProxy.java (revision 2903)
+++ standard/src/main/java/orca/manage/extensions/standard/actors/proxies/local/LocalAuthorityManagementProxy.java (working copy)
@@ -11,7 +11,11 @@

package orca.manage.extensions.standard.actors.proxies.local;


import java.security.cert.Certificate;

+import java.util.Date;
+import java.util.Properties;

+import orca.boot.beans.Attributes;
+import orca.boot.beans.Handler;

import orca.manage.extensions.api.ManagerObject?;
import orca.manage.extensions.api.beans.ResultMng?;
import orca.manage.extensions.standard.actors.ActorManagerObject?;

@@ -61,6 +65,14 @@

return manager.addClientSlice(slice, caller);

}


+ public ResultMng? addResourcePool(String actorName, String poolName, String poolType,
+ String poolFactory, String control, String description, int units, Date start, Date end,
+ Handler handler, Attributes as, Properties poolProperties, AuthToken? caller) throws Exception {
+ return manager.addResourcePool(actorName, poolName, poolType,
+ poolFactory, control, description, units, start, end,
+ handler, as, poolProperties, caller);
+ }
+

public ResultReservationMng? getAgentReservations(AuthToken? caller) throws Exception
{

return manager.getAgentReservations(caller);

Index: standard/src/main/java/orca/manage/extensions/standard/actors/AuthorityManagerObject.java
===================================================================
--- standard/src/main/java/orca/manage/extensions/standard/actors/AuthorityManagerObject.java (revision 2903)
+++ standard/src/main/java/orca/manage/extensions/standard/actors/AuthorityManagerObject.java (working copy)
@@ -10,11 +10,14 @@

package orca.manage.extensions.standard.actors;


import java.security.cert.Certificate;

+import java.util.Date;

import java.util.Properties;
import java.util.Vector;


import orca.manage.extensions.api.ApiConverter?;
import orca.manage.extensions.api.ManageExtensionsApiConstants?;

+import orca.manage.extensions.api.PackageId?;
+import orca.manage.extensions.api.PluginId?;

import orca.manage.extensions.api.beans.AuthTokenMng?;
import orca.manage.extensions.api.beans.ResultMng?;
import orca.manage.extensions.api.proxies.ProxyProtocolDescriptor?;

@@ -38,13 +41,21 @@

import orca.shirako.common.Client;
import orca.shirako.common.ReservationID;
import orca.shirako.common.ResourceData?;

+import orca.shirako.common.ResourceType?;

import orca.shirako.common.SliceID;

+import orca.shirako.container.ConfigurationException?;

import orca.shirako.core.AuthorityPolicy?;
import orca.shirako.kernel.BrokerReservationFactory?;
import orca.shirako.kernel.ResourceSet?;

+import orca.shirako.meta.ResourcePoolAttributeDescriptor?;
+import orca.shirako.meta.ResourcePoolAttributeType?;
+import orca.shirako.meta.ResourcePoolDescriptor?;
+import orca.shirako.meta.ResourcePoolsDescriptor?;

import orca.shirako.plugins.config.ConfigurationMapping?;
import orca.shirako.plugins.db.ClientDatabase?;

+import orca.shirako.plugins.substrate.AuthoritySubstrate?;

import orca.shirako.plugins.substrate.ISubstrateDatabase;

+import orca.shirako.registry.ActorRegistry?;

import orca.shirako.time.Term;
import orca.util.ID;


@@ -234,6 +245,95 @@

}


/**

+ * Add a new resource pool to authority actor. This requires a lot of parameters. There isn't
+ * a bean for it for now. Maybe there's a better way... /ib
+ * @param actorName
+ * @param pool
+ * @param type
+ * @param poolFactory
+ * @param control
+ * @param description
+ * @param units
+ * @param start
+ * @param end
+ * @param handler
+ * @param as
+ * @param p
+ * @param caller
+ * @return
+ * @throws Exception
+ */
+ public ResultMng? addResourcePool(String actorName, String poolName, String poolType,
+ String poolFactory, String control, String description, int units, Date start, Date end,
+ Handler handler, Attributes as, Properties poolProperties, AuthToken? caller) throws Exception {
+ ResultMng? result = new ResultMng?();
+

+ if ((actorName == null) (caller == null) (poolName == null)

+ (poolType == null) (poolFactory == null) (handler == null)
+ (control == null)) {
+ result.setCode(ManageExtensionsApiConstants?.ErrorInvalidArguments?);
+ } else {
+ ResourcePoolsDescriptor? rpd = new ResourcePoolsDescriptor?();
+
+ ResourcePoolDescriptor? d = new ResourcePoolDescriptor?();
+ d.setResourceType(new ResourceType?(poolType));
+ d.setResourceTypeLabel(poolName);
+ d.setUnits(units);
+ d.setStart(start);
+ d.setEnd(end);
+ d.setPoolFactory(poolFactory);
+ d.setHandlerPath(handler.getPath());
+ if (handler.getPackageId() != null) {
+ d.setHandlerPackageId(new PackageId?(handler.getPackageId()));
+ }
+ if (handler.getPluginId() != null) {
+ d.setHandlerPluginId(new PluginId?(handler.getPluginId()));
+ }
+
+ if (as != null) {
+ for (Attribute a : as.getAttribute()) {
+ ResourcePoolAttributeDescriptor? att = new ResourcePoolAttributeDescriptor?();
+ att.setKey(a.getKey());
+ att.setLabel(a.getLabel());
+ if (a.getMax() != null) {
+ att.setMax(a.getMax().longValue());
+ }
+ if (a.getMin() != null) {
+ att.setMin(a.getMin().longValue());
+ }
+ String type = a.getType();
+ if (type.equalsIgnoreCase("integer")) {
+ att.setType(ResourcePoolAttributeType?.INTEGER);
+ } else if (type.equalsIgnoreCase("string")) {
+ att.setType(ResourcePoolAttributeType?.STRING);
+ } else if (type.equalsIgnoreCase("ndl")) {
+ att.setType(ResourcePoolAttributeType?.NDL);
+ } else if (type.equalsIgnoreCase("class")) {
+ att.setType(ResourcePoolAttributeType?.CLASS);
+ } else {
+ throw new ConfigurationException?("Unsupported attribute type: " + type);
+ }
+ att.setValue(a.getValue());
+ att.setUnit(a.getUnit());
+ d.addAttribute(att);
+ }
+ }
+
+ /* get the actor by this name and attach the pool to it */
+ IActor actor = ActorRegistry?.getActor(actorName);
+ if (actor instanceof IAuthority) {
+ if (actor.getShirakoPlugin() instanceof AuthoritySubstrate?) {
+ PoolCreator? creator = new PoolCreator?((AuthoritySubstrate?) actor.getShirakoPlugin(),
+ rpd, null);
+ creator.process();
+ }
+ }
+
+ result.setCode(ManageExtensionsApiConstants?.ErrorNone?);
+ }
+ return result;
+ }
+ /**

  • Registers a new client with the actor.
  • @param client client
  • @param certificate

Index: standard/pom.xml
===================================================================
--- standard/pom.xml (revision 2903)
+++ standard/pom.xml (working copy)
@@ -53,6 +53,13 @@

<version>1.0</version>
<type>pom</type>

</dependency>

+ <dependency>
+ <groupId>orca</groupId>
+ <artifactId>boot</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>

<!-- note: used for beans -->
<dependency>

<groupId>axis</groupId>

dhcp-54:manage ibaldin$

Changed 8 years ago by ibaldin

pool-add.vm

Changed 8 years ago by ibaldin

pool-add-action.vm

Changed 8 years ago by ibaldin

Added pool-add.vm and pool-add-action.vm from previous attempt - will be useful for revamping.

Changed 7 years ago by ibaldin

  • version changed from Camano 3.0 to Camano 3.1

Changed 7 years ago by ibaldin

  • status changed from assigned to closed
  • resolution set to wontfix

Portal going away. Not relevant.

Note: See TracTickets for help on using tickets.