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

Merge branch 'fix/internal-slurm-expired' into 'main'

Fix check whether internal slurm job expired

See merge request ci-playground/customdriver!28
parents b49e1e45 7c63eccb
No related branches found
No related tags found
No related merge requests found
...@@ -171,7 +171,12 @@ class Slurm(ModeBase): ...@@ -171,7 +171,12 @@ class Slurm(ModeBase):
with open(f"{self.job.driver_path}/SlurmIDMapping.json", "r") as file: with open(f"{self.job.driver_path}/SlurmIDMapping.json", "r") as file:
mapping = json.loads(file.read()) mapping = json.loads(file.read())
self.slurm_simple_job_id = mapping[get_cenv("CI_JOB_ID")] self.slurm_simple_job_id = mapping[get_cenv("CI_JOB_ID")]
if self.job.down_scoping:
if not subprocess.run([f'{self.job.driver_path}/core/scripts/runHelper.sh',
f'sudo -u {self.job.account} srun --jobid={self.slurm_simple_job_id} /usr/bin/zsh -l -c echo']).returncode:
return return
else:
man.remove_id_mapping(f"{self.job.driver_path}/SlurmIDMapping.json", get_cenv("CI_JOB_ID"))
except (IOError, KeyError): except (IOError, KeyError):
self.slurm_simple_job_id = None self.slurm_simple_job_id = None
logging.warning(f'Could not read internal Slurm jobid from mapping file') logging.warning(f'Could not read internal Slurm jobid from mapping file')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment