diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2df517d8ab63d9b3cc943cd706b00fd99a1b52c5..223bbf42050cc417f818f4e5a2ae8f60cb525e2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: .local-template: variables: - RUNNER_TAG: "ja664344-dev" + RUNNER_TAG: "custom2" .run-template: stage: run diff --git a/core/job.py b/core/job.py index 9f784bfa07f7e6f1c56fbaf929c0c4ecfb4d1882..4f9aa0a75e22b2e6de2eea1e6bfc30772977194b 100644 --- a/core/job.py +++ b/core/job.py @@ -90,11 +90,11 @@ class Job: self.rt_utility_path = rep(settings["Runtime Utility Path"]) self.scripts_path = f'{self.rt_utility_path}/scripts' if self.down_scoping: - try: + if (get_cenv('HPC_CI_TOKEN') != None): uid, pid = jwt.get_UID_PID_ID_TOKEN(get_cenv('HPC_CI_TOKEN'), f"{get_cenv('CI_SERVER_URL')}/-/jwks") - except: - logging.warn("id token HPC_CI_TOKEN, with aud: aixCIlence not defined.") + else: + print("WARNING:id token HPC_CI_TOKEN, with aud: aixCIlence not defined.", file=sys.stderr) try: uid, pid = jwt.get_UID_PID_CI_JOB_JWT(get_cenv('CI_JOB_JWT'), f"{get_cenv('CI_SERVER_URL')}/-/jwks") @@ -112,7 +112,6 @@ class Job: else: self.user_path = rep(settings['User Path']) - def __setup(self): self.__get_config() if not self.down_scoping: diff --git a/core/modes/slurm/batch.py b/core/modes/slurm/batch.py index df3d64a98bcdf1f2ac7ae129e490ed9e1bc555a9..2c21dae562e42fe3d6115e7f8d428ac778764a0b 100644 --- a/core/modes/slurm/batch.py +++ b/core/modes/slurm/batch.py @@ -74,7 +74,8 @@ class Sbatch(Slurm, ABC): tmp = os.getenv("TMP") with open(f'{self.job.scripts_path}/batchWrapper.sh', 'r') as file: filedata = file.read() - filedata = filedata.replace('replaceme', f'{self.job.clone_path}/{get_cenv("BATCH_SCRIPT")}') + filedata = filedata.replace('replacesource', f'{self.job.shell_config}') + filedata = filedata.replace('replacescript', f'{self.job.clone_path}/{get_cenv("BATCH_SCRIPT")}') with open(f'{tmp}/wrapper{self.job.jobid}', 'w') as file: file.write(filedata) return f'{tmp}/wrapper{self.job.jobid}' @@ -126,7 +127,8 @@ class Default(Sbatch, ABC): tmp = os.getenv("TMP") with open(f'{self.job.scripts_path}/batchWrapper.sh', 'r') as file: filedata = file.read() - filedata = filedata.replace('replaceme', f'{self.job.clone_path}/script.') + filedata = filedata.replace('replacescript', f'{self.job.clone_path}/script.') + filedata = filedata.replace('replacesource', f'{self.job.shell_config}') with open(f'{tmp}/wrapper{self.job.jobid}', 'w') as file: file.write(filedata) return f'{tmp}/wrapper{self.job.jobid}' diff --git a/core/modes/slurm/singularity.py b/core/modes/slurm/singularity.py index 5d20c20b3b88c0ba2c5faf77a8c48c69fa4f0b15..cba750e3af73beb8c0cf9fff8855e105335a1d16 100644 --- a/core/modes/slurm/singularity.py +++ b/core/modes/slurm/singularity.py @@ -81,7 +81,7 @@ class Singularity_Batch(Default, ABC): tmp = os.getenv("TMP") with open(f'{self.job.runner_path}/utility/runtime/scripts/batchWrapper.sh', 'r') as file: filedata = file.read() - filedata = filedata.replace('replaceme', + filedata = filedata.replace('replacescript', f'{self.job.clone_path}/singularity{self.job.jobid}.sh < ' f'{self.job.clone_path}/script{self.job.jobid}.sh') with open(f'{tmp}/wrapper{self.job.jobid}', 'w') as file: diff --git a/core/utility/defines.py b/core/utility/defines.py index f916efe4660e4053d099ae32deb25b77dbf078c7..2a171643230161808b392e4409565e2301ba29dc 100644 --- a/core/utility/defines.py +++ b/core/utility/defines.py @@ -1,6 +1,6 @@ import logging name = 'AixCIlenz CI Driver' -version = '0.5.2' +version = '0.5.3' debug = False stdout_logging = False diff --git a/core/utility/executor.py b/core/utility/executor.py index 370ec842c2e2b31d690e5d71b7b8302ebe2b04d8..365795081ab41a9b8dee5b6894c092768df360e4 100644 --- a/core/utility/executor.py +++ b/core/utility/executor.py @@ -163,7 +163,7 @@ class Slurm_Executor(Executor, ABC): allocator=self.get_srun_cmd(), params=f'--jobid={self.simple_job_id} {self.get_default_params()} {params}', wrapper_add=wrapper_add, - pre_exec_scripts=[self.job.shell_config], + #pre_exec_scripts=[self.job.shell_config], target_script=script, install_env=install_env, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout logging.debug(management_out) diff --git a/utility/runtime/scripts/batchWrapper.sh b/utility/runtime/scripts/batchWrapper.sh index 735e714be0e0c2f3ab89be5a6fddd631fe9c4aff..e00fb880f421309a04d091bb287f78dbf35352ff 100644 --- a/utility/runtime/scripts/batchWrapper.sh +++ b/utility/runtime/scripts/batchWrapper.sh @@ -1,3 +1,5 @@ #!/usr/bin/zsh -zsh -l replaceme \ No newline at end of file +source replacesource + +zsh -l replacescript diff --git a/utility/runtime/scripts/chmodPath.sh b/utility/runtime/scripts/chmodPath.sh index cb9816560ccd10507f9b1dd998f7837fd4e42d51..d59bcac778ec21c24f1ab926577e43ecbabd2a81 100755 --- a/utility/runtime/scripts/chmodPath.sh +++ b/utility/runtime/scripts/chmodPath.sh @@ -2,7 +2,7 @@ _path=$1 set -e while test "$_path" != "/work"; do - chmod o+x "$_path" + chmod o+rx "$_path" _path=$(dirname "$_path") done