Closed
Description
Consider the following changes to reana-demo-helloworld analysis example:
--- a/workflow/snakemake/Snakefile
+++ b/workflow/snakemake/Snakefile
@@ -25,10 +25,14 @@ rule helloworld:
sleeptime=config["sleeptime"]
output:
"results/greetings.txt"
- container:
- "docker://docker.io/library/python:2.7-slim"
+ resources:
+ kerberos=True,
+ compute_backend="htcondorcern",
+ htcondor_max_runtime="espresso",
+ unpacked_img=True
+ container: "/cvmfs/unpacked.cern.ch/registry.hub.docker.com/rootproject/root:6.26.00-ubuntu20.04"
shell:
- "python {input.helloworld} "
- "--inputfile {input.inputfile} "
- "--outputfile {output} "
- "--sleeptime {params.sleeptime}"
+ """
+echo $SINGULARITY_NAME ;
+python --version
+ """
When executing this job, reana-job-controller will create the following job_singularity_wrapper.sh
wrapper to run the user-provided commands on HTCondor:
#!/bin/bash
singularity exec --home $PWD:/srv --bind $PWD:/srv --bind /cvmfs --bind /eos /cvmfs/unpacked.cern.ch/registry.hub.docker.com/rootproject/root:6.26.00-ubuntu20.04 echo ZWNobyAkU0lOR1VMQVJJVFlfTkFNRSA7IHB5dGhvbiAtLXZlcnNpb24=|base64 -d | bash
Note that:
$ echo ZWNobyAkU0lOR1VMQVJJVFlfTkFNRSA7IHB5dGhvbiAtLXZlcnNpb24=|base64 -d
echo $SINGULARITY_NAME ; python --version
However, if we execute this script manually on lxplus, this is the output:
$ bash job_singularity_wrapper.sh
bash: line 1: python: command not found
The | base64 -d | bash
part of the script is not executed in the singularity container, but in the outer bash shell, thus the user-provided commands are not executed in the singularity container.
Activity