aboutsummaryrefslogtreecommitdiffstats
path: root/please
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-08-25 21:16:50 +0000
committerBryan Newbold <bnewbold@archive.org>2018-08-25 21:16:50 +0000
commitc56efb06923752ff7425e27f31aaeb25f766a5ed (patch)
tree071201db5dbbd199295a0fd518e2dd8483fe86e7 /please
parentc2dbb9b5299ba7cfc4e2328ce3a4ef6c2882dc9e (diff)
downloadsandcrawler-c56efb06923752ff7425e27f31aaeb25f766a5ed.tar.gz
sandcrawler-c56efb06923752ff7425e27f31aaeb25f766a5ed.zip
add extraction_ungrobided support to please
Diffstat (limited to 'please')
-rwxr-xr-xplease30
1 files changed, 30 insertions, 0 deletions
diff --git a/please b/please
index 0c69bce..81aad4d 100755
--- a/please
+++ b/please
@@ -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)