From 202ade92e917109c248f5322bf966cfd5d2a6255 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Thu, 8 Aug 2019 12:01:55 +0200
Subject: [PATCH] Set name for swarm service.

---
 app/swarm.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/swarm.py b/app/swarm.py
index c9f169dc..243241af 100644
--- a/app/swarm.py
+++ b/app/swarm.py
@@ -52,7 +52,7 @@ class Swarm:
                                 'jobs',
                                 str(job.id))
                    + ':/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
         ' scaled to nanos (10^9). Because the job object contains unscaled
@@ -86,6 +86,7 @@ class Swarm:
             constraints=_constraints,
             labels=_labels,
             mounts=_mounts,
+            name=_name,
             resources=_resources,
             restart_policy=_restart_policy
         )
-- 
GitLab