Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: do not pass SNAKEMAKE_PROFILE into cluster-submit (#1398) (#1407)
* feat: cluster sidecar

* fix: do not pass SNAKEMAKE_PROFILE into cluster-submit (#1398)

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
  • Loading branch information
holtgrewe and johanneskoester committed Feb 18, 2022
1 parent a007bd1 commit 7189183
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 @@ -1130,6 +1130,11 @@ def run(self, job, callback=None, submit_callback=None, error_callback=None):
env = dict(os.environ)
if self.sidecar_vars:
env["SNAKEMAKE_CLUSTER_SIDECAR_VARS"] = self.sidecar_vars

# Remove SNAKEMAKE_PROFILE from environment as the snakemake call inside
# of the cluster job must run locally (or complains about missing -j).
env.pop("SNAKEMAKE_PROFILE", None)

ext_jobid = (
subprocess.check_output(
'{submitcmd} "{jobscript}"'.format(
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 7189183

Please sign in to comment.