Skip to content

Commit

Permalink
fix: do not pass SNAKEMAKE_PROFILE into cluster-submit (#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Feb 17, 2022
1 parent 0593de1 commit 2488c1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions snakemake/executors/__init__.py
Expand Up @@ -1070,12 +1070,17 @@ def run(self, job, callback=None, submit_callback=None, error_callback=None):
raise WorkflowError(str(e), rule=job.rule if not job.is_group() else None)

try:
# Remove SNAKEMAKE_PROFILE from environment as the snakemake call inside
# of the cluster job must run locally (or complains about missing -j).
env = dict(os.environ.items())
env.pop("SNAKEMAKE_PROFILE", None)
ext_jobid = (
subprocess.check_output(
'{submitcmd} "{jobscript}"'.format(
submitcmd=submitcmd, jobscript=jobscript
),
shell=True,
env=env,
)
.decode()
.split("\n")
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cluster_statusscript/qsub
@@ -1,4 +1,8 @@
#!/bin/bash
if [[ ! -z "$SNAKEMAKE_PROFILE" ]]; then
>&2 echo "SNAKEMAKE_PROFILE should not be set"
exit 1
fi
echo `date` >> qsub.log
tail -n1 $1 >> qsub.log
# simulate printing of job id by a random number
Expand Down

0 comments on commit 2488c1f

Please sign in to comment.