Disable sanitization by default

This commit is contained in:
E Rasche
2017-08-01 15:16:25 +02:00
parent 94a8a9a841
commit cf4dc28c5f
2 changed files with 13 additions and 4 deletions
+7 -3
View File
@@ -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')
+6 -1
View File
@@ -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__