This is an OODT RADIX application that uses Apache Solr, Apache Tika and Apache OODT to ingest 10s of millions of files (images,but could be extended to other files) in place, and to extract metadata and OCR information from those files/images using Tika and Tesseract OCR.
Some programs used by ImageCat require the use of the /bin/tcsh shell. You can usually install it on Linux via:
- yum install tcsh; or
- apt-get install tcsh
- pip install xmlrpc
- pip install solrpy
- mkdir deploy
- git clone https://github.com/chrismattmann/imagecat.git
- cd imagecat
- mvn install
- cp -R distribution/target/*.tar.gz ../deploy
- cd ../deploy && tar xvzf *.tar.gz
- cp -R ../imagecat/solr4 ./solr4 && cp -R ../imagecat/tomcat7 ./tomcat7
- edit tomcat7/conf/Catalina/localhost/solr.xml and replace [OODT_HOME] with the path to your deploy dir.
- edit deploy/bin/env.sh and deploy/bin/imagecatenv.sh to make sure OODT_HOME is set to the path to your deploy dir.
- /bin/bash && source bin/imagecatenv.sh
- cd $OODT_HOME/bin && ./oodt start
- cd $OODT_HOME/tomcat7/bin && ./startup.sh
- cd $OODT_HOME/resmgr/bin/ && ./start-memex-stubs
- download roxy-image-list-jpg-nonzero.txt and place it in $OODT_HOME/data/staging
- $OODT_HOME/bin/chunker
- #win
ImageCat runs 2 Solr deployments, and a full stack OODT Deployment. The URLs are below:
- http://localhost:8081/solr/imagecatdev - Solr4.10.3-fork Core where SolrCell runs for Image extraction.
- http://localhost:8081/solr/imagecatoodt - Solr4.10.3-fork Core where OODT's file catalog is, home to ChunkFiles representing a 50k-sized slice of full file paths from the original file list.
- http://localhost:8080/opsui/ - Apache OODT OPSUI cockpit to observe ingestion of ChunkFiles, and jobs for ingesting into SolrCell
- http://localhost:8080/pcs/services/health/report - Apache OODT PCS REST Services showing system health and provenance.
The recommended way to see what's going on is to check the OPSUI, and then periodically examine $OODT_HOME/data/jobs/crawl/*/logs (where the ingest into SolrCell jobs are executing). By default ImageCat uses 8 ingest processes that can run 8 parallel ingests into SolrCell at a time, with 24 jobs on deck in the Resource Manager waiting to get in.
Each directory in $OODT_HOME/data/jobs/crawl/ is an independent, fully detached job that can be executed independent of OODT to ingest 50K image files into SolrCell and to perform TesesractOCR and EXIF metadata extraction.
The overall workflow is as follows:
-
OODT starts with the original large file that contains full file paths. It then chunks this file into sizeof(file) / $OODT_HOME/workflow/policy/tasks.xml[urn:id:memex:Chunker/ChunkSize] sized files.
-
Each resultant ChunkFile is then ingested into OODT, by the OODT crawler, which triggers the OODT workflow manager to process a job called IngestInPlace.
-
Each IngestInPlace job grabs its ingested ChunkFile (stored in $OODT_HOME/data/archive/chunks/) and then runs it through $OODT_HOME/bin/solrcell_ingest which sends the 50k full file paths to http://localhost:8081/solr/imagecatdev/extract (the ExtractingRequestHandler).
-
8 IngestInPlace jobs can run at a time.
-
You can watch http://localhost:8081/solr/imagecatdev build up while it's going on. This will happen sporadically b/c $OODT_HOME/bin/solrcell_ingest ingests all 50k files in memory, and then sends a commit at the end for efficiency (resulting in 50k * 8 files every ~30-40 minutes).
For whatever reason, sometimes ingests fail. For example initially when I was building ImageCat, I had an error in the solrcell_ingest script that didn't account for files that had spaces in the directory path (fixed now). If you find anything happens that makes ingests fail, just run:
$OODT_HOME/bin/check_failed
This program will verify all ChunkFiles in Solr and make sure all paths were ingested into Solr. If any weren't, new ChunkedFiles with the extension _missing.txt will be created and any remaining files will be ingested.
Send them to Chris A. Mattmann.