Set name for swarm service.

This commit is contained in:
Patrick Jentsch 2019-08-08 12:01:55 +02:00
parent 75b587e693
commit 202ade92e9

View File

@ -52,7 +52,7 @@ class Swarm:
'jobs', 'jobs',
str(job.id)) str(job.id))
+ ':/files:rw'] + ':/files:rw']
_name = job.id _name = str(job.user_id) + '_' + str(job.id)
''' '''
' The Docker SDK for Python expects the cpu_reservation value to be ' The Docker SDK for Python expects the cpu_reservation value to be
' scaled to nanos (10^9). Because the job object contains unscaled ' scaled to nanos (10^9). Because the job object contains unscaled
@ -86,6 +86,7 @@ class Swarm:
constraints=_constraints, constraints=_constraints,
labels=_labels, labels=_labels,
mounts=_mounts, mounts=_mounts,
name=_name,
resources=_resources, resources=_resources,
restart_policy=_restart_policy restart_policy=_restart_policy
) )