From 73015a309b28b43d03d965e2c7f4875e1099fdba Mon Sep 17 00:00:00 2001
From: Stefano Alberto Russo <stefano.russo@gmail.com>
Date: Wed, 12 Jan 2022 23:14:15 +0100
Subject: [PATCH] Fixed a bug in using containers wiht no custom interface
 support with Singularity.

---
 services/webapp/code/rosetta/core_app/api.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/services/webapp/code/rosetta/core_app/api.py b/services/webapp/code/rosetta/core_app/api.py
index ea54151..70fb7fd 100644
--- a/services/webapp/code/rosetta/core_app/api.py
+++ b/services/webapp/code/rosetta/core_app/api.py
@@ -333,9 +333,12 @@ print(port)
                 container_engine = task.computing.default_container_engine
             
             if container_engine=='singularity':
-                # For Singularity, set this only if the container supports custom interface ports
+                # For Singularity, set this only if the container supports custom
+                # interface ports. Otherwise, use the task container interface port.
                 if task.container.supports_custom_interface_port:
                     task.interface_port = int(task_interface_port)
+                else:
+                    task.interface_port = task.container.interface_port
             else:
                 # For all other container engines, set it in any case
                 task.interface_port = int(task_interface_port)
-- 
GitLab