Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htcondorcern: snakemake multiline shell scripts are not parsed as expected #470

Open
mdonadoni opened this issue Sep 25, 2024 · 0 comments · Fixed by #474
Open

htcondorcern: snakemake multiline shell scripts are not parsed as expected #470

mdonadoni opened this issue Sep 25, 2024 · 0 comments · Fixed by #474

Comments

@mdonadoni
Copy link
Member

Consider the following changes to reana-demo-helloworld

diff --git a/workflow/snakemake/Snakefile b/workflow/snakemake/Snakefile
index 4532d3c..7538c51 100644
--- a/workflow/snakemake/Snakefile
+++ b/workflow/snakemake/Snakefile
@@ -28,7 +28,7 @@ rule helloworld:
     container:
         "docker://docker.io/library/python:2.7-slim"
     shell:
-        "python {input.helloworld} "
-        "--inputfile {input.inputfile} "
-        "--outputfile {output} "
-        "--sleeptime {params.sleeptime}"
+        """
+echo 'first'
+echo 'second'
+"""
diff --git a/workflow/snakemake/Snakefile-htcondorcern b/workflow/snakemake/Snakefile-htcondorcern
index 9367a76..dfcfd78 100644
--- a/workflow/snakemake/Snakefile-htcondorcern
+++ b/workflow/snakemake/Snakefile-htcondorcern
@@ -16,7 +16,7 @@ rule helloworld:
     container:
         "docker://docker.io/library/python:2.7-slim"
     shell:
-        "python {input.helloworld} "
-        "--inputfile {input.inputfile} "
-        "--outputfile {output} "
-        "--sleeptime {params.sleeptime}"
+        """
+echo 'first'
+echo 'second'
+"""

These are the logs when running reana-snakemake.yaml (snakemake on k8s):

job: :
 first
second


Completed

In this case, only first and second are printed, as expected.

These are the logs when running reana-snakemake-htcondorcern.yaml (snakemake on htcondorcern):

command to execute:
echo 'first' echo 'second'first echo second

In this second case, first echo second is printed, as the second echo command is passed as a parameter to the first one.

We should check whether multiline """ strings are supported by Snakemake (but they should, as the k8s example works) and why HTCondor behaves differently than k8s.

@mdonadoni mdonadoni added this to 0.95.0 Sep 25, 2024
@mdonadoni mdonadoni added this to 0.9.4 Nov 20, 2024
@mdonadoni mdonadoni removed this from 0.95.0 Nov 20, 2024
@mdonadoni mdonadoni moved this to In work in 0.9.4 Nov 20, 2024
@mdonadoni mdonadoni moved this from In work to Ready for work in 0.9.4 Nov 20, 2024
mdonadoni added a commit to mdonadoni/reana-job-controller that referenced this issue Nov 20, 2024
mdonadoni added a commit to mdonadoni/reana-job-controller that referenced this issue Nov 21, 2024
mdonadoni added a commit to mdonadoni/reana-job-controller that referenced this issue Nov 21, 2024
@mdonadoni mdonadoni linked a pull request Nov 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant