Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions payu/schedulers/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Standard library
import os
from pathlib import Path
import re
import sys
import shlex
Expand Down Expand Up @@ -129,6 +130,17 @@ def submit(self, pbs_script, pbs_config, pbs_vars=None, python_exe=None):
envmod.setup()
envmod.module('load', 'pbs')

# Check for custom container launcher script environment variable
launcher_script = os.environ.get('ENV_LAUNCHER_SCRIPT_PATH')
if (
launcher_script
and Path(launcher_script).is_file()
and os.access(launcher_script, os.X_OK)
):
# Prepend the container launcher script to the python command
# so the python executable is accessible in the container
python_exe = f'{launcher_script} {python_exe}'

# Construct job submission command
cmd = 'qsub {flags} -- {python} {script}'.format(
flags=' '.join(pbs_flags),
Expand Down
Loading