OCR Service
This is a stateful Web Service that serves as a wrapper to Optical Character Recognition application developed by the INSPIRE team.
Notes to administrator:
In order for the OCR service to work in a scope, a Scientifil Linux 5 execution node with ocropus software installed must exist in that scope. An SL5 node that can execute OCR must fullfill the following requirements:
a) be a SL5 node and declare it in $GLOBUS_LOCATION/conf/GHNLabels.xml file with the following xml elements:
<Variable> <Key>other.GlueHostOperatingSystemName</Key> <Value>ScientificSL</Value> </Variable> <Variable> <Key>other.GlueHostOperatingSystemRelease</Key> <Value>5.0</Value> </Variable> <Variable>
b) have ocropus-0.3.1-i386 directory under $GLOBUS_LOCATION and declare it in $GLOBUS_LOCATION/conf/GHNLabels.xml file with the following xml element:
<Variable> <Key>software.ocropus</Key> <Value>true</Value> </Variable>
In addition, it is expected that the following ocrjob.sh script exists under $GLOBUS_LOCATION directory of the node on which OCRService service is running, so that it can be sent to the execution node.File:Ocrjob.tar.gz
If an SL5 node with ocropus installed isn't found in scope, the OCR job submission would fail.
As a backup plan, you can use the following client to upload ocropus.tar.gz file in Content Management System:
Usage:
java org.gcube.execution.ocrservice.tests.UploadOcropusClient <scope> <location of jar file>
e.g.
java org.gcube.execution.ocrservice.tests.UploadOcropusClient /gcube/devNext $GLOBUS_LOCATION/ocropus.tar.gz
(make sure that Content Management jars exist in your classpath) and a unique collection will be created that scope that will contain only the provided ocropus.tar.gz. The OCR Service will find that file and send it along with the other resources when a new OCR Job is submitted through JDL Adaptor. We must state that this backup plan hasn't worked as expected because
a)uploading ocropus.tar.gz file takes around 50 minutes b)dowloading ocropus.tar.gz file might fail because the file is too large (18.2 megabytes) and in case of success, the OCR process will take much longer.
Notes to developer:
When OCR service factory receives a call from a user, it tries to find a Workflow Engine instance in that scope which will use to submit a new job using JDL adaptor. In case of success, it will create a Web Service resource for that job that will contain information of that job such as job name,execution id,workflow engine endpoint etc. A background thread operates periodically and is in charge of collecting all WS-resources, polling the workflow engine for the jobs that are still running and updating the corresponding WS-resources.
Notes to user: