fix ocr command

This commit is contained in:
Patrick Jentsch 2020-06-23 15:20:05 +02:00
parent ead0117bbb
commit 106fd75c75

View File

@ -70,18 +70,15 @@ def __add_notification_data(job, notified_on_status, scoped_session):
def __create_job_service(job):
job_dir = os.path.join(NOPAQUE_STORAGE, str(job.user_id), 'jobs',
str(job.id))
service_args = {'command': ('{} /files /files/output'.format(job.service)
+ ' {}'.format(job.secure_filename
if job.service == 'file-setup'
else '')
+ ' {}'.format('--compress'
if job.service == 'ocr'
else '')
+ ' --log-dir /files'
+ ' --zip [{}]_{}'.format(job.service,
job.secure_filename)
+ ' ' + ' '.join(json.loads(job.service_args))
),
cmd = '{} -i /files -o /files/output'.format(job.service)
if job.service == 'file-setup':
cmd += ' -f {}'.format(job.secure_filename)
elif job.service == 'ocr':
cmd += ' --compress'
cmd += ' --log-dir /files'
cmd += ' --zip [{}]_{}'.format(job.service, job.secure_filename)
cmd += ' ' + ' '.join(json.loads(job.service_args))
service_args = {'command': cmd,
'constraints': ['node.role==worker'],
'labels': {'origin': 'nopaque',
'type': 'service.{}'.format(job.service),