Skip to content

Commit

Permalink
fix: don't fail when host isn't biowulf
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Sep 13, 2023
1 parent 715c311 commit 48a0721
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ def list_commands(self, ctx: click.Context):
return list(self.commands)


def is_biowulf():
is_biowulf = False
for env_var in ("HOSTNAME", "SLURM_SUBMIT_HOST"):
if env_var in os.environ.keys() and os.environ[env_var] == "biowulf.nih.gov":
is_biowulf = True
return is_biowulf


def run_nextflow(
paramsfile=None,
configfile=None,
Expand Down Expand Up @@ -159,7 +167,7 @@ def run_nextflow(

# Run Nextflow!!!
nextflow_command = " ".join(str(nf) for nf in nextflow_command)
if os.environ["HOSTNAME"] == "biowulf.nih.gov":
if is_biowulf():
nextflow_command = f'bash -c "module load nextflow && {nextflow_command}"'
msg_box("Nextflow command", errmsg=nextflow_command)
subprocess.run(nextflow_command, shell=True, check=True)

0 comments on commit 48a0721

Please sign in to comment.