Skip to content
Snippets Groups Projects
Commit 20cd4815 authored by Adrian Schmitz's avatar Adrian Schmitz
Browse files

Merge branch '21-update-slurm-parameter-fail-tests' into 'main'

Resolve "Update SLURM parameter fail tests"

Closes #21

See merge request ci-playground/customdriver!21
parents 44a0e32e 98429f28
Branches
Tags
No related merge requests found
...@@ -252,7 +252,7 @@ class Slurm(ModeBase): ...@@ -252,7 +252,7 @@ class Slurm(ModeBase):
def get_run_properties(self): def get_run_properties(self):
self.set_srun_cmd() self.set_srun_cmd()
self.set_slurm_env() self.set_slurm_env()
return self._run_properties + f' {self.job.shell_path} -l' return f'{srun_path} ' + self._run_properties + f' {self.job.shell_path} -l'
def get_run_script(self): def get_run_script(self):
self._run_script = self.job.exec_script self._run_script = self.job.exec_script
...@@ -579,12 +579,8 @@ class SingleSlurmJobAcrossStages(Slurm): ...@@ -579,12 +579,8 @@ class SingleSlurmJobAcrossStages(Slurm):
def get_run_properties(self): def get_run_properties(self):
if not os.path.isfile(self.slurm_jobid_file): if not os.path.isfile(self.slurm_jobid_file):
num_cores = get_cenv("SRUN_CPUS_PER_TASK") salloc_command = ['/opt/slurm/current/bin/salloc', '--no-shell', f'--job-name=CI_{self.job.pipeline_id}'] + \
if not num_cores: self.job.get_parameters().split(" ")
num_cores = get_cenv('SLURM_ENV_SRUN_CPUS_PER_TASK', '1')
_timelimit = get_cenv('SLURM_TIMELIMIT', '15:00')
salloc_command = ['/opt/slurm/current/bin/salloc', f'--cpus-per-task={num_cores}', f'--time={_timelimit}',
'--no-shell', f'--job-name=CI_{self.job.pipeline_id}']
salloc_command.extend(self.slurm_vars) salloc_command.extend(self.slurm_vars)
salloc_out = self.job.execute(' '.join(salloc_command), '', salloc_out = self.job.execute(' '.join(salloc_command), '',
f"{self.job.driver_path}/core/scripts/runHelper.sh", f"{self.job.driver_path}/core/scripts/runHelper.sh",
...@@ -619,7 +615,7 @@ class SingleSlurmJobAcrossStages(Slurm): ...@@ -619,7 +615,7 @@ class SingleSlurmJobAcrossStages(Slurm):
# self._custom_env = self.get_env_for_single_slurm_job(self.id_vars) # self._custom_env = self.get_env_for_single_slurm_job(self.id_vars)
# self._custom_env['SLURM_JOB_ID'] = self.slurm_job_id # self._custom_env['SLURM_JOB_ID'] = self.slurm_job_id
if not additional_env.__sizeof__() == 0: if not additional_env.__sizeof__() == 0:
self._run_properties.insert(2, f'--export=' + ",".join(additional_env)) self._run_properties.insert(1, f'--export=' + ",".join(additional_env))
self._run_properties.insert(1, f'--jobid={self.slurm_job_id}') self._run_properties.insert(1, f'--jobid={self.slurm_job_id}')
self._run_properties = ' '.join(self._run_properties) self._run_properties = ' '.join(self._run_properties)
return self._run_properties return self._run_properties
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment