diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-08-25 21:16:50 +0000 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-08-25 21:16:50 +0000 |
commit | c56efb06923752ff7425e27f31aaeb25f766a5ed (patch) | |
tree | 071201db5dbbd199295a0fd518e2dd8483fe86e7 | |
parent | c2dbb9b5299ba7cfc4e2328ce3a4ef6c2882dc9e (diff) | |
download | sandcrawler-c56efb06923752ff7425e27f31aaeb25f766a5ed.tar.gz sandcrawler-c56efb06923752ff7425e27f31aaeb25f766a5ed.zip |
add extraction_ungrobided support to please
-rwxr-xr-x | please | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -74,6 +74,31 @@ def run_extract(args): grobid_uri=GROBID_URI) subprocess.call(cmd, shell=True) +def run_extract_ungrobided(args): + if args.rebuild: + rebuild_python() + print("Starting extractungrobided job...") + output = "{}/output-{}/{}-extract-ungrobided".format( + HDFS_DIR, + args.env, + datetime.strftime(datetime.now(), "%Y-%m-%d-%H%M.%S")) + cmd = """cd python; + pipenv run ./extraction_ungrobided.py \ + --hbase-host {hbase_host} \ + --hbase-table wbgrp-journal-extract-0-{env} \ + --grobid-uri {grobid_uri} \ + -r hadoop \ + -c mrjob.conf \ + --archive venv-current.tar.gz#venv \ + --jobconf mapred.line.input.format.linespermap=8000 \ + --jobconf mapreduce.job.queuename=extraction \ + --jobconf mapred.task.timeout=3600000 \ + {input_ungrobided} + """.format(hbase_host=HBASE_HOST, env=args.env, + input_ungrobided=args.input_ungrobided, + grobid_uri=GROBID_URI) + subprocess.call(cmd, shell=True) + def run_rowcount(args): if args.rebuild: rebuild_scalding() @@ -302,6 +327,11 @@ def main(): sub_extract.add_argument('input_cdx', help="full HDFS path of CDX file to extract") + sub_extractungrobided = subparsers.add_parser('extract-ungrobided') + sub_extractungrobided.set_defaults(func=run_extract_ungrobided) + sub_extractungrobided.add_argument('input_ungrobided', + help="full HDFS path of 'ungrobided' file to extract") + sub_rowcount = subparsers.add_parser('row-count') sub_rowcount.set_defaults(func=run_rowcount) |