From a05737012738ffd26029d5ab766bd97d29c6d73d Mon Sep 17 00:00:00 2001 From: Stefano Alberto Russo <stefano.russo@gmail.com> Date: Mon, 9 Oct 2023 17:53:53 +0200 Subject: [PATCH] Fixed bug in stopping containers on SSH-based, standalone computing resources with Docker and Podman. --- services/webapp/code/rosetta/core_app/computing_managers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/webapp/code/rosetta/core_app/computing_managers.py b/services/webapp/code/rosetta/core_app/computing_managers.py index 5fc85a8..7e916e7 100644 --- a/services/webapp/code/rosetta/core_app/computing_managers.py +++ b/services/webapp/code/rosetta/core_app/computing_managers.py @@ -375,7 +375,7 @@ class SSHStandaloneComputingManager(StandaloneComputingManager, SSHComputingMana # TODO: remove this hardcoding prefix = 'sudo' if (computing_host == 'slurmclusterworker' and container_engine=='docker') else '' internal_stop_command = 'export CONTAINER_ID=$('+prefix+' '+container_engine+' ps -a --filter name=task-'+task.short_uuid+' --format {{.ID}}) &&' - internal_stop_command += 'if [ "x$CONTAINER_ID" != "x" ]; then {} {} stop $CONTAINER_ID && {} {} rm $CONTAINER_ID; fi'.format(prefix,container_engine,prefix,container_engine) + internal_stop_command += 'if [ "x\$CONTAINER_ID" != "x" ]; then {} {} stop \$CONTAINER_ID && {} {} rm \$CONTAINER_ID; fi'.format(prefix,container_engine,prefix,container_engine) else: raise NotImplementedError('Container engine {} not supported'.format(container_engine)) -- GitLab