From ab688e290a335e16e8329887cceff9d556fd1962 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 5 Aug 2019 14:22:16 +0200 Subject: [PATCH] Make swarm run more generic --- app/swarm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/swarm.py b/app/swarm.py index 521a3dd2..1a14a2fe 100644 --- a/app/swarm.py +++ b/app/swarm.py @@ -20,7 +20,7 @@ class Swarm: def run(self, job): # Prepare argument values needed for the service creation. - _command = 'ocr' \ + _command = job['service'] \ + ' -i /files/{}'.format(job['id']) \ + ' -l {}'.format(job['service_args']['lang']) \ + ' -o /files/{}/output'.format(job['id']) \ @@ -31,7 +31,7 @@ class Swarm: job['service'], job['service_args']['version'] ) - _labels = {'service': 'ocr'} + _labels = {'service': job['service']} _mounts = [ '/home/compute/mnt/opaque/jobs:/files:rw', ]