Current behavior
Apart from shell commands, Snakemake also permits running python code directly via run:.
At the moment, we're identifying such situations with the job.is_run flag but we're aborting the execution.
Expected behavior
As the use of run: is a common practice in the Snakemake world and LHCb also uses this extensively, we need to support it.
At the moment, the Job-Controller always uses bash -c as command to run the shell args as we've never supported anything else but shell commands. We need to identify when run: is used, let the Job-Controller know this via kwarg or similar and pass python -c as command instead.
Snakefile example:
rule all:
input:
"results/greetings.txt"
rule helloworld:
params:
name=config["name"]
output:
"results/greetings.txt"
container:
"docker://3.9-slim-buster"
run:
with open(output[0], "w") as out:
out.write(f"Hello {params['name']}!")
Current behavior
Apart from shell commands, Snakemake also permits running python code directly via
run:.At the moment, we're identifying such situations with the
job.is_runflag but we're aborting the execution.Expected behavior
As the use of
run:is a common practice in the Snakemake world and LHCb also uses this extensively, we need to support it.At the moment, the Job-Controller always uses
bash -cascommandto run the shell args as we've never supported anything else but shell commands. We need to identify whenrun:is used, let the Job-Controller know this viakwargor similar and passpython -cascommandinstead.Snakefile example: