Thursday, March 13, 2014

Notes on Apache UIMA Asynchronous Scaleout

Getting Started: Apache UIMA Asynchronous Scaleout
http://uima.apache.org/doc-uimaas-what.html
the UIMA AS Deployment Descriptor only specifies error handling and scalability options; component aggregation is done using the standard aggregate descriptor. The UIMA Component Descriptor Editor (CDE) has been enhanced to support the UIMA AS Deployment Descriptor.

The shared queue in front of each UIMA AS service is implemented using an Apache ActiveMQ broker. A separate reply queue is created for each client, and every request contains the address of the client's unique reply queue.

http://uima.apache.org/d/uima-as-2.4.2/uima_async_scaleout.html

bin/startBroker.sh/bat: starts the ActiveMQ broker, which must be running before
UIMA AS services can be deployed.
bin/deployAsyncService.sh/bat: deploys an AnalysisEngine as a UIMA-AS
service.  Takes one or more UIMA-AS Deployment Descriptors as arguments.
bin/runRemoteAsyncAE.sh/bat: Calls a UIMA-AS service. Takes arguments specifying the
location of the service, and an optional CollectionReader descriptor file used to
obtain the CASes to be processed by the service.

Set UIMA_HOME to the apache-uima-as directory
* Append UIMA_HOME/bin to your PATH
You must run the script UIMA_HOME/bin/adjustExamplePaths.bat (or .sh). 

startBroker.bat
INFO TransportServerThreadSupport - Listening for connections at: tcp://yourHostname:61616
Examples can be found in the examples/deploy/as directory,
and the syntax is documented in docs/d/uima_async_scaleout.pdf.
deployAsyncService.cmd [testDD.xml] [-brokerURL tcp://localhost:61616]
If you want to use a different
  version of ActiveMQ, set the ACTIVEMQ_HOME environment variable to the location of 
  ActiveMQ you intend to use. 

deployAsyncService.cmd uima-as-2.4.2-bin\examples\deploy\as\Deploy_RoomNumberAnnotator.xml -brokerURL tcp://localhost:61616

getMetaData.cmd tcp://localhost:61616 RoomNumberAnnotatorQueue -verbose

Error deploying pear on AS 2.4.2
http://permalink.gmane.org/gmane.comp.apache.uima.general/5460
https://www.mail-archive.com/user@uima.apache.org/msg02621.html
A pear is a packed UIMA analysis engine, or AE. UIMA-AS deploys services
that contain AEs. The command deployAsyncService requires a UIMA-AS
Deployment Descriptor.
Using the OpenNLP pear described in the DUCC sample app, this would
be a UIMA-AS deployment descriptor, Deploy_OpenNLP.xml

Using the OpenNLP pear described in the DUCC sample app, this would
be a UIMA-AS deployment descriptor
<?xml version="1.0" encoding="UTF-8"?>

<analysisEngineDeploymentDescription
  xmlns="http://uima.apache.org/resourceSpecifier">

  <name>OpenNLP Text Analyzer</name>
  <description>Deploys OpenNLP text analyzer.</description>

  <deployment protocol="jms" provider="activemq">
    <service>
      <inputQueue endpoint="OpenNLP-service"
brokerURL="${defaultBrokerURL}"/>
      <topDescriptor>
       <import location="opennlp.uima.OpenNlpTextAnalyzer_pear.xml"/>
      </topDescriptor>
    </service>
  </deployment>

</analysisEngineDeploymentDescription>

This descriptor assumes it is in the same directory as the pear descriptor
in the import statement.
Then, assuming the service is to be deployed from the same directory, that
UIMA_HOME and PATH have been updated for the UIMA-AS SDK, and a JMS broker
started with startBroker.sh, the command would be:

UIMA_CLASSPATH=`pwd`/lib deployAsyncService.sh Deploy_OpenNLP.xml


Deploy_MeetingFinder.xml
<topDescriptor>
<import location="MeetingFinderAggregate.xml"/>  ===>

</topDescriptor>

No comments:

Post a Comment