From cf4dc28c5fa762c93dcc2fd51d42a7bb684f7ecb Mon Sep 17 00:00:00 2001 From: E Rasche Date: Tue, 1 Aug 2017 15:15:17 +0200 Subject: [PATCH] Disable sanitization by default --- scripts/grt.py | 10 +++++++--- scripts/grt.yml.sample | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/grt.py b/scripts/grt.py index af2e5a27ed8..1be4f080c95 100644 --- a/scripts/grt.py +++ b/scripts/grt.py @@ -198,6 +198,7 @@ def main(argv): CHECK_POINT_FILE = os.path.join(REPORT_DIR, '.checkpoint') REPORT_IDENTIFIER = str(time.time()) REPORT_BASE = os.path.join(REPORT_DIR, REPORT_IDENTIFIER) + SANITIZATION_ENABLED = config['sanitization']['enabled'] if os.path.exists(CHECK_POINT_FILE): with open(CHECK_POINT_FILE, 'r') as handle: @@ -219,7 +220,7 @@ def main(argv): job_state_data = defaultdict(int) annotate('san_init', 'Building Sanitizer') - san = Sanitization(config['blacklist'], model, sa_session) + san = Sanitization(config['sanitization'], model, sa_session) annotate('san_end') if not os.path.exists(REPORT_DIR): @@ -313,8 +314,11 @@ def main(argv): .filter(model.JobParameter.job_id <= min(end_job_id, offset_start + args.batch_size)) \ .all(): - unsanitized = {param[1]: json.loads(param[2])} - sanitized = san.sanitize_data(job_tool_map[param[0]], unsanitized) + if SANITIZATION_ENABLED: + unsanitized = {param[1]: json.loads(param[2])} + sanitized = san.sanitize_data(job_tool_map[param[0]], unsanitized) + else: + sanitized = param[2] handle_params.write(str(param[0])) handle_params.write('\t') diff --git a/scripts/grt.yml.sample b/scripts/grt.yml.sample index 7ed7ca9e8db..622fb155b46 100644 --- a/scripts/grt.yml.sample +++ b/scripts/grt.yml.sample @@ -16,7 +16,12 @@ grt: share_toolbox: True -blacklist: +sanitization: + # This defaults to disabled as it has a serious performance impact and may + # not be necessary for your instance. Without sanitization we see + # performance on the order of 4k parameters parsed per second. With + # sanitizatoin on, it averages to 100 parameters per second. + enabled: False # Blacklist the entire tool from appearing tools: - __SET_METADATA__