Comment --keep_intermediates

This commit is contained in:
Stephan Porada 2019-08-05 15:35:51 +02:00
parent 1092312e6d
commit a3039e0529

View File

@ -23,9 +23,8 @@ class Swarm:
_command = job['service'] \ _command = job['service'] \
+ ' -i /files/{}'.format(job['id']) \ + ' -i /files/{}'.format(job['id']) \
+ ' -l {}'.format(job['service_args']['lang']) \ + ' -l {}'.format(job['service_args']['lang']) \
+ ' -o /files/{}/output'.format(job['id']) \ + ' -o /files/{}/output'.format(job['id'])
+ ' --keep-intermediates' \ # + ' --keep-intermediates'
+ ' --nCores {}'.format(job['requested_cpus'])
_constraints = ['node.role==worker'] _constraints = ['node.role==worker']
_image = 'gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/{}:{}'.format( _image = 'gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/{}:{}'.format(
job['service'], job['service'],
@ -63,6 +62,8 @@ class Swarm:
' (name=_name). Because there is no id generator for now, it is ' (name=_name). Because there is no id generator for now, it is
' not set, so that the Docker engine assigns a random name. ' not set, so that the Docker engine assigns a random name.
''' '''
print(_command)
print(_image)
service = self.docker.services.create( service = self.docker.services.create(
_image, _image,
command=_command, command=_command,
@ -80,6 +81,7 @@ class Swarm:
' method) the poll loop also checks if the task list is empy (The ' method) the poll loop also checks if the task list is empy (The
' not service.tasks() condition implements this). ' not service.tasks() condition implements this).
''' '''
print(service.attrs)
while not service.tasks() or \ while not service.tasks() or \
service.tasks()[0].get('Status').get('State') != 'complete': service.tasks()[0].get('Status').get('State') != 'complete':
time.sleep(1) time.sleep(1)