Skip to content
Snippets Groups Projects
Commit fdc6c49a authored by Felix Tomski's avatar Felix Tomski
Browse files

Merge branch 'fix/direct-write' into 'main'

Fix direct write to service account directories

See merge request ci-playground/customdriver!24
parents cda1b6f4 ffe4ca13
Branches
Tags
No related merge requests found
......@@ -404,14 +404,25 @@ class Batch(Slurm):
class Singularity_Batch(Default):
container = ''
@staticmethod
def escape(s):
return s.replace('/', '\/')
def custom_run_setup(self, **kwargs):
Sbatch.custom_run_setup(self, **kwargs)
if kwargs["script_execution"] and kwargs["do_inbetween_processing"]:
logging.debug('Creating param file')
# write env_file
with open(f'{self.slurm_output_dir}/env{self.job.jobid}', 'w') as file:
with open(f'{self.job.tmp_dir}/env{self.job.jobid}', 'w') as file:
file.write(f"CONTAINER={self.container}\0EXEC_WRAPPER={srun_path}\0PARAMS={self.job.get_parameters()}\0OUTPUT_FILE=--output={self.slurm_output_file}")
self.job.execute(f'/usr/bin/cp /dev/stdin '
f'{self.slurm_output_dir}/batchEnv{self.job.jobid}',
f"{self.job.tmp_dir}/env{self.job.jobid}",
f"{self.job.driver_path}/core/scripts/pipeHelper.sh",
skip_env=True, srun_wrap=True)
def get_combiner_script(self):
self._combiner_script = f"{self.job.driver_path}/core/scripts/pipeHelper.sh"
return self._combiner_script
......@@ -445,7 +456,7 @@ class Singularity_Batch(Default):
skip_env=True, srun_wrap=True)
# add singularity specific parameter to the properties
property_split = self._run_properties.split(" ")
property_split.insert(1, f'--export-file={self.slurm_output_dir}/env{self.job.jobid}')
property_split.insert(1, f'--export-file={self.slurm_output_dir}/batchEnv{self.job.jobid}')
self._run_properties = " ".join(property_split)
return self._run_properties
......
CONTAINER=_CONTAINER\0EXEC_WRAPPER=_EXEC_WRAPPER\0PARAMS=_PARAMS\0OUTPUT_FILE=_OUTPUT_FILE
......@@ -2,7 +2,7 @@
_path=$1
set -e
while test "$_path" != "/work"; do
chmod o+wx "$_path"
chmod o+x "$_path"
_path=$(dirname "$_path")
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment