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

Fix direct write to service account directories

parent cda1b6f4
No related branches found
No related tags found
No related merge requests found
...@@ -404,14 +404,25 @@ class Batch(Slurm): ...@@ -404,14 +404,25 @@ class Batch(Slurm):
class Singularity_Batch(Default): class Singularity_Batch(Default):
container = '' container = ''
@staticmethod
def escape(s):
return s.replace('/', '\/')
def custom_run_setup(self, **kwargs): def custom_run_setup(self, **kwargs):
Sbatch.custom_run_setup(self, **kwargs) Sbatch.custom_run_setup(self, **kwargs)
if kwargs["script_execution"] and kwargs["do_inbetween_processing"]: if kwargs["script_execution"] and kwargs["do_inbetween_processing"]:
logging.debug('Creating param file') logging.debug('Creating param file')
# write env_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}") 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): 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"
return self._combiner_script return self._combiner_script
...@@ -445,7 +456,7 @@ class Singularity_Batch(Default): ...@@ -445,7 +456,7 @@ class Singularity_Batch(Default):
skip_env=True, srun_wrap=True) skip_env=True, srun_wrap=True)
# add singularity specific parameter to the properties # add singularity specific parameter to the properties
property_split = self._run_properties.split(" ") 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) self._run_properties = " ".join(property_split)
return self._run_properties return self._run_properties
......
CONTAINER=_CONTAINER\0EXEC_WRAPPER=_EXEC_WRAPPER\0PARAMS=_PARAMS\0OUTPUT_FILE=_OUTPUT_FILE
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
_path=$1 _path=$1
set -e set -e
while test "$_path" != "/work"; do while test "$_path" != "/work"; do
chmod o+wx "$_path" chmod o+x "$_path"
_path=$(dirname "$_path") _path=$(dirname "$_path")
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment