From e361f207eb310f4c4d79a28b27e402954e7a2ebc Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 2 Sep 2016 18:46:37 +0000
Subject: [PATCH] Task #9522: Run srun from Docker directly, without ssh to
 localhost

---
 CEP/Pipeline/recipes/sip/pipeline.cfg.CEP4.tmpl | 4 ++--
 MAC/Services/src/PipelineControl.py             | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/CEP/Pipeline/recipes/sip/pipeline.cfg.CEP4.tmpl b/CEP/Pipeline/recipes/sip/pipeline.cfg.CEP4.tmpl
index 138835c5bb1..97703d3a145 100644
--- a/CEP/Pipeline/recipes/sip/pipeline.cfg.CEP4.tmpl
+++ b/CEP/Pipeline/recipes/sip/pipeline.cfg.CEP4.tmpl
@@ -44,7 +44,7 @@ globalfs = yes
 
 # We take the following path to start a remote container:
 #
-#  [container] --SSH--> [host] --SRUN--> [worker node] --DOCKER--> [container]
+#  [container] --SRUN--> [worker node] --DOCKER--> [container]
 #
 # This path is needed because running SRUN from within the container needs a lot of cluster-specific infra
 # (SLURM config files, Munge keys, correct Munge user ID, munged).
@@ -70,4 +70,4 @@ globalfs = yes
 #                            /bin/bash -c
 #
 #                            Required because the pipeline framework needs some bash functionality in the commands it starts.
-cmdline = ssh -n -tt -x localhost srun --exclusive --ntasks=1 --cpus-per-task={nr_cores} --jobid={slurm_job_id} --job-name={job_name} docker-run-slurm.sh --rm -u {uid} -v /data:/data --net=host {docker_env} lofar-pipeline:${LOFAR_TAG} {command}
+cmdline = srun --exclusive --ntasks=1 --cpus-per-task={nr_cores} --jobid={slurm_job_id} --job-name={job_name} docker-run-slurm.sh --rm -u {uid} -v /data:/data --net=host {docker_env} lofar-pipeline:${LOFAR_TAG} {command}
diff --git a/MAC/Services/src/PipelineControl.py b/MAC/Services/src/PipelineControl.py
index 5679178f5d1..ce5f9e06857 100755
--- a/MAC/Services/src/PipelineControl.py
+++ b/MAC/Services/src/PipelineControl.py
@@ -485,8 +485,7 @@ wget -O - -q "http://ganglia.control.lofar/ganglia/api/events.php?action=add&sta
 # run the pipeline
 runcmd docker-run-slurm.sh --rm --net=host \
       -e LOFARENV={lofarenv} \
-      -u $UID -e USER=$USER \
-      -e HOME=$HOME -v $HOME/.ssh:$HOME/.ssh:ro \
+      -v $HOME/.ssh:$HOME/.ssh:ro \
       -e SLURM_JOB_ID=$SLURM_JOB_ID \
       -v /data:/data \
       {image} \
-- 
GitLab