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

Merge branch '22-move-slurm-parameters-to-call' into 'main'

Resolve "Move SLURM parameters to call"

Closes #22

See merge request ci-playground/customdriver!23
parents 2aed5eae 8903fb12
No related branches found
No related tags found
No related merge requests found
...@@ -249,6 +249,17 @@ class Sbatch(Slurm): ...@@ -249,6 +249,17 @@ class Sbatch(Slurm):
self.slurm_output_dir = f'{self.job.clone_path}/slurm_output' self.slurm_output_dir = f'{self.job.clone_path}/slurm_output'
self.slurm_output_file = f'{self.slurm_output_dir}/so_{self.job.jobid}.txt' self.slurm_output_file = f'{self.slurm_output_dir}/so_{self.job.jobid}.txt'
def get_batch_properties(self, batch_script):
# cmd_out = ""
if self.job.down_scoping:
stdout = self.job.execute(f"{srun_path} /usr/bin/cat {batch_script}", '',
f"{self.job.driver_path}/core/scripts/runHelper.sh", stdout=subprocess.PIPE,
text=True).stdout
cmd_out = ' '.join([l.split()[1] for l in stdout.split("\n") if l.startswith('#SBATCH')])
else:
with open(batch_script, 'r') as f:
cmd_out = ' '.join([l.split()[1] for l in f.readlines() if l.startswith('#SBATCH')])
return cmd_out
def get_combiner_script(self): def get_combiner_script(self):
self._combiner_script = f"{self.job.driver_path}/core/scripts/pipeHelper.sh" self._combiner_script = f"{self.job.driver_path}/core/scripts/pipeHelper.sh"
...@@ -256,7 +267,9 @@ class Sbatch(Slurm): ...@@ -256,7 +267,9 @@ class Sbatch(Slurm):
def get_run_properties(self): def get_run_properties(self):
self._run_properties = f'{sbatch_path} --wait --output={self.slurm_output_file} {self.job.get_parameters()}' batch_script = f'{self.job.clone_path}/{get_cenv("BATCH_SCRIPT")}'
self._run_properties = f'{sbatch_path} --wait {self.get_batch_properties(batch_script)} ' \
f'{self.job.get_parameters()} --output={self.slurm_output_file}'
return self._run_properties return self._run_properties
def custom_run_setup(self, **kwargs): def custom_run_setup(self, **kwargs):
......
import logging import logging
name = 'Aixcellenz CI Driver' name = 'Aixcellenz CI Driver'
version = '0.3.0' version = '0.3.1'
debug = False debug = False
stdout_logging = True stdout_logging = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment