Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update all srun defs to include shell option #325

Closed
wants to merge 6 commits into from
Closed
Changes from all 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
8 changes: 4 additions & 4 deletions slurm/src/slurmcc/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def scontrol(self, args: List[str], retry: bool = True) -> str:
...

@abstractmethod
def srun(self, hostname: List[str], user_command: str, timeout: int) -> SrunOutput:
def srun(self, hostname: List[str], user_command: str, timeout: int, shell: bool) -> SrunOutput:
...

class NativeSlurmCLIImpl(NativeSlurmCLI):
Expand All @@ -41,7 +41,7 @@ def scontrol(self, args: List[str], retry: bool = True) -> str:
return retry_subprocess(lambda: check_output(full_args)).strip()
return check_output(full_args).strip()

def srun(self, hostlist: List[str], user_command: str, timeout: int, shell=False) -> SrunOutput:
def srun(self, hostlist: List[str], user_command: str, timeout: int, shell: bool) -> SrunOutput:
with tempfile.NamedTemporaryFile(delete=True) as temp_file:
temp_file_path = temp_file.name

Expand Down Expand Up @@ -71,10 +71,10 @@ def scontrol(args: List[str], retry: bool = True) -> str:
assert args[0] != "scontrol"
return SLURM_CLI.scontrol(args, retry)

def srun(hostlist: List[str], user_command: str, timeout: int = 120) -> SrunOutput:
def srun(hostlist: List[str], user_command: str, timeout: int = 120, shell: bool = False) -> SrunOutput:
assert hostlist != None
assert user_command != None
return SLURM_CLI.srun(hostlist, user_command, timeout=timeout)
return SLURM_CLI.srun(hostlist, user_command, timeout=timeout, shell=shell)

TEST_MODE = False
def is_slurmctld_up() -> bool:
Expand Down